several code cleanups: avoid #if in macro parameters

avoid arithmetic with void pointers (undefined behaviour)
avoid some shadowed variables
This commit is contained in:
hexcoder-
2019-08-11 15:40:53 +02:00
parent f5d4912ca8
commit f63318a20f
6 changed files with 107 additions and 105 deletions

View File

@ -199,7 +199,7 @@
#define FATAL(x...) do { \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
cBRI x); \
SAYF(cLRD "\n Location : " cRST "%s(), %s:%u\n\n", \
SAYF(cLRD "\n Location : " cRST "%s(), %s:%d\n\n", \
__FUNCTION__, __FILE__, __LINE__); \
exit(1); \
} while (0)
@ -209,7 +209,7 @@
#define ABORT(x...) do { \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
cBRI x); \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n\n", \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%d\n\n", \
__FUNCTION__, __FILE__, __LINE__); \
abort(); \
} while (0)
@ -220,7 +220,7 @@
fflush(stdout); \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] SYSTEM ERROR : " \
cBRI x); \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n", \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%d\n", \
__FUNCTION__, __FILE__, __LINE__); \
SAYF(cLRD " OS message : " cRST "%s\n", strerror(errno)); \
exit(1); \