sim: cleanup obsolete NULL fallback

Message ID 20210607053005.9764-1-vapier@gentoo.org
State New
Headers show
Series
  • sim: cleanup obsolete NULL fallback
Related show

Commit Message

Mike Frysinger via Gdb-patches June 7, 2021, 5:30 a.m.
We require C11 which defines NULL, so drop the inconsistent set of
fallback defines in the codebase.
---
 sim/common/sim-basics.h | 5 -----
 sim/igen/gen-itable.c   | 5 -----
 sim/igen/gen-model.c    | 4 ----
 sim/igen/ld-cache.c     | 4 ----
 sim/igen/ld-decode.c    | 4 ----
 sim/ppc/basics.h        | 4 ----
 sim/ppc/gen-itable.c    | 5 -----
 sim/ppc/gen-model.c     | 4 ----
 sim/ppc/ld-cache.c      | 4 ----
 sim/ppc/ld-decode.c     | 3 ---
 10 files changed, 42 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index 25c1193dca44..ac63aef456ac 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -36,11 +36,6 @@ 
 #include <setjmp.h>
 
 
-#ifndef NULL
-#define NULL 0
-#endif
-
-
 #ifndef min
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
diff --git a/sim/igen/gen-itable.c b/sim/igen/gen-itable.c
index 3b50ab60f0a2..eedef58fd9af 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 f162446866a4..054d7b96c6a1 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 24b622222e09..defe31d7d68d 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 75f24279eb2f..6736e6b6faf9 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/basics.h b/sim/ppc/basics.h
index 057cf1ab0e45..3eb7c61ba911 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 7f3139ed971f..a0d1560027c1 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 a591d316e2ea..1322391b25ae 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 29a70350508d..611ac7a08754 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 3b2e1a05c280..cee006fe6f10 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,