[3/6] gdb: callback: inline PTR define

Message ID 20210424184144.23736-3-vapier@gentoo.org
State New
Headers show
Series
  • [1/6] gdb: callback: always include necessary headers
Related show

Commit Message

Mike Frysinger via Gdb-patches April 24, 2021, 6:41 p.m.
We require C11 now, so no need for these pre-ANSI C hacks.
---
 include/gdb/callback.h   | 6 +++---
 sim/common/callback.c    | 2 +-
 sim/common/sim-syscall.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.30.2

Patch

diff --git a/include/gdb/callback.h b/include/gdb/callback.h
index b981d94505d6..11a941259f64 100644
--- a/include/gdb/callback.h
+++ b/include/gdb/callback.h
@@ -249,8 +249,8 @@  typedef struct cb_syscall {
   int errcode;
 
   /* Working space to be used by memory read/write callbacks.  */
-  PTR p1;
-  PTR p2;
+  void *p1;
+  void *p2;
   long x1,x2;
 
   /* Callbacks for reading/writing memory (e.g. for read/write syscalls).
@@ -320,7 +320,7 @@  const char *cb_target_str_signal (host_callback *, int);
 /* Translate host stat struct to target.
    If stat struct ptr is NULL, just compute target stat struct size.
    Result is size of target stat struct or 0 if error.  */
-int cb_host_to_target_stat (host_callback *, const struct stat *, PTR);
+int cb_host_to_target_stat (host_callback *, const struct stat *, void *);
 
 /* Translate a value to target endian.  */
 void cb_store_target_endian (host_callback *, char *, int, long);
diff --git a/sim/common/callback.c b/sim/common/callback.c
index 2fec2704f3e0..6b7951d2a5ec 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -915,7 +915,7 @@  cb_store_target_endian (host_callback *cb, char *p, int size, long val)
    or zero if an error occurred during the translation.  */
 
 int
-cb_host_to_target_stat (host_callback *cb, const struct stat *hs, PTR ts)
+cb_host_to_target_stat (host_callback *cb, const struct stat *hs, void *ts)
 {
   const char *m = cb->stat_map;
   char *p;
diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c
index e91453d5ba1f..9dbc71ac9fb0 100644
--- a/sim/common/sim-syscall.c
+++ b/sim/common/sim-syscall.c
@@ -71,8 +71,8 @@  sim_syscall_multi (SIM_CPU *cpu, int func, long arg1, long arg2, long arg3,
   sc.arg3 = arg3;
   sc.arg4 = arg4;
 
-  sc.p1 = (PTR) sd;
-  sc.p2 = (PTR) cpu;
+  sc.p1 = sd;
+  sc.p2 = cpu;
   sc.read_mem = sim_syscall_read_mem;
   sc.write_mem = sim_syscall_write_mem;