mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-26 21:12:07 +00:00
Implement a single nbErrors counter inside generic diagnostic code
This commit is contained in:
@@ -25,7 +25,7 @@ struct Options {
|
||||
bool generatePhonyDeps = false; // -MP
|
||||
std::string objectFileName; // -o
|
||||
uint8_t padByte = 0; // -p
|
||||
unsigned int maxErrors = 0; // -X
|
||||
uint64_t maxErrors = 0; // -X
|
||||
|
||||
~Options() {
|
||||
if (dependFile) {
|
||||
|
||||
@@ -80,7 +80,6 @@ void error(char const *fmt, ...);
|
||||
// once.
|
||||
void error(std::function<void()> callback);
|
||||
|
||||
void forceError();
|
||||
void requireZeroErrors();
|
||||
|
||||
#endif // RGBDS_ASM_WARNING_HPP
|
||||
|
||||
@@ -59,6 +59,13 @@ struct Diagnostics {
|
||||
std::vector<WarningFlag<L>> warningFlags;
|
||||
std::vector<ParamWarning<W>> paramWarnings;
|
||||
DiagnosticsState<W> state;
|
||||
uint64_t nbErrors;
|
||||
|
||||
void incrementErrors() {
|
||||
if (nbErrors != UINT64_MAX) {
|
||||
++nbErrors;
|
||||
}
|
||||
}
|
||||
|
||||
WarningBehavior getWarningBehavior(W id) const;
|
||||
std::string processWarningFlag(char const *flag);
|
||||
|
||||
@@ -36,8 +36,6 @@ void error(char const *fmt, ...);
|
||||
[[gnu::format(printf, 1, 2)]]
|
||||
void fatal(char const *fmt, ...);
|
||||
|
||||
void resetErrors();
|
||||
bool anyErrors();
|
||||
uint32_t checkErrors(char const *filename);
|
||||
|
||||
#endif // RGBDS_FIX_WARNING_HPP
|
||||
|
||||
Reference in New Issue
Block a user