From: Mike Frysinger Date: Sun, 6 Jun 2021 22:13:41 +0000 (-0400) Subject: sim: cleanup obsolete NULL fallback X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=943f9baa37aa2704820439d4f72a7624c7eb4968;p=binutils-gdb.git sim: cleanup obsolete NULL fallback We require C11 which defines NULL, so drop the inconsistent set of fallback defines in the codebase. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index b5b6db2f9a2..2cc89c825ae 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2021-06-09 Mike Frysinger + + * sim-basics.h (NULL): Delete. + 2021-06-09 Mike Frysinger * nrun.c (main): Set default_callback.target_endian to diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h index 25c1193dca4..ac63aef456a 100644 --- a/sim/common/sim-basics.h +++ b/sim/common/sim-basics.h @@ -36,11 +36,6 @@ #include -#ifndef NULL -#define NULL 0 -#endif - - #ifndef min #define min(a, b) ((a) < (b) ? (a) : (b)) #endif diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 7ef9e1deb25..22efdf3260f 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,10 @@ +2021-06-09 Mike Frysinger + + * gen-itable.c (NULL): Delete. + * gen-model.c (NULL): Likewise. + * ld-cache.c (NULL): Likewise. + * ld-decode.c (NULL): Likewise. + 2021-06-05 Mike Frysinger * local.mk (all-recursive): Delete rule. diff --git a/sim/igen/gen-itable.c b/sim/igen/gen-itable.c index 3b50ab60f0a..eedef58fd9a 100644 --- a/sim/igen/gen-itable.c +++ b/sim/igen/gen-itable.c @@ -34,11 +34,6 @@ #include "gen-itable.h" -#ifndef NULL -#define NULL 0 -#endif - - typedef struct _itable_info { diff --git a/sim/igen/gen-model.c b/sim/igen/gen-model.c index f162446866a..054d7b96c6a 100644 --- a/sim/igen/gen-model.c +++ b/sim/igen/gen-model.c @@ -31,10 +31,6 @@ #include "gen-model.h" -#ifndef NULL -#define NULL 0 -#endif - void gen_model_h (lf *file, insn_table *table) diff --git a/sim/igen/ld-cache.c b/sim/igen/ld-cache.c index 24b622222e0..defe31d7d68 100644 --- a/sim/igen/ld-cache.c +++ b/sim/igen/ld-cache.c @@ -30,10 +30,6 @@ #include "ld-insn.h" #include "ld-cache.h" -#ifndef NULL -#define NULL 0 -#endif - enum { diff --git a/sim/igen/ld-decode.c b/sim/igen/ld-decode.c index 75f24279eb2..6736e6b6faf 100644 --- a/sim/igen/ld-decode.c +++ b/sim/igen/ld-decode.c @@ -31,10 +31,6 @@ #include "ld-decode.h" -#ifndef NULL -#define NULL 0 -#endif - static const name_map decode_type_map[] = { {"normal", normal_decode_rule}, diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index fcd74c64e4c..9289b8ed2a7 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,11 @@ +2021-06-09 Mike Frysinger + + * basics.h (NULL): Delete. + * gen-itable.c (NULL): Likewise. + * gen-model.c (NULL): Likewise. + * ld-cache.c (NULL): Likewise. + * ld-decode.c (NULL): Likewise. + 2021-05-29 Mike Frysinger * configure.ac (WERROR_CFLAGS): Add -Wno-format for mingw32 hosts. diff --git a/sim/ppc/basics.h b/sim/ppc/basics.h index 057cf1ab0e4..3eb7c61ba91 100644 --- a/sim/ppc/basics.h +++ b/sim/ppc/basics.h @@ -103,10 +103,6 @@ typedef enum { #define NORETURN #endif -#ifndef NULL -#define NULL 0 -#endif - #if !defined (__attribute__) #if (!defined(__GNUC__) \ || (__GNUC__ < 2) \ diff --git a/sim/ppc/gen-itable.c b/sim/ppc/gen-itable.c index 7f3139ed971..a0d1560027c 100644 --- a/sim/ppc/gen-itable.c +++ b/sim/ppc/gen-itable.c @@ -32,11 +32,6 @@ #include "igen.h" #include "gen-itable.h" -#ifndef NULL -#define NULL 0 -#endif - - static void itable_h_insn(insn_table *entry, diff --git a/sim/ppc/gen-model.c b/sim/ppc/gen-model.c index a591d316e2e..1322391b25a 100644 --- a/sim/ppc/gen-model.c +++ b/sim/ppc/gen-model.c @@ -30,10 +30,6 @@ #include "gen-model.h" -#ifndef NULL -#define NULL 0 -#endif - static void model_c_or_h_data(insn_table *table, diff --git a/sim/ppc/ld-cache.c b/sim/ppc/ld-cache.c index 29a70350508..611ac7a0875 100644 --- a/sim/ppc/ld-cache.c +++ b/sim/ppc/ld-cache.c @@ -23,10 +23,6 @@ #include "table.h" #include "ld-cache.h" -#ifndef NULL -#define NULL 0 -#endif - enum { ca_type, diff --git a/sim/ppc/ld-decode.c b/sim/ppc/ld-decode.c index 3b2e1a05c28..cee006fe6f1 100644 --- a/sim/ppc/ld-decode.c +++ b/sim/ppc/ld-decode.c @@ -24,9 +24,6 @@ #include "table.h" #include "ld-decode.h" -#ifndef NULL -#define NULL 0 -#endif enum { op_options,