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 *).
This commit is contained in:
Alan Modra 2022-05-10 22:57:13 +09:30
parent d112ec9673
commit 845cbaa9ff
14 changed files with 23 additions and 23 deletions

View 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;

View 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;

View 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;

View 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);
}

View 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;

View 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);

View 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;

View 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;

View 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;

View 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) {

View 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

View 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);
}

View 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;

View 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;