+2016-08-13  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Drop cast with
+       return value of hw_malloc.
+       * dv-m68hc11sio.c (m68hc11sio_rx_poll): Mark static.
+       (m68hc11sio_tx_poll): Likewise.
+       * dv-m68hc11spi.c (m68hc11spi_clock): Likewise.
+       * dv-m68hc11tim.c (m68hc11tim_timer_event): Likewise.
+       * dv-nvram.c (attach_nvram_regs): Drop cast with
+       return value of hw_malloc.
+       * emulos.c (emul_bench): Mark static.
+       (emul_write): Likewise.
+       (emul_exit): Likewise.
+       * gencode.c: Include stdio.h.
+       (gen_function_entry): Unify two print lines.
+       (cmp_opcode): Mark args const.
+
 2016-01-10  Mike Frysinger  <vapier@gentoo.org>
 
        * config.in, configure: Regenerate.
 
   
   controller->attach_space = attach_space;
   controller->base_address = attach_address;
-  controller->eeprom = (char*) hw_malloc (me, attach_size + 1);
+  controller->eeprom = hw_malloc (me, attach_size + 1);
   controller->eeprom_min_cycles = 10000;
   controller->size = attach_size + 1;
   controller->mapped = 0;
 
 }
 
 
-void
+static void
 m68hc11sio_rx_poll (struct hw *me, void *data)
 {
   SIM_DESC sd;
 }
 
 
-void
+static void
 m68hc11sio_tx_poll (struct hw *me, void *data)
 {
   SIM_DESC sd;
 
 #define SPI_START_BIT  1
 #define SPI_MIDDLE_BIT 2
 
-void
+static void
 m68hc11spi_clock (struct hw *me, void *data)
 {
   SIM_DESC sd;
 
   COMPARE_EVENT
 };
 
-void
+static void
 m68hc11tim_timer_event (struct hw *me, void *data)
 {
   SIM_DESC sd;
 
 
     case NVRAM_SAVE_MODIFIED:
     case NVRAM_SAVE_ALL:
-      controller->data = (char*) hw_malloc (me, attach_size);
+      controller->data = hw_malloc (me, attach_size);
       if (controller->data == 0)
         hw_abort (me, "Not enough memory, try to use the mode 'map'");
 
 
 static struct timeval bench_start;
 static struct timeval bench_stop;
 
-void
+static void
 emul_bench (struct _sim_cpu* cpu)
 {
   int op;
 }
 #endif
 
-void
+static void
 emul_write(struct _sim_cpu* state)
 {
   int addr = cpu_get_x (state) & 0x0FFFF;
    But doing an exit () on a real target is really a non-sense.
    exit () is important for the validation of GCC.  The exit status
    is passed in 'D' register.  */
-void
+static void
 emul_exit (sim_cpu *cpu)
 {
   sim_engine_halt (CPU_STATE (cpu), cpu,
 
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
 #include <errno.h>
 gen_function_entry (FILE *fp, const char *name, int locals)
 {
   /* Generate interpretor entry point. */
-  print (fp, 0, "%s (proc)\n", name);
-  print (fp, indent_level, "struct _sim_cpu* proc;");
+  print (fp, 0, "%s (sim_cpu *proc)\n", name);
   print (fp, indent_level, "{\n");
 
   /* Interpretor local variables.  */
 }
 
 int
-cmp_opcode (void* e1, void* e2)
+cmp_opcode (const void *e1, const void *e2)
 {
   struct m6811_opcode_def* op1 = (struct m6811_opcode_def*) e1;
   struct m6811_opcode_def* op2 = (struct m6811_opcode_def*) e2;