From 350f4d1abd7224c7d500f1c3b4d2a3c27c5ed2b3 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 28 Oct 2013 00:24:51 +0900 Subject: [PATCH] [bugfix] support 'I' format in pic_get_args --- src/vm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/vm.c b/src/vm.c index e42ab1c7..9c30c044 100644 --- a/src/vm.c +++ b/src/vm.c @@ -81,6 +81,29 @@ pic_get_args(pic_state *pic, const char *format, ...) } } break; + case 'I': + { + int *k; + bool *e; + + k = va_arg(ap, int *); + e = va_arg(ap, bool *); + if (i < argc) { + pic_value v; + + v = GET_OPERAND(pic, i); + if (pic_type(v) == PIC_TT_FLOAT) { + *k = (int)pic_float(v); + *e = false; + } + else { + *k = pic_int(v); + *e = true; + } + i++; + } + } + break; case 's': { pic_value str;