mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +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",
|
dbgPrint("Reading gfx constant with digits [%c,%c,%c,%c]\n",
|
||||||
gfxDigits[0], gfxDigits[1], gfxDigits[2], gfxDigits[3]);
|
gfxDigits[0], gfxDigits[1], gfxDigits[2], gfxDigits[3]);
|
||||||
for (;;) {
|
for (;; shiftChar()) {
|
||||||
int c = peek();
|
int c = peek();
|
||||||
uint32_t pixel;
|
uint32_t pixel;
|
||||||
|
|
||||||
@@ -1284,14 +1284,13 @@ static uint32_t readGfxConstant(void)
|
|||||||
}
|
}
|
||||||
if (width < 9)
|
if (width < 9)
|
||||||
width++;
|
width++;
|
||||||
shiftChar();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width == 0)
|
if (width == 0)
|
||||||
error("Invalid graphics constant, no digits after '`'\n");
|
error("Invalid graphics constant, no digits after '`'\n");
|
||||||
else if (width == 9)
|
else if (width == 9)
|
||||||
warning(WARNING_LARGE_CONSTANT,
|
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;
|
return bp1 << 8 | bp0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ warning: overflow.asm(24): [-Wdiv]
|
|||||||
warning: overflow.asm(38): [-Wlarge-constant]
|
warning: overflow.asm(38): [-Wlarge-constant]
|
||||||
Integer constant is too large
|
Integer constant is too large
|
||||||
warning: overflow.asm(41): [-Wlarge-constant]
|
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