wordptr bv; /* bit vector (for integers >32 bits) */
} val;
enum { INTNUM_UL, INTNUM_BV } type;
- unsigned char origsize; /* original (parsed) size, in bits */
};
/* static bitvect used for conversions */
{
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
- intn->origsize = 0; /* no reliable way to figure this out */
-
switch (BitVector_from_Dec_static(from_dec_data, conv_bv,
(unsigned char *)str)) {
case ErrCode_Pars:
{
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
- intn->origsize = (unsigned char)strlen(str);
-
switch (BitVector_from_Bin(conv_bv, (unsigned char *)str)) {
case ErrCode_Pars:
yasm_error_set(YASM_ERROR_VALUE, N_("invalid binary literal"));
{
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
- intn->origsize = strlen(str)*3;
-
switch (BitVector_from_Oct(conv_bv, (unsigned char *)str)) {
case ErrCode_Pars:
yasm_error_set(YASM_ERROR_VALUE, N_("invalid octal literal"));
{
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
- intn->origsize = strlen(str)*4;
-
switch (BitVector_from_Hex(conv_bv, (unsigned char *)str)) {
case ErrCode_Pars:
yasm_error_set(YASM_ERROR_VALUE, N_("invalid hex literal"));
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
size_t len = strlen(str);
- intn->origsize = len*8;
-
- if(intn->origsize > BITVECT_NATIVE_SIZE)
+ if(len*8 > BITVECT_NATIVE_SIZE)
yasm_error_set(YASM_ERROR_OVERFLOW,
N_("Character constant too large for internal format"));
intn->val.ul = i;
intn->type = INTNUM_UL;
- intn->origsize = 0;
return intn;
}
intn = yasm_xmalloc(sizeof(yasm_intnum));
intn->val.bv = BitVector_Clone(conv_bv);
intn->type = INTNUM_BV;
- intn->origsize = 0;
return intn;
}
const unsigned char *ptr_orig = ptr;
unsigned long i = 0;
- intn->origsize = 0;
-
BitVector_Empty(conv_bv);
for (;;) {
BitVector_Chunk_Store(conv_bv, 7, i, *ptr);
yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum));
unsigned long i = 0;
- intn->origsize = 0;
-
if (srcsize*8 > BITVECT_NATIVE_SIZE)
yasm_error_set(YASM_ERROR_OVERFLOW,
N_("Numeric constant too large for internal format"));
break;
}
n->type = intn->type;
- n->origsize = intn->origsize;
return n;
}
switch (intn->type) {
case INTNUM_UL:
- fprintf(f, "0x%lx/%u", intn->val.ul, (unsigned int)intn->origsize);
+ fprintf(f, "0x%lx", intn->val.ul);
break;
case INTNUM_BV:
s = BitVector_to_Hex(intn->val.bv);
- fprintf(f, "0x%s/%u", (char *)s, (unsigned int)intn->origsize);
+ fprintf(f, "0x%s", (char *)s);
yasm_xfree(s);
break;
}