Commit Graph

34 Commits

Author SHA1 Message Date
Yukihiro Matsumoto cc86250297 remove unsafe macros in hash.h 2012-06-03 00:23:59 +09:00
Yukihiro Matsumoto ecbaf9cd99 simpler implementation of Hash#empty? 2012-06-02 23:52:32 +09:00
Yukihiro Matsumoto 8d0cc57a43 hash->ht might be NULL; it shouldn't though 2012-06-02 23:50:34 +09:00
Yukihiro Matsumoto 090e896d48 hash->ht might be NULL; it shouldn't though 2012-06-02 23:46:30 +09:00
Yukihiro Matsumoto 110cdd82e0 naming convention consistency for hash.h 2012-06-02 21:47:27 +09:00
Yukihiro Matsumoto de133c3715 refactoring around mrb_hash_new 2012-06-02 21:42:52 +09:00
Yukihiro Matsumoto 9b9b345697 remove unnecessary header inclusion from hash.c 2012-06-01 02:45:23 +09:00
Yukihiro Matsumoto b7d5ccdb36 small refactoring; hash->ht should not be NULL 2012-06-01 02:30:54 +09:00
Yukihiro Matsumoto 1321a157c2 values need not to dup unlike keys 2012-06-01 02:28:21 +09:00
Yukihiro Matsumoto 2a6b5b8ff5 stop using mrb_exec_recursive_paired() from Hash#== 2012-06-01 01:40:12 +09:00
Yukihiro Matsumoto 6caeb8f8fb hash function should use #eql? internally 2012-06-01 01:30:44 +09:00
Yukihiro Matsumoto 6a2cf46ff9 hash function should use #hash internally 2012-06-01 01:25:16 +09:00
Yukihiro Matsumoto 3c80a5e2bf add inline to KHASH_INIT functions 2012-06-01 01:18:20 +09:00
Yukihiro Matsumoto 7cf607bb75 stop duping values from Hash#values 2012-05-30 16:25:22 +09:00
Yukihiro Matsumoto a4a48e3da1 specify allocating array size for Hash#values 2012-05-30 16:12:32 +09:00
Yukihiro Matsumoto b275be253d Hash#keys stop duping keys 2012-05-28 12:24:31 +09:00
Yukihiro Matsumoto ad9e841c53 made mrb_get_args() better (optinal args, type checks); close #173 #176 2012-05-24 01:09:36 +09:00
Yukihiro Matsumoto 4523bee953 cast style consistency 2012-05-23 03:31:55 +09:00
Mitchell Blank Jr 9e336b00e5 More C++ compilability work: mrb_obj_alloc void* conversions
One of the biggest set of changes needed to make C++ compile, is that you
can't autoconvert "void*" to a different pointer type without a cast (you
can of course, convert pointers *to* "void*"!)

For the first part, convert the users of "mrb_obj_alloc".  Since it has
to return something, make it RBasic* (that's what mrb_obj_alloc() is
operating on anyway).  This way, even in C you'll get a warning if you
don't cast it.

For places where there are a lot of similar calls to mrb_obj_alloc(),
this can be easily hidden through a macro.  I did this in string.c:
    #define mrb_obj_alloc_string(mrb) ((struct RString *) mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))

I also updated the mrb_object() macro to also return a RBasic* -- my
previous commit changed that from "void*" -> "RObject*", but I figure
it should be consistent with mrb_obj_alloc()
2012-05-20 09:43:14 -07:00
Yukihiro "Matz" Matsumoto ac31b58fe8 Merge pull request #169 from mitchblank/cplusplus
Part 1 of C++ compilability
2012-05-20 06:09:31 -07:00
Yukihiro Matsumoto ee72000161 use mrb_assoc_new to generate a key-value pair 2012-05-20 22:05:49 +09:00
Mitchell Blank Jr d9529f198d fix mrb_gc_mark_ht_size() and mrb_gc_free_ht() types
mrb_gc_mark_ht_size() and mrb_gc_free_ht() were declared in gc.h as
taking a "RHash *" argument, but then they were defined in hash.c
as taking a "RClass *"  Get these in sync.
2012-05-19 23:33:01 -07:00
Daniel Bovensiepen e1e072b800 Fix Hash#shift return value from Hash to Array 2012-05-20 13:18:34 +08:00
Yukihiro Matsumoto da9e8cebe0 remove __APPLE__ 2012-05-09 12:07:29 +09:00
Yukihiro Matsumoto f4cf8ea423 partial VC support 2012-05-09 08:49:38 +09:00
Yukihiro Matsumoto b0e94d8c14 Time class available; based on code from @beoran; sorry for jumbo patch 2012-05-06 00:52:22 +09:00
Yukihiro Matsumoto 803dcb512e more hash refactored 2012-05-05 09:03:16 +09:00
Yukihiro Matsumoto e0460c1157 hash refactored 2012-05-05 08:55:58 +09:00
roco 4ec6d41f16 rm whitespace 2012-04-30 14:29:19 -07:00
Patrick Hogan a408ba2dd6 Remove unused ret argument from kh_put.
It doesn't appear to serve any purpose and allows removing warning about various unused variables littered around.

Signed-off-by: Patrick Hogan <pbhogan@gmail.com>
2012-04-26 08:36:32 -05:00
Patrick Hogan 132dd25528 Remove a bunch of unused variables.
Removed or commented out to stop compiler whining about them.

Signed-off-by: Patrick Hogan <pbhogan@gmail.com>
2012-04-26 08:36:32 -05:00
Yukihiro Matsumoto 8b367098ac move header files {irep,dump,cdump,ritehash}.h to /include/mruby 2012-04-24 17:41:28 +09:00
mimaki 835443614d add file header 2012-04-23 11:46:16 +09:00
mimaki e0d6430f63 add mruby sources 2012-04-20 09:39:03 +09:00