mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Refactor readGfxConstant for consistency, and edit warning message
This commit is contained in:
@@ -1263,7 +1263,7 @@ static uint32_t readGfxConstant(void)
|
||||
|
||||
dbgPrint("Reading gfx constant with digits [%c,%c,%c,%c]\n",
|
||||
gfxDigits[0], gfxDigits[1], gfxDigits[2], gfxDigits[3]);
|
||||
for (;;) {
|
||||
for (;; shiftChar()) {
|
||||
int c = peek();
|
||||
uint32_t pixel;
|
||||
|
||||
@@ -1284,14 +1284,13 @@ static uint32_t readGfxConstant(void)
|
||||
}
|
||||
if (width < 9)
|
||||
width++;
|
||||
shiftChar();
|
||||
}
|
||||
|
||||
if (width == 0)
|
||||
error("Invalid graphics constant, no digits after '`'\n");
|
||||
else if (width == 9)
|
||||
warning(WARNING_LARGE_CONSTANT,
|
||||
"Graphics constant is too long, only 8 first pixels considered\n");
|
||||
"Graphics constant is too long, only first 8 pixels considered\n");
|
||||
|
||||
return bp1 << 8 | bp0;
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@ warning: overflow.asm(24): [-Wdiv]
|
||||
warning: overflow.asm(38): [-Wlarge-constant]
|
||||
Integer constant is too large
|
||||
warning: overflow.asm(41): [-Wlarge-constant]
|
||||
Graphics constant is too long, only 8 first pixels considered
|
||||
Graphics constant is too long, only first 8 pixels considered
|
||||
|
||||
Reference in New Issue
Block a user