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/state.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/state.c')
| -rw-r--r-- | src/state.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c index 0d236e660..26e7dff4a 100644 --- a/src/state.c +++ b/src/state.c @@ -15,7 +15,7 @@ void mrb_init_ext(mrb_state*); mrb_state* mrb_open_allocf(mrb_allocf f) { - mrb_state *mrb = (f)(NULL, NULL, sizeof(mrb_state)); + mrb_state *mrb = (mrb_state *)(f)(NULL, NULL, sizeof(mrb_state)); if (mrb == NULL) return NULL; memset(mrb, 0, sizeof(mrb_state)); @@ -76,14 +76,14 @@ mrb_add_irep(mrb_state *mrb, int idx) int max = 256; if (idx > max) max = idx+1; - mrb->irep = mrb_calloc(mrb, max, sizeof(mrb_irep*)); + mrb->irep = (mrb_irep **)mrb_calloc(mrb, max, sizeof(mrb_irep*)); mrb->irep_capa = max; } else if (mrb->irep_capa <= idx) { while (mrb->irep_capa <= idx) { mrb->irep_capa *= 2; } - mrb->irep = mrb_realloc(mrb, mrb->irep, sizeof(mrb_irep*)*mrb->irep_capa); + mrb->irep = (mrb_irep **)mrb_realloc(mrb, mrb->irep, sizeof(mrb_irep*)*mrb->irep_capa); } } |
