GNU Binutils with patches for OS216
Revisão | 527aaa4a3143afedd8dd85aa70862328a9dbe627 (tree) |
---|---|
Hora | 2016-08-14 14:46:27 |
Autor | Mike Frysinger <vapier@gent...> |
Commiter | Mike Frysinger |
sim: m68hc11: fix up various prototype related warnings
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.
@@ -1,3 +1,20 @@ | ||
1 | +2016-08-13 Mike Frysinger <vapier@gentoo.org> | |
2 | + | |
3 | + * dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Drop cast with | |
4 | + return value of hw_malloc. | |
5 | + * dv-m68hc11sio.c (m68hc11sio_rx_poll): Mark static. | |
6 | + (m68hc11sio_tx_poll): Likewise. | |
7 | + * dv-m68hc11spi.c (m68hc11spi_clock): Likewise. | |
8 | + * dv-m68hc11tim.c (m68hc11tim_timer_event): Likewise. | |
9 | + * dv-nvram.c (attach_nvram_regs): Drop cast with | |
10 | + return value of hw_malloc. | |
11 | + * emulos.c (emul_bench): Mark static. | |
12 | + (emul_write): Likewise. | |
13 | + (emul_exit): Likewise. | |
14 | + * gencode.c: Include stdio.h. | |
15 | + (gen_function_entry): Unify two print lines. | |
16 | + (cmp_opcode): Mark args const. | |
17 | + | |
1 | 18 | 2016-01-10 Mike Frysinger <vapier@gentoo.org> |
2 | 19 | |
3 | 20 | * config.in, configure: Regenerate. |
@@ -217,7 +217,7 @@ attach_m68hc11eepr_regs (struct hw *me, | ||
217 | 217 | |
218 | 218 | controller->attach_space = attach_space; |
219 | 219 | controller->base_address = attach_address; |
220 | - controller->eeprom = (char*) hw_malloc (me, attach_size + 1); | |
220 | + controller->eeprom = hw_malloc (me, attach_size + 1); | |
221 | 221 | controller->eeprom_min_cycles = 10000; |
222 | 222 | controller->size = attach_size + 1; |
223 | 223 | controller->mapped = 0; |
@@ -240,7 +240,7 @@ m68hc11sio_port_event (struct hw *me, | ||
240 | 240 | } |
241 | 241 | |
242 | 242 | |
243 | -void | |
243 | +static void | |
244 | 244 | m68hc11sio_rx_poll (struct hw *me, void *data) |
245 | 245 | { |
246 | 246 | SIM_DESC sd; |
@@ -313,7 +313,7 @@ m68hc11sio_rx_poll (struct hw *me, void *data) | ||
313 | 313 | } |
314 | 314 | |
315 | 315 | |
316 | -void | |
316 | +static void | |
317 | 317 | m68hc11sio_tx_poll (struct hw *me, void *data) |
318 | 318 | { |
319 | 319 | SIM_DESC sd; |
@@ -234,7 +234,7 @@ set_bit_port (struct hw *me, sim_cpu *cpu, int port, int mask, int value) | ||
234 | 234 | #define SPI_START_BIT 1 |
235 | 235 | #define SPI_MIDDLE_BIT 2 |
236 | 236 | |
237 | -void | |
237 | +static void | |
238 | 238 | m68hc11spi_clock (struct hw *me, void *data) |
239 | 239 | { |
240 | 240 | SIM_DESC sd; |
@@ -236,7 +236,7 @@ enum event_type | ||
236 | 236 | COMPARE_EVENT |
237 | 237 | }; |
238 | 238 | |
239 | -void | |
239 | +static void | |
240 | 240 | m68hc11tim_timer_event (struct hw *me, void *data) |
241 | 241 | { |
242 | 242 | SIM_DESC sd; |
@@ -186,7 +186,7 @@ attach_nvram_regs (struct hw *me, struct nvram *controller) | ||
186 | 186 | |
187 | 187 | case NVRAM_SAVE_MODIFIED: |
188 | 188 | case NVRAM_SAVE_ALL: |
189 | - controller->data = (char*) hw_malloc (me, attach_size); | |
189 | + controller->data = hw_malloc (me, attach_size); | |
190 | 190 | if (controller->data == 0) |
191 | 191 | hw_abort (me, "Not enough memory, try to use the mode 'map'"); |
192 | 192 |
@@ -33,7 +33,7 @@ static int bench_mode = -1; | ||
33 | 33 | static struct timeval bench_start; |
34 | 34 | static struct timeval bench_stop; |
35 | 35 | |
36 | -void | |
36 | +static void | |
37 | 37 | emul_bench (struct _sim_cpu* cpu) |
38 | 38 | { |
39 | 39 | int op; |
@@ -90,7 +90,7 @@ emul_bench (struct _sim_cpu* cpu) | ||
90 | 90 | } |
91 | 91 | #endif |
92 | 92 | |
93 | -void | |
93 | +static void | |
94 | 94 | emul_write(struct _sim_cpu* state) |
95 | 95 | { |
96 | 96 | int addr = cpu_get_x (state) & 0x0FFFF; |
@@ -115,7 +115,7 @@ emul_write(struct _sim_cpu* state) | ||
115 | 115 | But doing an exit () on a real target is really a non-sense. |
116 | 116 | exit () is important for the validation of GCC. The exit status |
117 | 117 | is passed in 'D' register. */ |
118 | -void | |
118 | +static void | |
119 | 119 | emul_exit (sim_cpu *cpu) |
120 | 120 | { |
121 | 121 | sim_engine_halt (CPU_STATE (cpu), cpu, |
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License | ||
18 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
19 | 19 | |
20 | 20 | #include <stdio.h> |
21 | +#include <stdlib.h> | |
21 | 22 | #include <string.h> |
22 | 23 | #include <stdarg.h> |
23 | 24 | #include <errno.h> |
@@ -1987,8 +1988,7 @@ void | ||
1987 | 1988 | gen_function_entry (FILE *fp, const char *name, int locals) |
1988 | 1989 | { |
1989 | 1990 | /* Generate interpretor entry point. */ |
1990 | - print (fp, 0, "%s (proc)\n", name); | |
1991 | - print (fp, indent_level, "struct _sim_cpu* proc;"); | |
1991 | + print (fp, 0, "%s (sim_cpu *proc)\n", name); | |
1992 | 1992 | print (fp, indent_level, "{\n"); |
1993 | 1993 | |
1994 | 1994 | /* Interpretor local variables. */ |
@@ -2007,7 +2007,7 @@ gen_function_close (FILE *fp) | ||
2007 | 2007 | } |
2008 | 2008 | |
2009 | 2009 | int |
2010 | -cmp_opcode (void* e1, void* e2) | |
2010 | +cmp_opcode (const void *e1, const void *e2) | |
2011 | 2011 | { |
2012 | 2012 | struct m6811_opcode_def* op1 = (struct m6811_opcode_def*) e1; |
2013 | 2013 | struct m6811_opcode_def* op2 = (struct m6811_opcode_def*) e2; |