static int num_check(Val *val) { unsigned char ascii[64], *result; unsigned int len; int i; int ret = 0; strcpy((char *)ascii, val->ascii); strcpy(result_msg, "parser failure"); if(BitVector_from_Oct(testval, ascii) != ErrCode_Ok) return 1; result = BitVector_Block_Read(testval, &len); for (i=0; i<10; i++) if (result[i] != val->result[i]) ret = 1; if (ret) { strcpy(result_msg, val->ascii); for (i=0; i<10; i++) sprintf((char *)ascii+3*i, "%02x ", result[i]); strcat(result_msg, ": "); strcat(result_msg, (char *)ascii); } free(result); return ret; }
yasm_intnum * yasm_intnum_create_oct(char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); switch (BitVector_from_Oct(conv_bv, (unsigned char *)str)) { case ErrCode_Pars: yasm_error_set(YASM_ERROR_VALUE, N_("invalid octal literal")); break; case ErrCode_Ovfl: yasm_error_set(YASM_ERROR_OVERFLOW, N_("Numeric constant too large for internal format")); break; default: break; } intnum_frombv(intn, conv_bv); return intn; }