summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-05-10 22:57:13 +0930
committerAlan Modra <amodra@gmail.com>2022-05-13 14:32:54 +0930
commit845cbaa9ffbfd6a1f7976a6c7f3e4461e4d41993 (patch)
treecd44d6acbd57ee37cd21d7585d052f9737e04371 /sim
parentd112ec9673d92b43dfef868460b7361d5c6bb06c (diff)
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 *).
Diffstat (limited to 'sim')
-rw-r--r--sim/bfin/interp.c4
-rw-r--r--sim/common/callback.c2
-rw-r--r--sim/common/cgen-trace.c2
-rw-r--r--sim/cris/sim-if.c2
-rw-r--r--sim/cris/traps.c4
-rw-r--r--sim/frv/traps.c4
-rw-r--r--sim/m32c/trace.c2
-rw-r--r--sim/m32r/traps.c4
-rw-r--r--sim/mips/interp.c4
-rw-r--r--sim/ppc/emul_chirp.c2
-rw-r--r--sim/ppc/hw_htab.c8
-rw-r--r--sim/ppc/hw_init.c4
-rw-r--r--sim/rl78/trace.c2
-rw-r--r--sim/rx/trace.c2
14 files changed, 23 insertions, 23 deletions
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 74d0a154a0..58bec8b9b3 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 070f451f29..63e0ab16fe 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 12f6126d43..3df30c5583 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 3589f5bfdc..5b1240f041 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 e92fa1aae2..8750c4d4e3 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 11f4a600d1..0c9eacd0bf 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 f5171c298c..1888e69122 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 a696b58437..267d54881d 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 c5d0901428..e46e817eed 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 a72a34e852..7a585388f6 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 ce098341c8..b4537fc525 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 66f205851d..804daa9a47 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 a485c4c004..669c2b5461 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 df83dc14a1..8d9293c4a6 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;