From: Alan Modra Date: Tue, 10 May 2022 13:27:13 +0000 (+0930) Subject: sim: remove use of PTR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=845cbaa9ffbfd6a1f7976a6c7f3e4461e4d41993;p=binutils-gdb.git sim: remove use of PTR 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 *). --- diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 74d0a154a0e..58bec8b9b30 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -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; diff --git a/sim/common/callback.c b/sim/common/callback.c index 070f451f29e..63e0ab16fee 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -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; diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 12f6126d43f..3df30c55833 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -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; diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index 3589f5bfdce..5b1240f041f 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -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); } diff --git a/sim/cris/traps.c b/sim/cris/traps.c index e92fa1aae25..8750c4d4e3c 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -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; diff --git a/sim/frv/traps.c b/sim/frv/traps.c index 11f4a600d15..0c9eacd0bfd 100644 --- a/sim/frv/traps.c +++ b/sim/frv/traps.c @@ -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); diff --git a/sim/m32c/trace.c b/sim/m32c/trace.c index f5171c298c5..1888e69122b 100644 --- a/sim/m32c/trace.c +++ b/sim/m32c/trace.c @@ -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; diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c index a696b584379..267d54881da 100644 --- a/sim/m32r/traps.c +++ b/sim/m32r/traps.c @@ -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; diff --git a/sim/mips/interp.c b/sim/mips/interp.c index c5d0901428b..e46e817eed9 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -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; diff --git a/sim/ppc/emul_chirp.c b/sim/ppc/emul_chirp.c index a72a34e8528..7a585388f63 100644 --- a/sim/ppc/emul_chirp.c +++ b/sim/ppc/emul_chirp.c @@ -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) { diff --git a/sim/ppc/hw_htab.c b/sim/ppc/hw_htab.c index ce098341c82..b4537fc5256 100644 --- a/sim/ppc/hw_htab.c +++ b/sim/ppc/hw_htab.c @@ -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 diff --git a/sim/ppc/hw_init.c b/sim/ppc/hw_init.c index 66f205851d5..804daa9a47a 100644 --- a/sim/ppc/hw_init.c +++ b/sim/ppc/hw_init.c @@ -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); } diff --git a/sim/rl78/trace.c b/sim/rl78/trace.c index a485c4c004d..669c2b54615 100644 --- a/sim/rl78/trace.c +++ b/sim/rl78/trace.c @@ -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; diff --git a/sim/rx/trace.c b/sim/rx/trace.c index df83dc14a1b..8d9293c4a63 100644 --- a/sim/rx/trace.c +++ b/sim/rx/trace.c @@ -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;