diff options
author | H. Peter Anvin <hpa@zytor.com> | 2018-06-15 18:20:17 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2018-06-15 18:20:17 -0700 |
commit | c51369067ce7cfac43d8bc8681a3c916d8d5e503 (patch) | |
tree | 185bbd5df654b0e0c61c84aa2da144f18406e5f3 /include/error.h | |
parent | d3b1832c049c533656fd1945440d637f01a0f1a4 (diff) | |
download | nasm-c51369067ce7cfac43d8bc8681a3c916d8d5e503.tar.gz |
errors: simplify nasm_fatal() and nasm_panic()
Nearly all instances of nasm_fatal() and nasm_panic() take a flags
argument of zero. Simplify the code by making nasm_fatal and
nasm_panic default to no flags, and add an alternate version if flags
really are desired. This also means that every call site doesn't have
to initialize a zero argument.
Furthermore, ERR_NOFILE is now often not necessary, as the error code
will no longer cause a null reference if there is no current
file. Therefore, we can remove many instances of ERR_NOFILE which only
deprives the user of information.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/error.h')
-rw-r--r-- | include/error.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/error.h b/include/error.h index 83b28da0..ae336de9 100644 --- a/include/error.h +++ b/include/error.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2017 The NASM Authors - All Rights Reserved + * Copyright 1996-2018 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * @@ -44,8 +44,10 @@ * An error reporting function should look like this. */ void printf_func(2, 3) nasm_error(int severity, const char *fmt, ...); -fatal_func printf_func(2, 3) nasm_fatal(int flags, const char *fmt, ...); -fatal_func printf_func(2, 3) nasm_panic(int flags, const char *fmt, ...); +fatal_func printf_func(1, 2) nasm_fatal(const char *fmt, ...); +fatal_func printf_func(1, 2) nasm_panic(const char *fmt, ...); +fatal_func printf_func(2, 3) nasm_fatal_fl(int flags, const char *fmt, ...); +fatal_func printf_func(2, 3) nasm_panic_fl(int flags, const char *fmt, ...); fatal_func nasm_panic_from_macro(const char *file, int line); #define panic() nasm_panic_from_macro(__FILE__, __LINE__); |