diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-29 17:42:17 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-07-29 17:42:17 -0700 |
| commit | ff707384c37c2b12623055c00ba8b9a23aca9974 (patch) | |
| tree | 0586e062177c9cdd61be6074db8c5513e436b110 /src/struct.c | |
| parent | d0c1b7b4a8cad2c5a01ccfbe97ffd0381f592f39 (diff) | |
| parent | 50b9f54a6527477d825049c4f0a8f14f7bb4482c (diff) | |
| download | mruby-ff707384c37c2b12623055c00ba8b9a23aca9974.tar.gz mruby-ff707384c37c2b12623055c00ba8b9a23aca9974.zip | |
Merge pull request #407 from silverhammermba/cpp
C++ compatibility
Diffstat (limited to 'src/struct.c')
| -rw-r--r-- | src/struct.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/struct.c b/src/struct.c index 0a95f9e49..a133dc046 100644 --- a/src/struct.c +++ b/src/struct.c @@ -184,7 +184,7 @@ mrb_id_attrset(mrb_state *mrb, mrb_sym id) mrb_sym mid; name = mrb_sym2name_len(mrb, id, &len); - buf = mrb_malloc(mrb, len+2); + buf = (char *)mrb_malloc(mrb, len+2); memcpy(buf, name, len); buf[len] = '='; buf[len+1] = '\0'; @@ -427,7 +427,7 @@ mrb_struct_initialize_withArg(mrb_state *mrb, int argc, mrb_value *argv, mrb_val mrb_raise(mrb, E_ARGUMENT_ERROR, "struct size differs"); } st = RSTRUCT(self); - st->ptr = mrb_calloc(mrb, sizeof(mrb_value), n); + st->ptr = (mrb_value *)mrb_calloc(mrb, sizeof(mrb_value), n); st->len = n; memcpy(st->ptr, argv, sizeof(mrb_value)*argc); |
