mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Report only one error when invalid shift has argument
Not to mention that incrementing a variable in a loop is kinda dumb.
This commit is contained in:
@@ -128,12 +128,15 @@ uint32_t macro_UseNewUniqueID(void)
|
||||
return maxUniqueID;
|
||||
}
|
||||
|
||||
void macro_ShiftCurrentArgs(void)
|
||||
void macro_ShiftCurrentArgs(int32_t count)
|
||||
{
|
||||
if (!macroArgs)
|
||||
error("Cannot shift macro arguments outside of a macro\n");
|
||||
else if (macroArgs->shift != macroArgs->nbArgs)
|
||||
macroArgs->shift++;
|
||||
else if (macroArgs->shift < macroArgs->nbArgs) {
|
||||
macroArgs->shift += count;
|
||||
if (macroArgs->shift > macroArgs->nbArgs)
|
||||
macroArgs->shift = macroArgs->nbArgs;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t macro_NbArgs(void)
|
||||
|
||||
Reference in New Issue
Block a user