[bugfix] support 'I' format in pic_get_args

This commit is contained in:
Yuichi Nishiwaki 2013-10-28 00:24:51 +09:00
parent d3df6dcbf2
commit 350f4d1abd
1 changed files with 23 additions and 0 deletions

View File

@ -81,6 +81,29 @@ pic_get_args(pic_state *pic, const char *format, ...)
} }
} }
break; 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': case 's':
{ {
pic_value str; pic_value str;