mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Avoid use of goto in nextLine
This commit is contained in:
@@ -34,9 +34,10 @@ static char const *delim = " \f\n\r\t\v"; // Whitespace according to the C and P
|
||||
|
||||
static int
|
||||
nextLine(std::vector<char> &lineBuf, uint32_t &lineNo, FileStackNode const &where, FILE *file) {
|
||||
retry:
|
||||
int firstChar;
|
||||
for (;;) {
|
||||
++lineNo;
|
||||
int firstChar = getc(file);
|
||||
firstChar = getc(file);
|
||||
lineBuf.clear();
|
||||
|
||||
switch (firstChar) {
|
||||
@@ -55,7 +56,9 @@ retry:
|
||||
}
|
||||
[[fallthrough]];
|
||||
case '\n':
|
||||
goto retry;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
Reference in New Issue
Block a user