diff --git a/src/cc65/error.c b/src/cc65/error.c index 6ac3e594b..39b067825 100644 --- a/src/cc65/error.c +++ b/src/cc65/error.c @@ -103,7 +103,7 @@ static WarnMapEntry WarnMap[] = { { &WarnUnusedLabel, "unused-label" }, { &WarnUnusedParam, "unused-param" }, { &WarnUnusedVar, "unused-var" }, - { &WarnConstOverflow, "const-overflow" }, + { &WarnConstOverflow, "const-overflow" }, }; Collection DiagnosticStrBufs; diff --git a/src/cc65/scanner.c b/src/cc65/scanner.c index 055c02450..ec49d0e3c 100644 --- a/src/cc65/scanner.c +++ b/src/cc65/scanner.c @@ -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) { diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index 49dfcc597..e1d95ff63 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -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));