diff options
| author | Paolo Bosetti <[email protected]> | 2012-08-06 15:02:03 +0200 |
|---|---|---|
| committer | Paolo Bosetti <[email protected]> | 2012-08-06 15:02:56 +0200 |
| commit | aa0d2f91447c49363059f2e95cb9023f65a6fbef (patch) | |
| tree | 2cfa325956e62648f2161564adfdf6dddc45b737 /src/state.c | |
| parent | fd097b8aff7b91bd105fc1daec5a4050a947b763 (diff) | |
| parent | 193c98ae540d43d082795fd77ea81a4f6f7fd0f6 (diff) | |
| download | mruby-aa0d2f91447c49363059f2e95cb9023f65a6fbef.tar.gz mruby-aa0d2f91447c49363059f2e95cb9023f65a6fbef.zip | |
Updated Xcode project build settings in conformity with 10.8/Xcode 4.4
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c index b3946bad9..26e7dff4a 100644 --- a/src/state.c +++ b/src/state.c @@ -15,7 +15,8 @@ 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)); mrb->allocf = f; @@ -75,14 +76,14 @@ mrb_add_irep(mrb_state *mrb, int idx) int max = 256; if (idx > max) max = idx+1; - mrb->irep = mrb_malloc(mrb, sizeof(mrb_irep*)*max); + 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); } } |
