Commit Graph

28 Commits

Author SHA1 Message Date
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
Mitchell Blank Jr 365cc40ac5 C++ compilabilty -- "new" is a C++ keyword, avoid it 2012-05-19 23:20:44 -07:00
Yukihiro Matsumoto b68e69aa32 remove unused assignments 2012-05-17 12:57:08 +09:00
Yukihiro Matsumoto 2541530239 add mrb_define_singleton_method/mrb_define_module_function 2012-05-17 02:44:41 +09:00
Masaki Muranaka c6f0e296bd Remove some redundant function declarations. 2012-05-16 14:31:48 +09:00
Yukihiro Matsumoto f4cf8ea423 partial VC support 2012-05-09 08:49:38 +09:00
Yukihiro Matsumoto 8a6d4a8b82 add Class#inherited hook 2012-05-08 23:25:13 +09:00
Yukihiro Matsumoto 56817a91a7 mrb_get_arg(i/f) should set zero from nil 2012-05-06 02:14:51 +09:00
Yukihiro Matsumoto 55da4cdc86 Merge branch 'master' of github.com:mruby/mruby 2012-05-06 00:18:46 +09:00
Yukihiro Matsumoto 53d8339a71 remove unused argc check 2012-05-05 07:49:10 +09:00
Yukihiro Matsumoto bf6652886d typo fixed 2012-05-05 07:48:36 +09:00
Yukihiro Matsumoto a18ab06a23 mrb_get_args(i) should convert using to_int 2012-05-05 07:46:33 +09:00
Yukihiro Matsumoto b780e63000 mrb_get_args(f) should convert using to_f 2012-05-05 07:41:02 +09:00
Yukihiro Matsumoto eac8e4a303 move mrb_obj_is_instance_of from range.c to kernel.c 2012-05-05 00:21:23 +09:00
Kazuki Tsujimoto 6545fe241b Fix SEGV when including an object other than Module 2012-05-04 19:57:02 +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 a4c9853813 More switch statement cleanup.
Signed-off-by: Patrick Hogan <pbhogan@gmail.com>
2012-04-26 08:36:32 -05:00
Yukihiro Matsumoto c6f5f637e2 supeclass type check prohibits class definition without superclass specified 2012-04-26 06:07:41 +09:00
Yukihiro Matsumoto 8ab46d241c superclass should be a class 2012-04-24 18:27:35 +09:00
Yukihiro Matsumoto 8b367098ac move header files {irep,dump,cdump,ritehash}.h to /include/mruby 2012-04-24 17:41:28 +09:00
Yukihiro Matsumoto 2fc1b8af2d mv variable.h to mruby/variable.h 2012-04-24 15:59:50 +09:00
Yukihiro Matsumoto a45c23990b fix inheritance chain; fix #41 2012-04-23 18:14:18 +09:00
mimaki 835443614d add file header 2012-04-23 11:46:16 +09:00
Yukihiro Matsumoto fe585b2336 no need to pre-allocate method table 2012-04-20 13:56:02 +09:00
Yukihiro Matsumoto a016c62b7e undef Module#new 2012-04-20 13:18:15 +09:00
Yukihiro Matsumoto d9ce44e99b wrong inheritance chain from singleton class 2012-04-20 13:17:56 +09:00
mimaki e0d6430f63 add mruby sources 2012-04-20 09:39:03 +09:00