mirror of
https://github.com/cc65/cc65.git
synced 2025-01-03 16:33:19 +00:00
fix tab, braces for 1-line if, Expr->Ival is signed
This commit is contained in:
parent
409235aee6
commit
9a502c69dc
@ -103,7 +103,7 @@ static WarnMapEntry WarnMap[] = {
|
||||
{ &WarnUnusedLabel, "unused-label" },
|
||||
{ &WarnUnusedParam, "unused-param" },
|
||||
{ &WarnUnusedVar, "unused-var" },
|
||||
{ &WarnConstOverflow, "const-overflow" },
|
||||
{ &WarnConstOverflow, "const-overflow" },
|
||||
};
|
||||
|
||||
Collection DiagnosticStrBufs;
|
||||
|
@ -584,17 +584,20 @@ static void NumericConst (void)
|
||||
SB_Clear (&Src);
|
||||
break;
|
||||
}
|
||||
if ((((unsigned long)(IVal * Base)) / Base) != IVal)
|
||||
if ((((unsigned long)(IVal * Base)) / Base) != IVal) {
|
||||
Overflow = 1;
|
||||
}
|
||||
IVal = IVal * Base;
|
||||
if (((unsigned long)(IVal + DigitVal)) < IVal)
|
||||
if (((unsigned long)(IVal + DigitVal)) < IVal) {
|
||||
Overflow = 1;
|
||||
}
|
||||
IVal += DigitVal;
|
||||
SB_Skip (&Src);
|
||||
}
|
||||
if (Overflow)
|
||||
if (Overflow) {
|
||||
Error ("Numerical constant \"%s\" too large for internal 32-bit representation",
|
||||
SB_GetConstBuf (&Src));
|
||||
}
|
||||
|
||||
/* Distinguish between integer and floating point constants */
|
||||
if (!IsFloat) {
|
||||
|
@ -128,7 +128,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType)
|
||||
** internally already represented by a long.
|
||||
*/
|
||||
if (NewBits <= OldBits) {
|
||||
unsigned long OldVal = Expr->IVal;
|
||||
long OldVal = Expr->IVal;
|
||||
|
||||
/* Cut the value to the new size */
|
||||
Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits));
|
||||
|
Loading…
Reference in New Issue
Block a user