diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-15 15:56:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:12 +0900 |
| commit | d2f267a13dcce67e45ef358e1f133362b0a1c12e (patch) | |
| tree | c6583467439c7943a16f68707da589da8baa7292 /src | |
| parent | a4a1e01e8123928057dff9b43e034c1dd137af81 (diff) | |
| download | mruby-d2f267a13dcce67e45ef358e1f133362b0a1c12e.tar.gz mruby-d2f267a13dcce67e45ef358e1f133362b0a1c12e.zip | |
Add casts to silence warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dump.c | 8 | ||||
| -rw-r--r-- | src/load.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dump.c b/src/dump.c index 31dceb593..c9b5ccc9d 100644 --- a/src/dump.c +++ b/src/dump.c @@ -160,7 +160,7 @@ write_pool_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf) { int pool_no; uint8_t *cur = buf; - int len; + mrb_int len; const char *ptr; cur += uint16_to_bin(irep->plen, cur); /* number of pool */ @@ -936,11 +936,11 @@ dump_pool(mrb_state *mrb, const mrb_pool_value *p, FILE *fp) if (p->tt & IREP_TT_NFLAG) { /* number */ switch (p->tt) { case IREP_TT_INT32: - fprintf(fp, "{IREP_TT_INT32, {.i32=%"PRId32"}},\n", p->u.i32); + fprintf(fp, "{IREP_TT_INT32, {.i32=%" PRId32 "}},\n", p->u.i32); break; #ifdef MRB_64BIT case IREP_TT_INT64: - fprintf(fp, "{IREP_TT_INT64, {.i64=%"PRId64"}},\n", p->u.i64); + fprintf(fp, "{IREP_TT_INT64, {.i64=%" PRId64 "}},\n", p->u.i64); break; #endif case IREP_TT_FLOAT: @@ -948,7 +948,7 @@ dump_pool(mrb_state *mrb, const mrb_pool_value *p, FILE *fp) fprintf(fp, "{IREP_TT_FLOAT, {.f=%#.1f}},\n", p->u.f); } else { - fprintf(fp, "{IREP_TT_FLOAT, {.f="MRB_FLOAT_FMT"}},\n", p->u.f); + fprintf(fp, "{IREP_TT_FLOAT, {.f=" MRB_FLOAT_FMT "}},\n", p->u.f); } break; } diff --git a/src/load.c b/src/load.c index 766aa0648..45fe38736 100644 --- a/src/load.c +++ b/src/load.c @@ -242,8 +242,8 @@ read_irep_record(mrb_state *mrb, const uint8_t *bin, size_t *len, uint8_t flags) struct RData *irep_obj = mrb_data_object_alloc(mrb, mrb->object_class, NULL, &tempirep_type); int ai = mrb_gc_arena_save(mrb); mrb_irep *irep = read_irep_record_1(mrb, bin, len, flags); - int i; mrb_irep **reps; + int i; mrb_gc_arena_restore(mrb, ai); if (irep == NULL) { |
