fix tab, braces for 1-line if, Expr->Ival is signed
This commit is contained in:
@@ -103,7 +103,7 @@ static WarnMapEntry WarnMap[] = {
|
|||||||
{ &WarnUnusedLabel, "unused-label" },
|
{ &WarnUnusedLabel, "unused-label" },
|
||||||
{ &WarnUnusedParam, "unused-param" },
|
{ &WarnUnusedParam, "unused-param" },
|
||||||
{ &WarnUnusedVar, "unused-var" },
|
{ &WarnUnusedVar, "unused-var" },
|
||||||
{ &WarnConstOverflow, "const-overflow" },
|
{ &WarnConstOverflow, "const-overflow" },
|
||||||
};
|
};
|
||||||
|
|
||||||
Collection DiagnosticStrBufs;
|
Collection DiagnosticStrBufs;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user