• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisão527aaa4a3143afedd8dd85aa70862328a9dbe627 (tree)
Hora2016-08-14 14:46:27
AutorMike Frysinger <vapier@gent...>
CommiterMike Frysinger

Mensagem de Log

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.

Mudança Sumário

Diff

--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -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+
118 2016-01-10 Mike Frysinger <vapier@gentoo.org>
219
320 * config.in, configure: Regenerate.
--- a/sim/m68hc11/dv-m68hc11eepr.c
+++ b/sim/m68hc11/dv-m68hc11eepr.c
@@ -217,7 +217,7 @@ attach_m68hc11eepr_regs (struct hw *me,
217217
218218 controller->attach_space = attach_space;
219219 controller->base_address = attach_address;
220- controller->eeprom = (char*) hw_malloc (me, attach_size + 1);
220+ controller->eeprom = hw_malloc (me, attach_size + 1);
221221 controller->eeprom_min_cycles = 10000;
222222 controller->size = attach_size + 1;
223223 controller->mapped = 0;
--- a/sim/m68hc11/dv-m68hc11sio.c
+++ b/sim/m68hc11/dv-m68hc11sio.c
@@ -240,7 +240,7 @@ m68hc11sio_port_event (struct hw *me,
240240 }
241241
242242
243-void
243+static void
244244 m68hc11sio_rx_poll (struct hw *me, void *data)
245245 {
246246 SIM_DESC sd;
@@ -313,7 +313,7 @@ m68hc11sio_rx_poll (struct hw *me, void *data)
313313 }
314314
315315
316-void
316+static void
317317 m68hc11sio_tx_poll (struct hw *me, void *data)
318318 {
319319 SIM_DESC sd;
--- 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)
234234 #define SPI_START_BIT 1
235235 #define SPI_MIDDLE_BIT 2
236236
237-void
237+static void
238238 m68hc11spi_clock (struct hw *me, void *data)
239239 {
240240 SIM_DESC sd;
--- a/sim/m68hc11/dv-m68hc11tim.c
+++ b/sim/m68hc11/dv-m68hc11tim.c
@@ -236,7 +236,7 @@ enum event_type
236236 COMPARE_EVENT
237237 };
238238
239-void
239+static void
240240 m68hc11tim_timer_event (struct hw *me, void *data)
241241 {
242242 SIM_DESC sd;
--- 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)
186186
187187 case NVRAM_SAVE_MODIFIED:
188188 case NVRAM_SAVE_ALL:
189- controller->data = (char*) hw_malloc (me, attach_size);
189+ controller->data = hw_malloc (me, attach_size);
190190 if (controller->data == 0)
191191 hw_abort (me, "Not enough memory, try to use the mode 'map'");
192192
--- a/sim/m68hc11/emulos.c
+++ b/sim/m68hc11/emulos.c
@@ -33,7 +33,7 @@ static int bench_mode = -1;
3333 static struct timeval bench_start;
3434 static struct timeval bench_stop;
3535
36-void
36+static void
3737 emul_bench (struct _sim_cpu* cpu)
3838 {
3939 int op;
@@ -90,7 +90,7 @@ emul_bench (struct _sim_cpu* cpu)
9090 }
9191 #endif
9292
93-void
93+static void
9494 emul_write(struct _sim_cpu* state)
9595 {
9696 int addr = cpu_get_x (state) & 0x0FFFF;
@@ -115,7 +115,7 @@ emul_write(struct _sim_cpu* state)
115115 But doing an exit () on a real target is really a non-sense.
116116 exit () is important for the validation of GCC. The exit status
117117 is passed in 'D' register. */
118-void
118+static void
119119 emul_exit (sim_cpu *cpu)
120120 {
121121 sim_engine_halt (CPU_STATE (cpu), cpu,
--- 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
1818 along with this program. If not, see <http://www.gnu.org/licenses/>. */
1919
2020 #include <stdio.h>
21+#include <stdlib.h>
2122 #include <string.h>
2223 #include <stdarg.h>
2324 #include <errno.h>
@@ -1987,8 +1988,7 @@ void
19871988 gen_function_entry (FILE *fp, const char *name, int locals)
19881989 {
19891990 /* 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);
19921992 print (fp, indent_level, "{\n");
19931993
19941994 /* Interpretor local variables. */
@@ -2007,7 +2007,7 @@ gen_function_close (FILE *fp)
20072007 }
20082008
20092009 int
2010-cmp_opcode (void* e1, void* e2)
2010+cmp_opcode (const void *e1, const void *e2)
20112011 {
20122012 struct m6811_opcode_def* op1 = (struct m6811_opcode_def*) e1;
20132013 struct m6811_opcode_def* op2 = (struct m6811_opcode_def*) e2;