Some notes:
case T_INT: +#if 0 sprintf(buf, "%"PRINTPIKEINT"d", sp[-1].u.integer); +#else
- {
+#define sizeNUM(v) (8*sizeof(v)*4/10+1+1)
^^^^^^^^^^^^^^^^^^^^ It'd be nice with a comment explaining the various integers above.
INT32 org;
^^^^^ You should probably have INT_TYPE here; otherwise there'll be problems with semi-large integers on 64-bit architectures.
char buf[sizeNUM(org)];
register char*b = buf+sizeof buf-1;
register unsigned i;
^^^^^^^^ unsigned INT_TYPE here (same as with org above).
org = sp[-1].u.integer;
[...]
- case T_FLOAT:
- case T_FLOAT: {
- char buf[sizeNUM(double)*2];
^^^^^^^^^^^^^^^^^ Is this safe? What about the exponent?
sprintf(buf, "%f", (double)sp[-1].u.float_number);
[...]
-- Sincerely, Stephen R. van den Berg.