}
if (v > 0 && (v >= UINT8_MAX || n < old))
overflow = true;
- else if (v < 0 && (v <= -UINT8_MAX || n > old))
+ else if (v < 0 && (v <= -(int64_t) UINT8_MAX || n > old))
underflow = true;
break;
}
}
if (v > 0 && (v >= UINT16_MAX || n < old))
overflow = true;
- else if (v < 0 && (v <= -UINT16_MAX || n > old))
+ else if (v < 0 && (v <= -(int64_t) UINT16_MAX || n > old))
underflow = true;
break;
}
}
if (v > 0 && (v >= UINT32_MAX || n < old))
overflow = true;
- else if (v < 0 && (v <= -UINT32_MAX || n > old))
+ else if (v < 0 && (v <= -(int64_t) UINT32_MAX || n > old))
underflow = true;
break;
}