add cast to remove warning; close #154

This commit is contained in:
Yukihiro Matsumoto
2012-05-17 16:38:37 +09:00
parent d65542cca8
commit 490fa45298
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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();
+2 -2
View File
@@ -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: