Clean up compilation warnings

Various functions dropped a void declaration (lazy), which is added.
Removed an unused variable in unix_main.
This commit is contained in:
Matt Evans 2024-12-16 23:03:40 +00:00
parent 5d23667c8e
commit 83ca8a1cfe
8 changed files with 27 additions and 28 deletions

View file

@ -47,12 +47,12 @@
extern uint8_t *_ram_base;
extern uint8_t *_rom_base;
static inline uint8_t *ram_get_base()
static inline uint8_t *ram_get_base(void)
{
return _ram_base;
}
static inline uint8_t *rom_get_base()
static inline uint8_t *rom_get_base(void)
{
return _rom_base;
}

View file

@ -30,24 +30,24 @@
#include "machw.h"
int umac_init(void *_ram_base, void *_rom_base, disc_descr_t discs[DISC_NUM_DRIVES]);
int umac_loop();
void umac_reset();
int umac_loop(void);
void umac_reset(void);
void umac_opt_disassemble(int enable);
void umac_mouse(int deltax, int deltay, int button);
void umac_kbd_event(uint8_t scancode, int down);
static inline void umac_vsync_event()
static inline void umac_vsync_event(void)
{
via_caX_event(2);
}
static inline void umac_1hz_event()
static inline void umac_1hz_event(void)
{
via_caX_event(1);
}
/* Return the offset into RAM of the current display buffer */
static inline unsigned int umac_get_fb_offset()
static inline unsigned int umac_get_fb_offset(void)
{
/* FIXME: Implement VIA RA6/vid.pg2 */
return RAM_SIZE - 0x5900;

View file

@ -31,8 +31,8 @@
struct via_cb {
void (*ra_change)(uint8_t val);
void (*rb_change)(uint8_t val);
uint8_t (*ra_in)();
uint8_t (*rb_in)();
uint8_t (*ra_in)(void);
uint8_t (*rb_in)(void);
void (*sr_tx)(uint8_t val);
void (*irq_set)(int status);
};

View file

@ -24,7 +24,7 @@
#define DERR(...) fprintf(stderr, __VA_ARGS__)
extern void umac_disc_ejected();
extern void umac_disc_ejected(void);
// B2 decls:
static int16_t SonyOpen(uint32_t pb, uint32_t dce, uint32_t status);

View file

@ -79,7 +79,7 @@ static int disassemble = 0;
#define UMAC_EXECLOOP_QUANTUM 5000
static void update_overlay_layout();
static void update_overlay_layout(void);
////////////////////////////////////////////////////////////////////////////////
@ -169,7 +169,7 @@ static void via_rb_changed(uint8_t val)
(void)val;
}
static uint8_t via_ra_in()
static uint8_t via_ra_in(void)
{
return 0;
}
@ -178,7 +178,7 @@ static uint8_t via_ra_in()
static uint8_t via_quadbits = 0;
static uint8_t via_mouse_pressed = 0;
static uint8_t via_rb_in()
static uint8_t via_rb_in(void)
{
uint8_t v = via_quadbits;
// Mouse not pressed!
@ -250,7 +250,7 @@ static void kbd_rx(uint8_t data)
}
}
static void kbd_check_work()
static void kbd_check_work(void)
{
/* Process a keyboard command a little later than the transmit
* time (i.e. not immediately, which makes the mac feel rushed
@ -484,7 +484,7 @@ void FAST_FUNC(cpu_write_long)(unsigned int address, unsigned int value)
}
/* Update function pointers for memory accessors based on overlay state/memory map layout */
static void update_overlay_layout()
static void update_overlay_layout(void)
{
if (overlay) {
cpu_read_instr = cpu_read_instr_overlay;
@ -624,7 +624,7 @@ void umac_mouse(int deltax, int deltay, int button)
via_mouse_pressed = button;
}
static void mouse_tick()
static void mouse_tick(void)
{
/* Periodically, check if the mouse X/Y deltas are non-zero.
* If a movement is required, encode one step in X and/or Y
@ -682,14 +682,14 @@ static void mouse_tick()
scc_set_dcd(dcd_a, dcd_b);
}
void umac_reset()
void umac_reset(void)
{
overlay = 1;
m68k_pulse_reset();
}
/* Called by the disc code when an eject op happens. */
void umac_disc_ejected()
void umac_disc_ejected(void)
{
#ifdef SIM
exit(1);
@ -701,7 +701,7 @@ void umac_disc_ejected()
/* Run the emulator for about a frame.
* Returns 0 for not-done, 1 when an exit/done condition arises.
*/
int umac_loop()
int umac_loop(void)
{
setjmp(main_loop_jb);

View file

@ -63,7 +63,7 @@ static uint8_t scc_dcd_pins = 0; // 0 = A, 1 = B
static uint8_t scc_dcd_a_changed = 0;
static uint8_t scc_dcd_b_changed = 0;
static void scc_assess_irq();
static void scc_assess_irq(void);
////////////////////////////////////////////////////////////////////////////////
@ -118,6 +118,7 @@ static void scc_wr2(uint8_t data)
// WR3: Receive Parameters & Control
static void scc_wr3(int AnB, uint8_t data)
{
(void)AnB;
// Keep an eye out for bit 0x10 (enter hunt mode), and external/status is asserted
if (data & 0x10) {
@ -223,7 +224,7 @@ static uint8_t scc_rr15(int AnB)
// Call after a state change: checks MIE, interrupt enables,
// and (de)asserts IRQ output if necessary
static void scc_assess_irq()
static void scc_assess_irq(void)
{
if (scc_dcd_a_changed && (scc_ie[1] & SCC_IE_DCD)) {
scc_irq_pending |= SCC_IP_A_EXT;

View file

@ -274,7 +274,6 @@ int main(int argc, char *argv[])
// Main loop
int done = 0;
uint64_t loops = 0;
int mouse_button = 0;
uint64_t last_vsync = 0;
uint64_t last_1hz = 0;
@ -283,7 +282,6 @@ int main(int argc, char *argv[])
SDL_Event event;
int mousex = 0;
int mousey = 0;
loops++;
if (SDL_PollEvent(&event)) {
switch (event.type) {

View file

@ -145,7 +145,7 @@ static void via_update_sr(uint8_t data)
* transmit callback action -- the response then cannot race with the
* IRQ showing the TX has completed.
*/
static void via_sr_done()
static void via_sr_done(void)
{
if (sr_tx_pending >= 0) {
uint8_t data = (uint8_t)sr_tx_pending;
@ -163,7 +163,7 @@ static void via_sr_done()
// 1 CA2: Vertical blanking interrupt
// 0 CA1: One-second interrupt
static void via_assess_irq()
static void via_assess_irq(void)
{
int irq = 0;
static uint8_t last_active = 0;
@ -233,13 +233,13 @@ void via_write(unsigned int address, uint8_t data)
via_assess_irq();
}
uint8_t via_read_ifr()
uint8_t via_read_ifr(void)
{
uint8_t active = irq_enable & irq_active & 0x7f;
return irq_active | (active ? 0x80 : 0);
}
static uint8_t via_read_rega()
static uint8_t via_read_rega(void)
{
uint8_t data = (via_callbacks.ra_in) ? via_callbacks.ra_in() : 0;
uint8_t ddr = via_regs[VIA_DDRA];
@ -247,7 +247,7 @@ static uint8_t via_read_rega()
return (ddr & via_regs[VIA_RA]) | (~ddr & data);
}
static uint8_t via_read_regb()
static uint8_t via_read_regb(void)
{
uint8_t data = (via_callbacks.rb_in) ? via_callbacks.rb_in() : 0;
uint8_t ddr = via_regs[VIA_DDRB];