Commit 490fa452 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

add cast to remove warning; close #154

parent d65542cc
......@@ -1481,7 +1481,7 @@ codegen(codegen_scope *s, node *tree, int val)
char buf[4];
int sym;
snprintf(buf, 3, "$%c", (intptr_t)tree);
snprintf(buf, 3, "$%c", (int)(intptr_t)tree);
sym = new_sym(s, mrb_intern(s->mrb, buf));
genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym));
push();
......@@ -1493,7 +1493,7 @@ codegen(codegen_scope *s, node *tree, int val)
char buf[4];
int sym;
snprintf(buf, 3, "$%d", (intptr_t)tree);
snprintf(buf, 3, "$%d", (int)(intptr_t)tree);
sym = new_sym(s, mrb_intern(s->mrb, buf));
genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym));
push();
......
......@@ -5238,11 +5238,11 @@ parser_dump(mrb_state *mrb, node *tree, int offset)
break;
case NODE_BACK_REF:
printf("NODE_BACK_REF: $%c\n", (int)tree);
printf("NODE_BACK_REF: $%c\n", (int)(intptr_t)tree);
break;
case NODE_NTH_REF:
printf("NODE_NTH_REF: $%d\n", (int)tree);
printf("NODE_NTH_REF: $%d\n", (int)(intptr_t)tree);
break;
case NODE_ARG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment