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;
 
 
   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;
 
   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;
 
 
   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);
 }
 
       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;
 
 
            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);
 
 }
 
 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;
 
        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;
 
 
           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;
 
 
 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) {
 
 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);
 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;
   }
 
   /* 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) {
                  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
 
 static void
 update_for_binary_section(bfd *abfd,
                          asection *the_section,
-                         PTR obj)
+                         void *obj)
 {
   unsigned_word section_vma;
   unsigned_word section_size;
   /* and the data sections */
   bfd_map_over_sections(image,
                        update_for_binary_section,
-                       (PTR)me);
+                       me);
 
   bfd_close(image);
 }
 
 }
 
 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;
 
 }
 
 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;