DEC_NEG_OK,
DEC_POS_OK,
FLOAT_POS_OK,
- FLOAT_NEG_OK,
+ FLOAT_NEG_OK
};
/* Keep it sync with enum in .h */
};
static inline int
-add_to_res(unsigned int c, unsigned int *res, unsigned int base)
+add_to_res(unsigned int c, uint32_t *res, unsigned int base)
{
/* overflow */
if ( (UINT32_MAX - c) / base < *res ) {
case DEC_NEG_OK:
if ( nd.type == INT8 && res1 <= INT8_MAX + 1 ) {
if (res)
- *(int8_t *)res = - (int8_t) res1;
+ *(int8_t *)res = (int8_t) (-res1);
return (buf-srcbuf);
}
else if ( nd.type == INT16 && res1 <= (uint16_t)INT16_MAX + 1 ) {
if (res)
- *(int16_t *)res = - (int16_t) res1;
+ *(int16_t *)res = (int16_t) (-res1);
return (buf-srcbuf);
}
else if ( nd.type == INT32 && res1 <= (uint32_t)INT32_MAX + 1 ) {
if (res)
- *(int32_t *)res = - (int32_t) res1;
+ *(int32_t *)res = (int32_t) (-res1);
return (buf-srcbuf);
}
#ifndef CMDLINE_NO_FLOAT
debug_printf("error\n");
return -1;
}
- return -1;
}