public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: cleanup obsolete NULL fallback
Date: Mon,  7 Jun 2021 01:30:05 -0400	[thread overview]
Message-ID: <20210607053005.9764-1-vapier@gentoo.org> (raw)

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(-)

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,
-- 
2.31.1


                 reply	other threads:[~2021-06-07  5:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210607053005.9764-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).