Add casts to silence warnings.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
#include <ctype.h>
#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
@@ -612,13 +613,13 @@ new_lit(codegen_scope *s, mrb_value val)
switch (mrb_type(val)) {
case MRB_TT_STRING:
if (RSTR_NOFREE_P(RSTRING(val))) {
- pv->tt = (RSTRING_LEN(val)<<2) | IREP_TT_SSTR;
+ pv->tt = (uint32_t)(RSTRING_LEN(val)<<2) | IREP_TT_SSTR;
pv->u.str = RSTRING_PTR(val);
}
else {
char *p;
mrb_int len = RSTRING_LEN(val);
- pv->tt = (len<<2) | IREP_TT_STR;
+ pv->tt = (uint32_t)(len<<2) | IREP_TT_STR;
p = (char*)codegen_realloc(s, NULL, len+1);
memcpy(p, RSTRING_PTR(val), len);
p[len] = '\0';

MODIFY
src/dump.c
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 */

MODIFY
src/load.c
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) {

Add casts to silence warnings.