From 552ee7444fc6e1519a84eb5d8cc5cbc6ae15cf91 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 27 Sep 2014 19:58:04 +0900 Subject: [PATCH] more fix --- codegen.c | 4 ++-- time.c | 2 +- vm.c | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/codegen.c b/codegen.c index c4e3121e..f6183278 100644 --- a/codegen.c +++ b/codegen.c @@ -1375,7 +1375,7 @@ codegen(codegen_state *state, pic_value obj) return; } 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_for_each (elt, pic_cdr(pic, obj)) { @@ -1401,7 +1401,7 @@ codegen(codegen_state *state, pic_value obj) return; } else if (sym == state->sRETURN) { - int len = pic_length(pic, obj); + int len = (int)pic_length(pic, obj); pic_value elt; pic_for_each (elt, pic_cdr(pic, obj)) { diff --git a/time.c b/time.c index a0a1ffb6..83716db8 100644 --- a/time.c +++ b/time.c @@ -27,7 +27,7 @@ pic_current_jiffy(pic_state *pic) pic_get_args(pic, ""); c = clock(); - return pic_int_value((int)c); + return pic_int_value((int)c); /* The year 2038 problem :-| */ } static pic_value diff --git a/vm.c b/vm.c index 97e21bf6..fbdd6c2b 100644 --- a/vm.c +++ b/vm.c @@ -212,8 +212,10 @@ pic_get_args(pic_state *pic, const char *format, ...) if (x < 0) { 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) { - pic_errorf(pic, "pic_get_args: int unrepresentable with size_t ~s", v); + 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); + } } *k = (size_t)x; break; @@ -707,7 +709,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args) else { int argc, i; - argc = pic_length(pic, args) + 1; + argc = (int)pic_length(pic, args) + 1; VM_BOOT_PRINT; @@ -1139,7 +1141,7 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args) ci = PUSHCI(); ci->ip = (pic_code *)iseq; ci->fp = pic->sp; - ci->retc = pic_length(pic, args); + ci->retc = (int)pic_length(pic, args); if (ci->retc == 0) { return pic_none_value();