From patchwork Sun Aug 14 05:47:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 14559 Received: (qmail 8008 invoked by alias); 14 Aug 2016 05:48:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7640 invoked by uid 89); 14 Aug 2016 05:48:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=186, 7, 907, Drop, *me X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 14 Aug 2016 05:47:53 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id CD990340C24 for ; Sun, 14 Aug 2016 05:47:51 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: m68hc11: fix up various prototype related warnings Date: Sat, 13 Aug 2016 22:47:51 -0700 Message-Id: <20160814054751.14455-1-vapier@gentoo.org> X-IsSubscribed: yes A few funcs are only used locally, so mark them static to avoid warnings due to -Wmissing-prototypes. Some funcs cast the return value wrong, so drop them (and let void * just work by default). Update some prototypes to be new style. --- sim/m68hc11/ChangeLog | 17 +++++++++++++++++ sim/m68hc11/dv-m68hc11eepr.c | 2 +- sim/m68hc11/dv-m68hc11sio.c | 4 ++-- sim/m68hc11/dv-m68hc11spi.c | 2 +- sim/m68hc11/dv-m68hc11tim.c | 2 +- sim/m68hc11/dv-nvram.c | 2 +- sim/m68hc11/emulos.c | 6 +++--- sim/m68hc11/gencode.c | 6 +++--- 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index b8f9ffc3fc15..7fcb535d56f0 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,20 @@ +2016-08-13 Mike Frysinger + + * 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 * config.in, configure: Regenerate. diff --git a/sim/m68hc11/dv-m68hc11eepr.c b/sim/m68hc11/dv-m68hc11eepr.c index 6fee524da528..6c03a998df0d 100644 --- a/sim/m68hc11/dv-m68hc11eepr.c +++ b/sim/m68hc11/dv-m68hc11eepr.c @@ -217,7 +217,7 @@ attach_m68hc11eepr_regs (struct hw *me, 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; diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c index dd05c28bb454..fe850e424b15 100644 --- a/sim/m68hc11/dv-m68hc11sio.c +++ b/sim/m68hc11/dv-m68hc11sio.c @@ -240,7 +240,7 @@ m68hc11sio_port_event (struct hw *me, } -void +static void m68hc11sio_rx_poll (struct hw *me, void *data) { SIM_DESC sd; @@ -313,7 +313,7 @@ m68hc11sio_rx_poll (struct hw *me, void *data) } -void +static void m68hc11sio_tx_poll (struct hw *me, void *data) { SIM_DESC sd; diff --git a/sim/m68hc11/dv-m68hc11spi.c b/sim/m68hc11/dv-m68hc11spi.c index 4bcfb95612e6..a4e914867b5f 100644 --- a/sim/m68hc11/dv-m68hc11spi.c +++ b/sim/m68hc11/dv-m68hc11spi.c @@ -234,7 +234,7 @@ set_bit_port (struct hw *me, sim_cpu *cpu, int port, int mask, int value) #define SPI_START_BIT 1 #define SPI_MIDDLE_BIT 2 -void +static void m68hc11spi_clock (struct hw *me, void *data) { SIM_DESC sd; diff --git a/sim/m68hc11/dv-m68hc11tim.c b/sim/m68hc11/dv-m68hc11tim.c index 317d46415222..c4e6c9daa0dc 100644 --- a/sim/m68hc11/dv-m68hc11tim.c +++ b/sim/m68hc11/dv-m68hc11tim.c @@ -236,7 +236,7 @@ enum event_type COMPARE_EVENT }; -void +static void m68hc11tim_timer_event (struct hw *me, void *data) { SIM_DESC sd; diff --git a/sim/m68hc11/dv-nvram.c b/sim/m68hc11/dv-nvram.c index 6a27a3213af2..6a72c96cbd36 100644 --- a/sim/m68hc11/dv-nvram.c +++ b/sim/m68hc11/dv-nvram.c @@ -186,7 +186,7 @@ attach_nvram_regs (struct hw *me, struct nvram *controller) 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'"); diff --git a/sim/m68hc11/emulos.c b/sim/m68hc11/emulos.c index 77607c7eb679..e11c6188f012 100644 --- a/sim/m68hc11/emulos.c +++ b/sim/m68hc11/emulos.c @@ -33,7 +33,7 @@ static int bench_mode = -1; static struct timeval bench_start; static struct timeval bench_stop; -void +static void emul_bench (struct _sim_cpu* cpu) { int op; @@ -90,7 +90,7 @@ emul_bench (struct _sim_cpu* cpu) } #endif -void +static void emul_write(struct _sim_cpu* state) { int addr = cpu_get_x (state) & 0x0FFFF; @@ -115,7 +115,7 @@ emul_write(struct _sim_cpu* state) 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, diff --git a/sim/m68hc11/gencode.c b/sim/m68hc11/gencode.c index 1b1844debcb0..a3032f8d6272 100644 --- a/sim/m68hc11/gencode.c +++ b/sim/m68hc11/gencode.c @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include +#include #include #include #include @@ -1987,8 +1988,7 @@ void 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. */ @@ -2007,7 +2007,7 @@ gen_function_close (FILE *fp) } 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;