char *
yasm_intnum_get_str(const yasm_intnum *intn)
{
- char *s, *s2;
+ unsigned char *s;
switch (intn->type) {
case INTNUM_UL:
- s = yasm_xmalloc(20);
- sprintf(s, "0x%lx", intn->val.ul);
- return s;
+ s = yasm_xmalloc(16);
+ sprintf((char *)s, "%lu", intn->val.ul);
+ return (char *)s;
+ break;
case INTNUM_BV:
- if (BitVector_msb_(intn->val.bv)) {
- /* it's negative: negate the bitvector to get positive */
- BitVector_Negate(conv_bv, intn->val.bv);
- s2 = (char *)BitVector_to_Hex(conv_bv);
- s = yasm_xmalloc(strlen(s2)+4);
- strcpy(s, "-0x");
- strcat(s, s2);
- yasm_xfree(s2);
- } else {
- s2 = (char *)BitVector_to_Hex(intn->val.bv);
- s = yasm_xmalloc(strlen(s2)+3);
- strcpy(s, "0x");
- strcat(s, s2);
- yasm_xfree(s2);
- }
- return s;
+ return (char *)BitVector_to_Dec(intn->val.bv);
+ break;
}
/*@notreached@*/
return NULL;
EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.errwarn
EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-bigint.asm
EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-bigint.hex
+EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-decimal.asm
+EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-decimal.hex
EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.asm
EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.errwarn
EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.hex
--:27: warning: (WORK_1:4) 0x4
--:28: warning: (WORK_2:4) 0x4
--:29: warning: (DONT_WORK_1:6) 0x4 0x4
+-:27: warning: (WORK_1:4) 4
+-:28: warning: (WORK_2:4) 4
+-:29: warning: (DONT_WORK_1:6) 4 4