From 0403ca5570c81004f5477cfd97f2ccd2ba9fe499 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 27 Sep 2014 20:21:54 +0900 Subject: [PATCH] more fixes --- cont.c | 16 ++++++++-------- include/picrin/cont.h | 4 ++-- include/picrin/pair.h | 2 +- pair.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cont.c b/cont.c index 41a0fdb8..4e38e8c6 100644 --- a/cont.c +++ b/cont.c @@ -184,14 +184,14 @@ pic_values5(pic_state *pic, pic_value arg1, pic_value arg2, pic_value arg3, pic_ } pic_value -pic_values_by_array(pic_state *pic, int argc, pic_value *argv) +pic_values_by_array(pic_state *pic, size_t argc, pic_value *argv) { - int i; + size_t i; for (i = 0; i < argc; ++i) { pic->sp[i] = argv[i]; } - pic->ci->retc = argc; + pic->ci->retc = (int)argc; return argc == 0 ? pic_none_value() : pic->sp[0]; } @@ -211,15 +211,15 @@ pic_values_by_list(pic_state *pic, pic_value list) return pic_nil_p(list) ? pic_none_value() : pic->sp[0]; } -int -pic_receive(pic_state *pic, int n, pic_value *argv) +size_t +pic_receive(pic_state *pic, size_t n, pic_value *argv) { pic_callinfo *ci; - int i, retc; + size_t i, retc; /* take info from discarded frame */ ci = pic->ci + 1; - retc = ci->retc; + retc = (size_t)ci->retc; for (i = 0; i < retc && i < n; ++i) { argv[i] = ci->fp[i]; @@ -263,7 +263,7 @@ static pic_value pic_cont_call_with_values(pic_state *pic) { struct pic_proc *producer, *consumer; - int argc; + size_t argc; pic_value args[256]; pic_get_args(pic, "ll", &producer, &consumer); diff --git a/include/picrin/cont.h b/include/picrin/cont.h index 01e86e11..645e6d9c 100644 --- a/include/picrin/cont.h +++ b/include/picrin/cont.h @@ -40,9 +40,9 @@ pic_value pic_values2(pic_state *, pic_value, pic_value); pic_value pic_values3(pic_state *, pic_value, pic_value, pic_value); pic_value pic_values4(pic_state *, pic_value, pic_value, pic_value, pic_value); pic_value pic_values5(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value); -pic_value pic_values_by_array(pic_state *, int, pic_value *); +pic_value pic_values_by_array(pic_state *, size_t, pic_value *); pic_value pic_values_by_list(pic_state *, pic_value); -int pic_receive(pic_state *, int, pic_value *); +size_t pic_receive(pic_state *, size_t, pic_value *); pic_value pic_escape(pic_state *, struct pic_proc *); diff --git a/include/picrin/pair.h b/include/picrin/pair.h index d6cf779d..d489b765 100644 --- a/include/picrin/pair.h +++ b/include/picrin/pair.h @@ -56,7 +56,7 @@ pic_value pic_list4(pic_state *, pic_value, pic_value, pic_value, pic_value); pic_value pic_list5(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value); pic_value pic_list6(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value); pic_value pic_list7(pic_state *, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value, pic_value); -pic_value pic_list_by_array(pic_state *, int, pic_value *); +pic_value pic_list_by_array(pic_state *, size_t, pic_value *); pic_value pic_make_list(pic_state *, size_t, pic_value); #define pic_for_each(var, list) \ diff --git a/pair.c b/pair.c index f2803f1a..b662534a 100644 --- a/pair.c +++ b/pair.c @@ -160,7 +160,7 @@ pic_list7(pic_state *pic, pic_value obj1, pic_value obj2, pic_value obj3, pic_va } pic_value -pic_list_by_array(pic_state *pic, int c, pic_value *vs) +pic_list_by_array(pic_state *pic, size_t c, pic_value *vs) { pic_value v;