fix tab, braces for 1-line if, Expr->Ival is signed

This commit is contained in:
bbbradsmith
2023-05-03 16:46:59 -04:00
parent 409235aee6
commit 9a502c69dc
3 changed files with 8 additions and 5 deletions

View File

@@ -584,17 +584,20 @@ static void NumericConst (void)
SB_Clear (&Src); SB_Clear (&Src);
break; break;
} }
if ((((unsigned long)(IVal * Base)) / Base) != IVal) if ((((unsigned long)(IVal * Base)) / Base) != IVal) {
Overflow = 1; Overflow = 1;
}
IVal = IVal * Base; IVal = IVal * Base;
if (((unsigned long)(IVal + DigitVal)) < IVal) if (((unsigned long)(IVal + DigitVal)) < IVal) {
Overflow = 1; Overflow = 1;
}
IVal += DigitVal; IVal += DigitVal;
SB_Skip (&Src); SB_Skip (&Src);
} }
if (Overflow) if (Overflow) {
Error ("Numerical constant \"%s\" too large for internal 32-bit representation", Error ("Numerical constant \"%s\" too large for internal 32-bit representation",
SB_GetConstBuf (&Src)); SB_GetConstBuf (&Src));
}
/* Distinguish between integer and floating point constants */ /* Distinguish between integer and floating point constants */
if (!IsFloat) { if (!IsFloat) {

View File

@@ -128,7 +128,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType)
** internally already represented by a long. ** internally already represented by a long.
*/ */
if (NewBits <= OldBits) { if (NewBits <= OldBits) {
unsigned long OldVal = Expr->IVal; long OldVal = Expr->IVal;
/* Cut the value to the new size */ /* Cut the value to the new size */
Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits)); Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits));