0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

error: Style liftup

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2018-11-24 18:58:11 +03:00
parent 85261a2b57
commit 3351072306
2 changed files with 166 additions and 163 deletions

View File

@@ -47,38 +47,40 @@
* the [warning] directive.
*/
const struct warning warnings[ERR_WARN_ALL+1] = {
{"other", "any warning not specifially mentioned below", true},
{"macro-params", "macro calls with wrong parameter count", true},
{"macro-selfref", "cyclic macro references", false},
{"macro-defaults", "macros with more default than optional parameters", true},
{"orphan-labels", "labels alone on lines without trailing `:'", true},
{"number-overflow", "numeric constant does not fit", true},
{"gnu-elf-extensions", "using 8- or 16-bit relocation in ELF32, a GNU extension", false},
{"float-overflow", "floating point overflow", true},
{"float-denorm", "floating point denormal", false},
{"float-underflow", "floating point underflow", false},
{"float-toolong", "too many digits in floating-point number", true},
{"user", "%warning directives", true},
{"lock", "lock prefix on unlockable instructions", true},
{"hle", "invalid hle prefixes", true},
{"bnd", "invalid bnd prefixes", true},
{"zext-reloc", "relocation zero-extended to match output format", true},
{"ptr", "non-NASM keyword used in other assemblers", true},
{"bad-pragma", "empty or malformed %pragma", false},
{"unknown-pragma", "unknown %pragma facility or directive", false},
{"not-my-pragma", "%pragma not applicable to this compilation", false},
{"unknown-warning", "unknown warning in -W/-w or warning directive", false},
{"negative-rep", "regative %rep count", true},
{"phase", "phase error during stabilization", false},
{ "other", "any warning not specifially mentioned below", true },
{ "macro-params", "macro calls with wrong parameter count", true },
{ "macro-selfref", "cyclic macro references", false },
{ "macro-defaults", "macros with more default than optional parameters", true },
{ "orphan-labels", "labels alone on lines without trailing `:'", true },
{ "number-overflow", "numeric constant does not fit", true },
{ "gnu-elf-extensions", "using 8- or 16-bit relocation in ELF32, a GNU extension", false },
{ "float-overflow", "floating point overflow", true },
{ "float-denorm", "floating point denormal", false },
{ "float-underflow", "floating point underflow", false },
{ "float-toolong", "too many digits in floating-point number", true },
{ "user", "%warning directives", true },
{ "lock", "lock prefix on unlockable instructions", true },
{ "hle", "invalid hle prefixes", true },
{ "bnd", "invalid bnd prefixes", true },
{ "zext-reloc", "relocation zero-extended to match output format", true },
{ "ptr", "non-NASM keyword used in other assemblers", true },
{ "bad-pragma", "empty or malformed %pragma", false },
{ "unknown-pragma", "unknown %pragma facility or directive", false },
{ "not-my-pragma", "%pragma not applicable to this compilation", false },
{ "unknown-warning", "unknown warning in -W/-w or warning directive", false },
{ "negative-rep", "regative %rep count", true },
{ "phase", "phase error during stabilization", false },
/* THIS ENTRY MUST COME LAST */
{"all", "all possible warnings", false}
{ "all", "all possible warnings", false }
};
uint8_t warning_state[ERR_WARN_ALL];/* Current state */
uint8_t warning_state_init[ERR_WARN_ALL]; /* Command-line state, for reset */
/* Current state and command-line state, for reset */
uint8_t warning_state[ERR_WARN_ALL];
uint8_t warning_state_init[ERR_WARN_ALL];
vefunc nasm_verror; /* Global error handling function */
/* Global error handling function */
vefunc nasm_verror;
void nasm_error(int severity, const char *fmt, ...)
{
@@ -95,7 +97,7 @@ fatal_func nasm_fatal(const char *fmt, ...)
va_start(ap, fmt);
nasm_verror(ERR_FATAL, fmt, ap);
abort(); /* We should never get here */
abort();
}
fatal_func nasm_fatal_fl(int flags, const char *fmt, ...)
@@ -104,7 +106,7 @@ fatal_func nasm_fatal_fl(int flags, const char *fmt, ...)
va_start(ap, fmt);
nasm_verror(flags | ERR_FATAL, fmt, ap);
abort(); /* We should never get here */
abort();
}
fatal_func nasm_panic(const char *fmt, ...)
@@ -113,7 +115,7 @@ fatal_func nasm_panic(const char *fmt, ...)
va_start(ap, fmt);
nasm_verror(ERR_PANIC, fmt, ap);
abort(); /* We should never get here */
abort();
}
fatal_func nasm_panic_fl(int flags, const char *fmt, ...)
@@ -122,7 +124,7 @@ fatal_func nasm_panic_fl(int flags, const char *fmt, ...)
va_start(ap, fmt);
nasm_verror(flags | ERR_PANIC, fmt, ap);
abort(); /* We should never get here */
abort();
}
fatal_func nasm_panic_from_macro(const char *file, int line)
@@ -143,9 +145,9 @@ bool set_warning_status(const char *value)
{
enum warn_action { WID_OFF, WID_ON, WID_RESET };
enum warn_action action;
bool ok = false;
uint8_t mask;
int i;
bool ok = false;
value = nasm_skip_spaces(value);
switch (*value) {

View File

@@ -53,6 +53,7 @@ fatal_func nasm_panic_from_macro(const char *file, int line);
typedef void (*vefunc) (int severity, const char *fmt, va_list ap);
extern vefunc nasm_verror;
static inline vefunc nasm_set_verror(vefunc ve)
{
vefunc old_verror = nasm_verror;
@@ -135,6 +136,6 @@ extern uint8_t warning_state[ERR_WARN_ALL];
extern uint8_t warning_state_init[ERR_WARN_ALL];
/* Process a warning option or directive */
bool set_warning_status(const char *);
bool set_warning_status(const char *value);
#endif /* NASM_ERROR_H */