mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 11:32:07 +00:00
Resolve some TODO comments
- `out_PushSection` should not set `currentSection` to NULL because PUSHS, PUSHC, and PUSHO consistently keep the current section, charmap, and options, even though the stack has been pushed. - `Callback__FILE__` does not need to assert that `fileName` is not empty because `__FILE__`'s value is quoted, and can safely be empty. - `YY_FATAL_ERROR` and `YYLMAX` are not needed since the lexer is not generated with flex.
This commit is contained in:
@@ -48,6 +48,7 @@ static struct Assertion *assertions;
|
||||
do { \
|
||||
FILE *tmpFile = file; \
|
||||
type tmpVal = func(tmpFile); \
|
||||
/* TODO: maybe mark the condition as `unlikely`; how to do that portably? */ \
|
||||
if (tmpVal == (errval)) { \
|
||||
errx(1, __VA_ARGS__, feof(tmpFile) \
|
||||
? "Unexpected end of file" \
|
||||
@@ -86,7 +87,6 @@ static int64_t readlong(FILE *file)
|
||||
/**
|
||||
* Helper macro for reading longs from a file, and errors out if it fails to.
|
||||
* Not as a function to avoid overhead in the general case.
|
||||
* TODO: maybe mark the condition as `unlikely`; how to do that portably?
|
||||
* @param var The variable to stash the number into
|
||||
* @param file The file to read from. Its position will be advanced
|
||||
* @param ... A format string and related arguments; note that an extra string
|
||||
@@ -101,7 +101,6 @@ static int64_t readlong(FILE *file)
|
||||
* Helper macro for reading bytes from a file, and errors out if it fails to.
|
||||
* Differs from `tryGetc` in that the backing function is fgetc(1).
|
||||
* Not as a function to avoid overhead in the general case.
|
||||
* TODO: maybe mark the condition as `unlikely`; how to do that portably?
|
||||
* @param var The variable to stash the number into
|
||||
* @param file The file to read from. Its position will be advanced
|
||||
* @param ... A format string and related arguments; note that an extra string
|
||||
@@ -114,7 +113,6 @@ static int64_t readlong(FILE *file)
|
||||
* Helper macro for reading bytes from a file, and errors out if it fails to.
|
||||
* Differs from `tryGetc` in that the backing function is fgetc(1).
|
||||
* Not as a function to avoid overhead in the general case.
|
||||
* TODO: maybe mark the condition as `unlikely`; how to do that portably?
|
||||
* @param var The variable to stash the number into
|
||||
* @param file The file to read from. Its position will be advanced
|
||||
* @param ... A format string and related arguments; note that an extra string
|
||||
@@ -163,7 +161,6 @@ static char *readstr(FILE *file)
|
||||
/**
|
||||
* Helper macro for reading bytes from a file, and errors out if it fails to.
|
||||
* Not as a function to avoid overhead in the general case.
|
||||
* TODO: maybe mark the condition as `unlikely`; how to do that portably?
|
||||
* @param var The variable to stash the string into
|
||||
* @param file The file to read from. Its position will be advanced
|
||||
* @param ... A format string and related arguments; note that an extra string
|
||||
|
||||
Reference in New Issue
Block a user