mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Allow fixed-point constants to have unsigned range (#1084)
For example with Q.4, $F0 is 15.0, which no longer warns
This commit is contained in:
@@ -1179,7 +1179,7 @@ static uint32_t readFractionalPart(uint32_t integer)
|
||||
precision = fixPrecision;
|
||||
}
|
||||
|
||||
if (integer >= ((uint32_t)1 << (precision - 1)))
|
||||
if (integer >= ((uint64_t)1 << precision))
|
||||
warning(WARNING_LARGE_CONSTANT, "Magnitude of fixed-point constant is too large\n");
|
||||
|
||||
// Cast to unsigned avoids undefined overflow behavior
|
||||
|
||||
Reference in New Issue
Block a user