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:
@@ -53,11 +53,12 @@ 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;
|
||||
nasm_verror = ve;
|
||||
return old_verror;
|
||||
vefunc old_verror = nasm_verror;
|
||||
nasm_verror = ve;
|
||||
return old_verror;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -65,46 +66,46 @@ static inline vefunc nasm_set_verror(vefunc ve)
|
||||
* argument to an efunc.
|
||||
*/
|
||||
|
||||
#define ERR_DEBUG 0x00000000 /* put out debugging message */
|
||||
#define ERR_WARNING 0x00000001 /* warn only: no further action */
|
||||
#define ERR_NONFATAL 0x00000002 /* terminate assembly after phase */
|
||||
#define ERR_FATAL 0x00000006 /* instantly fatal: exit with error */
|
||||
#define ERR_PANIC 0x00000007 /* internal error: panic instantly
|
||||
* and dump core for reference */
|
||||
#define ERR_MASK 0x00000007 /* mask off the above codes */
|
||||
#define ERR_NOFILE 0x00000010 /* don't give source file name/line */
|
||||
#define ERR_TOPFILE 0x00000020 /* give the top input file name only */
|
||||
#define ERR_USAGE 0x00000040 /* print a usage message */
|
||||
#define ERR_PASS1 0x00000080 /* only print this error on pass one */
|
||||
#define ERR_PASS2 0x00000100 /* only print this error on pass one */
|
||||
#define ERR_DEBUG 0x00000000 /* put out debugging message */
|
||||
#define ERR_WARNING 0x00000001 /* warn only: no further action */
|
||||
#define ERR_NONFATAL 0x00000002 /* terminate assembly after phase */
|
||||
#define ERR_FATAL 0x00000006 /* instantly fatal: exit with error */
|
||||
#define ERR_PANIC 0x00000007 /* internal error: panic instantly
|
||||
* and dump core for reference */
|
||||
#define ERR_MASK 0x00000007 /* mask off the above codes */
|
||||
#define ERR_NOFILE 0x00000010 /* don't give source file name/line */
|
||||
#define ERR_TOPFILE 0x00000020 /* give the top input file name only */
|
||||
#define ERR_USAGE 0x00000040 /* print a usage message */
|
||||
#define ERR_PASS1 0x00000080 /* only print this error on pass one */
|
||||
#define ERR_PASS2 0x00000100 /* only print this error on pass one */
|
||||
|
||||
#define ERR_NO_SEVERITY 0x00000200 /* suppress printing severity */
|
||||
#define ERR_PP_PRECOND 0x00000400 /* for preprocessor use */
|
||||
#define ERR_PP_LISTMACRO 0x00000800 /* from preproc->error_list_macros() */
|
||||
#define ERR_NO_SEVERITY 0x00000200 /* suppress printing severity */
|
||||
#define ERR_PP_PRECOND 0x00000400 /* for preprocessor use */
|
||||
#define ERR_PP_LISTMACRO 0x00000800 /* from preproc->error_list_macros() */
|
||||
|
||||
/*
|
||||
* These codes define specific types of suppressible warning.
|
||||
*/
|
||||
|
||||
#define ERR_WARN_MASK 0xFFFFF000 /* the mask for this feature */
|
||||
#define ERR_WARN_SHR 12 /* how far to shift right */
|
||||
#define ERR_WARN_MASK 0xFFFFF000 /* the mask for this feature */
|
||||
#define ERR_WARN_SHR 12 /* how far to shift right */
|
||||
|
||||
#define WARN(x) ((x) << ERR_WARN_SHR)
|
||||
#define WARN_IDX(x) (((x) & ERR_WARN_MASK) >> ERR_WARN_SHR)
|
||||
#define WARN(x) ((x) << ERR_WARN_SHR)
|
||||
#define WARN_IDX(x) (((x) & ERR_WARN_MASK) >> ERR_WARN_SHR)
|
||||
|
||||
#define ERR_WARN_OTHER WARN( 0) /* any noncategorized warning */
|
||||
#define ERR_WARN_MNP WARN( 1) /* macro-num-parameters warning */
|
||||
#define ERR_WARN_MSR WARN( 2) /* macro self-reference */
|
||||
#define ERR_WARN_MDP WARN( 3) /* macro default parameters check */
|
||||
#define ERR_WARN_OL WARN( 4) /* orphan label (no colon, and
|
||||
#define ERR_WARN_OTHER WARN( 0) /* any noncategorized warning */
|
||||
#define ERR_WARN_MNP WARN( 1) /* macro-num-parameters warning */
|
||||
#define ERR_WARN_MSR WARN( 2) /* macro self-reference */
|
||||
#define ERR_WARN_MDP WARN( 3) /* macro default parameters check */
|
||||
#define ERR_WARN_OL WARN( 4) /* orphan label (no colon, and
|
||||
* alone on line) */
|
||||
#define ERR_WARN_NOV WARN( 5) /* numeric overflow */
|
||||
#define ERR_WARN_GNUELF WARN( 6) /* using GNU ELF extensions */
|
||||
#define ERR_WARN_FL_OVERFLOW WARN( 7) /* FP overflow */
|
||||
#define ERR_WARN_FL_DENORM WARN( 8) /* FP denormal */
|
||||
#define ERR_WARN_FL_UNDERFLOW WARN( 9) /* FP underflow */
|
||||
#define ERR_WARN_FL_TOOLONG WARN(10) /* FP too many digits */
|
||||
#define ERR_WARN_USER WARN(11) /* %warning directives */
|
||||
#define ERR_WARN_NOV WARN( 5) /* numeric overflow */
|
||||
#define ERR_WARN_GNUELF WARN( 6) /* using GNU ELF extensions */
|
||||
#define ERR_WARN_FL_OVERFLOW WARN( 7) /* FP overflow */
|
||||
#define ERR_WARN_FL_DENORM WARN( 8) /* FP denormal */
|
||||
#define ERR_WARN_FL_UNDERFLOW WARN( 9) /* FP underflow */
|
||||
#define ERR_WARN_FL_TOOLONG WARN(10) /* FP too many digits */
|
||||
#define ERR_WARN_USER WARN(11) /* %warning directives */
|
||||
#define ERR_WARN_LOCK WARN(12) /* bad LOCK prefixes */
|
||||
#define ERR_WARN_HLE WARN(13) /* bad HLE prefixes */
|
||||
#define ERR_WARN_BND WARN(14) /* bad BND prefixes */
|
||||
@@ -118,23 +119,23 @@ static inline vefunc nasm_set_verror(vefunc ve)
|
||||
#define ERR_WARN_PHASE WARN(22) /* phase error in pass 1 */
|
||||
|
||||
/* The "all" warning acts as a global switch, it must come last */
|
||||
#define ERR_WARN_ALL 23 /* Do not use WARN() here */
|
||||
#define ERR_WARN_ALL 23 /* Do not use WARN() here */
|
||||
|
||||
struct warning {
|
||||
const char *name;
|
||||
const char *help;
|
||||
bool enabled;
|
||||
const char *name;
|
||||
const char *help;
|
||||
bool enabled;
|
||||
};
|
||||
extern const struct warning warnings[ERR_WARN_ALL+1];
|
||||
|
||||
/* This is a bitmask */
|
||||
#define WARN_ST_ENABLED 1 /* Warning is currently enabled */
|
||||
#define WARN_ST_ERROR 2 /* Treat this warning as an error */
|
||||
#define WARN_ST_ENABLED 1 /* Warning is currently enabled */
|
||||
#define WARN_ST_ERROR 2 /* Treat this warning as an error */
|
||||
|
||||
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 */
|
||||
|
Reference in New Issue
Block a user