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:
18
asm/error.c
18
asm/error.c
@@ -75,10 +75,12 @@ const struct warning warnings[ERR_WARN_ALL+1] = {
|
|||||||
{ "all", "all possible warnings", false }
|
{ "all", "all possible warnings", false }
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t warning_state[ERR_WARN_ALL];/* Current state */
|
/* Current state and command-line state, for reset */
|
||||||
uint8_t warning_state_init[ERR_WARN_ALL]; /* 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, ...)
|
void nasm_error(int severity, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@@ -95,7 +97,7 @@ fatal_func nasm_fatal(const char *fmt, ...)
|
|||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
nasm_verror(ERR_FATAL, fmt, ap);
|
nasm_verror(ERR_FATAL, fmt, ap);
|
||||||
abort(); /* We should never get here */
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_func nasm_fatal_fl(int flags, const char *fmt, ...)
|
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);
|
va_start(ap, fmt);
|
||||||
nasm_verror(flags | ERR_FATAL, fmt, ap);
|
nasm_verror(flags | ERR_FATAL, fmt, ap);
|
||||||
abort(); /* We should never get here */
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_func nasm_panic(const char *fmt, ...)
|
fatal_func nasm_panic(const char *fmt, ...)
|
||||||
@@ -113,7 +115,7 @@ fatal_func nasm_panic(const char *fmt, ...)
|
|||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
nasm_verror(ERR_PANIC, fmt, ap);
|
nasm_verror(ERR_PANIC, fmt, ap);
|
||||||
abort(); /* We should never get here */
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_func nasm_panic_fl(int flags, const char *fmt, ...)
|
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);
|
va_start(ap, fmt);
|
||||||
nasm_verror(flags | ERR_PANIC, fmt, ap);
|
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)
|
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 { WID_OFF, WID_ON, WID_RESET };
|
||||||
enum warn_action action;
|
enum warn_action action;
|
||||||
|
bool ok = false;
|
||||||
uint8_t mask;
|
uint8_t mask;
|
||||||
int i;
|
int i;
|
||||||
bool ok = false;
|
|
||||||
|
|
||||||
value = nasm_skip_spaces(value);
|
value = nasm_skip_spaces(value);
|
||||||
switch (*value) {
|
switch (*value) {
|
||||||
|
@@ -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);
|
typedef void (*vefunc) (int severity, const char *fmt, va_list ap);
|
||||||
extern vefunc nasm_verror;
|
extern vefunc nasm_verror;
|
||||||
|
|
||||||
static inline vefunc nasm_set_verror(vefunc ve)
|
static inline vefunc nasm_set_verror(vefunc ve)
|
||||||
{
|
{
|
||||||
vefunc old_verror = nasm_verror;
|
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];
|
extern uint8_t warning_state_init[ERR_WARN_ALL];
|
||||||
|
|
||||||
/* Process a warning option or directive */
|
/* Process a warning option or directive */
|
||||||
bool set_warning_status(const char *);
|
bool set_warning_status(const char *value);
|
||||||
|
|
||||||
#endif /* NASM_ERROR_H */
|
#endif /* NASM_ERROR_H */
|
||||||
|
Reference in New Issue
Block a user