This commit is contained in:
Yuichi Nishiwaki 2014-09-27 19:58:04 +09:00
parent d165b6ea6f
commit 552ee7444f
3 changed files with 9 additions and 7 deletions

View File

@ -1375,7 +1375,7 @@ codegen(codegen_state *state, pic_value obj)
return; return;
} }
else if (sym == state->sCALL || sym == state->sTAILCALL) { else if (sym == state->sCALL || sym == state->sTAILCALL) {
int len = pic_length(pic, obj); int len = (int)pic_length(pic, obj);
pic_value elt; pic_value elt;
pic_for_each (elt, pic_cdr(pic, obj)) { pic_for_each (elt, pic_cdr(pic, obj)) {
@ -1401,7 +1401,7 @@ codegen(codegen_state *state, pic_value obj)
return; return;
} }
else if (sym == state->sRETURN) { else if (sym == state->sRETURN) {
int len = pic_length(pic, obj); int len = (int)pic_length(pic, obj);
pic_value elt; pic_value elt;
pic_for_each (elt, pic_cdr(pic, obj)) { pic_for_each (elt, pic_cdr(pic, obj)) {

2
time.c
View File

@ -27,7 +27,7 @@ pic_current_jiffy(pic_state *pic)
pic_get_args(pic, ""); pic_get_args(pic, "");
c = clock(); c = clock();
return pic_int_value((int)c); return pic_int_value((int)c); /* The year 2038 problem :-| */
} }
static pic_value static pic_value

8
vm.c
View File

@ -212,9 +212,11 @@ pic_get_args(pic_state *pic, const char *format, ...)
if (x < 0) { if (x < 0) {
pic_errorf(pic, "pic_get_args: expected non-negative int, but got ~s", v); pic_errorf(pic, "pic_get_args: expected non-negative int, but got ~s", v);
} }
if (sizeof(unsigned) > sizeof(size_t) && (unsigned)x > (unsigned)SIZE_MAX) { if (sizeof(unsigned) > sizeof(size_t)) {
if ((unsigned)x > (unsigned)SIZE_MAX) {
pic_errorf(pic, "pic_get_args: int unrepresentable with size_t ~s", v); pic_errorf(pic, "pic_get_args: int unrepresentable with size_t ~s", v);
} }
}
*k = (size_t)x; *k = (size_t)x;
break; break;
default: default:
@ -707,7 +709,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args)
else { else {
int argc, i; int argc, i;
argc = pic_length(pic, args) + 1; argc = (int)pic_length(pic, args) + 1;
VM_BOOT_PRINT; VM_BOOT_PRINT;
@ -1139,7 +1141,7 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
ci = PUSHCI(); ci = PUSHCI();
ci->ip = (pic_code *)iseq; ci->ip = (pic_code *)iseq;
ci->fp = pic->sp; ci->fp = pic->sp;
ci->retc = pic_length(pic, args); ci->retc = (int)pic_length(pic, args);
if (ci->retc == 0) { if (ci->retc == 0) {
return pic_none_value(); return pic_none_value();