]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: remove use of PTR
authorAlan Modra <amodra@gmail.com>
Tue, 10 May 2022 13:27:13 +0000 (22:57 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 13 May 2022 05:02:54 +0000 (14:32 +0930)
PTR will soon disappear from ansidecl.h.  Remove uses in sim.  Where
a PTR cast is used in assignment or function args to a void* I've
simply removed the unnecessary (in C) cast rather than replacing with
(void *).

14 files changed:
sim/bfin/interp.c
sim/common/callback.c
sim/common/cgen-trace.c
sim/cris/sim-if.c
sim/cris/traps.c
sim/frv/traps.c
sim/m32c/trace.c
sim/m32r/traps.c
sim/mips/interp.c
sim/ppc/emul_chirp.c
sim/ppc/hw_htab.c
sim/ppc/hw_init.c
sim/rl78/trace.c
sim/rx/trace.c

index 74d0a154a0ea8c4c3984814474948efe54949813..58bec8b9b309f5496707046cf7b8f487663633dd 100644 (file)
@@ -132,8 +132,8 @@ bfin_syscall (SIM_CPU *cpu)
       sc.arg5 = args[4] = GET_LONG (DREG (0) + 16);
       sc.arg6 = args[5] = GET_LONG (DREG (0) + 20);
     }
-  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;
 
index 070f451f29e098027ca07dd4dca73ccf7e554d20..63e0ab16fee39811ea0d748c9f54a992bc2b8776 100644 (file)
@@ -812,7 +812,7 @@ cb_read_target_syscall_maps (host_callback *cb, const char *file)
   if (cb->signal_map)
     free (cb->signal_map);
   if (cb->stat_map)
-    free ((PTR) cb->stat_map);
+    free ((void *) cb->stat_map);
 
   cb->syscall_map = syscall_map;
   cb->errno_map = errno_map;
index 12f6126d43f06bf0c18cc8b6bd15e3bda2740722..3df30c5583326427afaf803d83fe778467d109cd 100644 (file)
@@ -433,7 +433,7 @@ sim_cgen_disassemble_insn (SIM_CPU *cpu, const CGEN_INSN *insn,
   disasm_info.buffer = insn_buf.bytes;
   disasm_info.buffer_length = length;
 
-  ex_info.dis_info = (PTR) &disasm_info;
+  ex_info.dis_info = &disasm_info;
   ex_info.valid = (1 << length) - 1;
   ex_info.insn_bytes = insn_buf.bytes;
 
index 3589f5bfdceb3f2c4619c7d2e91cbe2d718dc5f8..5b1240f041ff519b2d71719de51c0181a65df20f 100644 (file)
@@ -1022,7 +1022,7 @@ cris_disassemble_insn (SIM_CPU *cpu,
   disasm_info.endian = BFD_ENDIAN_LITTLE;
   disasm_info.read_memory_func = sim_disasm_read_memory;
   disasm_info.memory_error_func = sim_disasm_perror_memory;
-  disasm_info.application_data = (PTR) cpu;
+  disasm_info.application_data = cpu;
   pinsn = cris_get_disassembler (STATE_PROG_BFD (sd));
   (*pinsn) (pc, &disasm_info);
 }
index e92fa1aae2545517f99f5a5620c34b03b5c6b2e6..8750c4d4e3c65b4d777616cf6367c1faf558eddc 100644 (file)
@@ -1442,8 +1442,8 @@ cris_break_13_handler (SIM_CPU *current_cpu, USI callnum, USI arg1,
       sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, arg1);
     }
 
-  s.p1 = (PTR) sd;
-  s.p2 = (PTR) current_cpu;
+  s.p1 = sd;
+  s.p2 = current_cpu;
   s.read_mem = sim_syscall_read_mem;
   s.write_mem = sim_syscall_write_mem;
 
index 11f4a600d15b2dd19f1d1c23d3e6befc9471c0d4..0c9eacd0bfd24eb0700e4bd51a43ee4e0e701168 100644 (file)
@@ -138,8 +138,8 @@ frv_itrap (SIM_CPU *current_cpu, PCADDR pc, USI base, SI offset)
            sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, s.arg1);
          }
 
-       s.p1 = (PTR) sd;
-       s.p2 = (PTR) current_cpu;
+       s.p1 = sd;
+       s.p2 = current_cpu;
        s.read_mem = syscall_read_mem;
        s.write_mem = syscall_write_mem;
        cb_syscall (cb, &s);
index f5171c298c54705768213b75dd3a99424b56e580..1888e69122bd60190b9a2744c0a922cc2c2728db 100644 (file)
@@ -75,7 +75,7 @@ remove_useless_symbols (asymbol ** symbols, long count)
 }
 
 static int
-compare_symbols (const PTR ap, const PTR bp)
+compare_symbols (const void *ap, const void *bp)
 {
   const asymbol *a = *(const asymbol **) ap;
   const asymbol *b = *(const asymbol **) bp;
index a696b58437939b2531fa97cfdd85f0fc160de89e..267d54881da88aea5c6ca7965c4af02f97bd342f 100644 (file)
@@ -237,8 +237,8 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
        s.arg6 = arg6;
        s.arg7 = arg7;
 
-       s.p1 = (PTR) sd;
-       s.p2 = (PTR) current_cpu;
+       s.p1 = sd;
+       s.p2 = current_cpu;
        s.read_mem = sim_syscall_read_mem;
        s.write_mem = sim_syscall_write_mem;
 
index c5d0901428b945c5ea2783d53a62ec749992cba1..e46e817eed9457c9d006330a72aee2ba4ddad8e5 100644 (file)
@@ -1299,8 +1299,8 @@ sim_monitor (SIM_DESC sd,
           MIPS simulator's memory model is still 32-bit.  */
        s.arg1 = A0 & 0xFFFFFFFF;
        s.arg2 = A1 & 0xFFFFFFFF;
-       s.p1 = (PTR) sd;
-       s.p2 = (PTR) cpu;
+       s.p1 = sd;
+       s.p2 = cpu;
        s.read_mem = sim_syscall_read_mem;
        s.write_mem = sim_syscall_write_mem;
 
index a72a34e85287baafdcebd3fe796d92d5f886468e..7a585388f63aa17ea1aa5f096db8ad7f91e1f3e6 100644 (file)
@@ -1492,7 +1492,7 @@ typedef struct _chirp_note_head {
 static void
 map_over_chirp_note(bfd *image,
                    asection *sect,
-                   PTR obj)
+                   void *obj)
 {
   chirp_note *note = (chirp_note*)obj;
   if (strcmp(sect->name, ".note") == 0) {
index ce098341c82d77f802425b03dcce59fbdd06fc56..b4537fc5256ea2373becad61aafed316a677b0b4 100644 (file)
@@ -388,7 +388,7 @@ typedef struct _htab_binary_sizes {
 static void
 htab_sum_binary(bfd *abfd,
                sec_ptr sec,
-               PTR data)
+               void *data)
 {
   htab_binary_sizes *sizes = (htab_binary_sizes*)data;
   unsigned_word size = bfd_section_size (sec);
@@ -422,7 +422,7 @@ htab_sum_binary(bfd *abfd,
 static void
 htab_dma_binary(bfd *abfd,
                sec_ptr sec,
-               PTR data)
+               void *data)
 {
   htab_binary_sizes *sizes = (htab_binary_sizes*)data;
   void *section_init;
@@ -526,7 +526,7 @@ htab_map_binary(device *me,
   }
 
   /* determine the size of each of the files regions */
-  bfd_map_over_sections (image, htab_sum_binary, (PTR) &sizes);
+  bfd_map_over_sections (image, htab_sum_binary, &sizes);
 
   /* if needed, determine the real addresses of the sections */
   if (ra != -1) {
@@ -590,7 +590,7 @@ htab_map_binary(device *me,
                  htaborg, htabmask);
 
   /* dma the sections into physical memory */
-  bfd_map_over_sections (image, htab_dma_binary, (PTR) &sizes);
+  bfd_map_over_sections (image, htab_dma_binary, &sizes);
 }
 
 static void
index 66f205851d56118af0e8797fe00002e0453529ed..804daa9a47a6900f85402973e72c3c98afaad199 100644 (file)
@@ -316,7 +316,7 @@ static device_callbacks const hw_data_callbacks = {
 static void
 update_for_binary_section(bfd *abfd,
                          asection *the_section,
-                         PTR obj)
+                         void *obj)
 {
   unsigned_word section_vma;
   unsigned_word section_size;
@@ -431,7 +431,7 @@ hw_binary_init_data_callback(device *me)
   /* and the data sections */
   bfd_map_over_sections(image,
                        update_for_binary_section,
-                       (PTR)me);
+                       me);
 
   bfd_close(image);
 }
index a485c4c004d732985e74ebfae4602bdab503c700..669c2b5461537b9bae1c4835963ea2c368f6d487 100644 (file)
@@ -78,7 +78,7 @@ remove_useless_symbols (asymbol ** symbols, long count)
 }
 
 static int
-compare_symbols (const PTR ap, const PTR bp)
+compare_symbols (const void *ap, const void *bp)
 {
   const asymbol *a = *(const asymbol **) ap;
   const asymbol *b = *(const asymbol **) bp;
index df83dc14a1b4218d723e772eaf0e9fd80c11f81b..8d9293c4a6369b1cf23c92a553e168a46256becc 100644 (file)
@@ -83,7 +83,7 @@ remove_useless_symbols (asymbol ** symbols, long count)
 }
 
 static int
-compare_symbols (const PTR ap, const PTR bp)
+compare_symbols (const void *ap, const void *bp)
 {
   const asymbol *a = *(const asymbol **) ap;
   const asymbol *b = *(const asymbol **) bp;