Skip to content

Commit

Permalink
fix clang/gcc unused-parameter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed May 30, 2020
1 parent 76736e2 commit fdef73e
Show file tree
Hide file tree
Showing 28 changed files with 100 additions and 35 deletions.
8 changes: 4 additions & 4 deletions chips/am40010.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static void _am40010_init_video(am40010_t* ga) {
}

/* initialize the crt init */
static void _am40010_init_crt(am40010_t* ga, const am40010_desc_t* desc) {
static void _am40010_init_crt(am40010_t* ga) {
memset(&ga->crt, 0, sizeof(ga->crt));
}

Expand Down Expand Up @@ -372,7 +372,7 @@ void am40010_init(am40010_t* ga, const am40010_desc_t* desc) {
ga->user_data = desc->user_data;
_am40010_init_regs(ga);
_am40010_init_video(ga);
_am40010_init_crt(ga, desc);
_am40010_init_crt(ga);
_am40010_init_colors(ga);
ga->bankswitch_cb(ga->ram_config, ga->regs.config, ga->rom_select, ga->user_data);
}
Expand Down Expand Up @@ -787,7 +787,7 @@ static inline void _am40010_do_cclk(am40010_t* ga, uint64_t crtc_pins) {
with a clock cycle where the CPU samples the WAIT pin, the
CPU will be stopped until the READY pin goes inactive again.
*/
static inline int _am40010_wait_scan_tick(am40010_t* ga, int num_ticks, uint64_t pins) {
static inline int _am40010_wait_scan_tick(uint64_t pins) {
int wait_scan_tick = -1;
/* NOTE: these offsets are important for proper computation of the CCLK clock */
if (pins & Z80_MREQ) {
Expand All @@ -810,7 +810,7 @@ static inline int _am40010_wait_scan_tick(am40010_t* ga, int num_ticks, uint64_t
/* the tick function must be called at 4 MHz */
uint64_t am40010_tick(am40010_t* ga, int num_ticks, uint64_t pins) {
/* determine at what clock cycle the CPU samples the WAIT pin */
int wait_scan_tick = _am40010_wait_scan_tick(ga, num_ticks, pins);
int wait_scan_tick = _am40010_wait_scan_tick(pins);

/* for each 4 MHz tick... */
uint32_t wait_cycles = 0;
Expand Down
2 changes: 2 additions & 0 deletions chips/fdd.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ int fdd_seek_track(fdd_t* fdd, int track) {
int fdd_seek_sector(fdd_t* fdd, uint8_t c, uint8_t h, uint8_t r, uint8_t n) {
CHIPS_ASSERT(fdd);
CHIPS_ASSERT(h < FDD_MAX_SIDES);
(void)c; // FIXME (?)
(void)n; // FIXME (?)
if (fdd->has_disc && fdd->motor_on) {
fdd->cur_side = h;
const fdd_track_t* track = &fdd->disc.tracks[h][fdd->cur_track_index];
Expand Down
8 changes: 4 additions & 4 deletions chips/m6522.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ static inline void _m6522_write_ifr(m6522_t* c, uint8_t data) {
(essentially: T1 is always reloaded from latch, both in continuous
and oneshot mode, while T2 is never reloaded)
*/
static void _m6522_tick_t1(m6522_t* c, uint64_t pins) {
static void _m6522_tick_t1(m6522_t* c) {
m6522_timer_t* t = &c->t1;

/* decrement counter? */
Expand Down Expand Up @@ -590,7 +590,7 @@ static void _m6522_tick_pipeline(m6522_t* c) {
c->intr.pip = (c->intr.pip >> 1) & 0x7F7F;
}

static void _m6522_update_cab(m6522_t* c, uint64_t pins) {
static void _m6522_update_cab(m6522_t* c) {
if (c->pa.c1_triggered) {
_m6522_set_intr(c, M6522_IRQ_CA1);
if (M6522_PCR_CA2_AUTO_HS(c)) {
Expand Down Expand Up @@ -632,8 +632,8 @@ static uint64_t _m6522_update_irq(m6522_t* c, uint64_t pins) {
/* perform a tick */
static uint64_t _m6522_tick(m6522_t* c, uint64_t pins) {
_m6522_read_port_pins(c, pins);
_m6522_update_cab(c, pins);
_m6522_tick_t1(c, pins);
_m6522_update_cab(c);
_m6522_tick_t1(c);
_m6522_tick_t2(c, pins);
pins = _m6522_update_irq(c, pins);
pins = _m6522_write_port_pins(c, pins);
Expand Down
12 changes: 6 additions & 6 deletions chips/m6526.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static uint64_t _m6526_update_irq(m6526_t* c, uint64_t pins) {
(since this is different for timer A and B)
check here for the details: https://ist.uwaterloo.ca/~schepers/MJK/cia6526.html
*/
static void _m6526_tick_timer(m6526_t* c, m6526_timer_t* t) {
static void _m6526_tick_timer(m6526_timer_t* t) {
/* decrement counter? */
if (_M6526_PIP_TEST(t->pip, M6526_PIP_TIMER_COUNT, 0)) {
t->counter--;
Expand Down Expand Up @@ -523,15 +523,15 @@ static void _m6526_tick_pipeline(m6526_t* c) {

static uint64_t _m6526_tick(m6526_t* c, uint64_t pins) {
_m6526_read_port_pins(c, pins);
_m6526_tick_timer(c, &c->ta);
_m6526_tick_timer(c, &c->tb);
_m6526_tick_timer(&c->ta);
_m6526_tick_timer(&c->tb);
pins = _m6526_update_irq(c, pins);
pins = _m6526_write_port_pins(c, pins);
_m6526_tick_pipeline(c);
return pins;
}

static inline void _m6526_write_cr(m6526_t* c, m6526_timer_t* t, uint8_t data) {
static inline void _m6526_write_cr(m6526_timer_t* t, uint8_t data) {
/* if the start bit goes from 0 to 1, set the current toggle-bit-state to 1 */
if (!M6526_TIMER_STARTED(t->cr) && M6526_TIMER_STARTED(data)) {
t->t_bit = true;
Expand Down Expand Up @@ -620,10 +620,10 @@ static void _m6526_write(m6526_t* c, uint8_t addr, uint8_t data) {
_m6526_write_icr(c, data);
break;
case M6526_REG_CRA:
_m6526_write_cr(c, &c->ta, data);
_m6526_write_cr(&c->ta, data);
break;
case M6526_REG_CRB:
_m6526_write_cr(c, &c->tb, data);
_m6526_write_cr(&c->tb, data);
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions chips/m6569.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ static inline void _m6569_io_update_gunit_mode(m6569_graphics_unit_t* gu, uint8_

/* update sprite unit positions and sizes when updating registers */
static void _m6569_io_update_sunit(m6569_t* vic, int i, uint8_t mx, uint8_t my, uint8_t mx8, uint8_t mxe, uint8_t mye) {
(void)my; // FIXME: my is really unused?
m6569_sprite_unit_t* su = &vic->sunit;
/* mxb: MSB for each xpos */
uint16_t xpos = ((mx8 & (1<<i))<<(8-i)) | mx;
Expand Down
2 changes: 2 additions & 0 deletions chips/upd765.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ static uint8_t _upd765_exec_rd(upd765_t* upd) {
/* called when a byte is written during the exec phase */
static void _upd765_exec_wr(upd765_t* upd, uint8_t data) {
// FIXME
(void)upd;
(void)data;
}

/* write a data byte to the upd765 */
Expand Down
2 changes: 2 additions & 0 deletions systems/atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,13 @@ int atom_max_display_size(void) {

int atom_display_width(atom_t* sys) {
CHIPS_ASSERT(sys && sys->valid);
(void)sys;
return MC6847_DISPLAY_WIDTH;
}

int atom_display_height(atom_t* sys) {
CHIPS_ASSERT(sys && sys->valid);
(void)sys;
return MC6847_DISPLAY_HEIGHT;
}

Expand Down
2 changes: 2 additions & 0 deletions systems/bombjack.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,12 @@ int bombjack_display_size(void) {
}

int bombjack_display_width(bombjack_t* sys) {
(void)sys;
return _BOMBJACK_DISPLAY_WIDTH;
}

int bombjack_display_height(bombjack_t* sys) {
(void)sys;
return _BOMBJACK_DISPLAY_HEIGHT;
}

Expand Down
4 changes: 4 additions & 0 deletions systems/c1541.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,14 @@ void c1541_tick(c1541_t* sys) {

void c1541_insert_disc(c1541_t* sys, const uint8_t* ptr, int num_bytes) {
// FIXME
(void)sys;
(void)ptr;
(void)num_bytes;
}

void c1541_remove_disc(c1541_t* sys) {
// FIXME
(void)sys;
}

#endif /* CHIPS_IMPL */
13 changes: 9 additions & 4 deletions systems/cpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ static uint64_t _cpc_cclk(void* user_data) {
/* PSG OUT callback (nothing to do here) */
static void _cpc_psg_out(int port_id, uint8_t data, void* user_data) {
/* this shouldn't be called */
(void)port_id;
(void)data;
(void)user_data;
}

/* PSG IN callback (read keyboard matrix and joystick port) */
Expand Down Expand Up @@ -933,14 +936,14 @@ typedef struct {
uint8_t pad_5[0x60];
} _cpc_bin_header;

static bool _cpc_is_valid_bin(const uint8_t* ptr, int num_bytes) {
static bool _cpc_is_valid_bin(int num_bytes) {
if (num_bytes <= (int)sizeof(_cpc_bin_header)) {
return false;
}
return true;
}

static bool _cpc_load_bin(cpc_t* sys, const uint8_t* ptr, int num_bytes) {
static bool _cpc_load_bin(cpc_t* sys, const uint8_t* ptr) {
const _cpc_bin_header* hdr = (const _cpc_bin_header*) ptr;
ptr += sizeof(_cpc_bin_header);
const uint16_t load_addr = (hdr->load_addr_h<<8)|hdr->load_addr_l;
Expand All @@ -961,8 +964,8 @@ bool cpc_quickload(cpc_t* sys, const uint8_t* ptr, int num_bytes) {
if (_cpc_is_valid_sna(ptr, num_bytes)) {
return _cpc_load_sna(sys, ptr, num_bytes);
}
else if (_cpc_is_valid_bin(ptr, num_bytes)) {
return _cpc_load_bin(sys, ptr, num_bytes);
else if (_cpc_is_valid_bin(num_bytes)) {
return _cpc_load_bin(sys, ptr);
}
else {
/* not a known file type, or not enough data */
Expand All @@ -973,6 +976,8 @@ bool cpc_quickload(cpc_t* sys, const uint8_t* ptr, int num_bytes) {
/*=== CASSETTE TAPE FILE LOADING =============================================*/
/* CPU trap handler to check for casread */
static int _cpc_trap_cb(uint16_t pc, uint32_t ticks, uint64_t pins, void* user_data) {
(void)ticks;
(void)pins;
cpc_t* sys = (cpc_t*) user_data;
return (pc == sys->casread_trap) ? 1 : 0;
}
Expand Down
13 changes: 9 additions & 4 deletions systems/kc85.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,12 @@ int kc85_max_display_size(void) {
}

int kc85_display_width(kc85_t* sys) {
(void)sys;
return _KC85_DISPLAY_WIDTH;
}

int kc85_display_height(kc85_t* sys) {
(void)sys;
return _KC85_DISPLAY_HEIGHT;
}

Expand Down Expand Up @@ -1012,6 +1014,8 @@ static uint64_t _kc85_tick(int num_ticks, uint64_t pins, void* user_data) {
}

static uint8_t _kc85_pio_in(int port_id, void* user_data) {
(void)port_id;
(void)user_data;
return 0xFF;
}

Expand Down Expand Up @@ -1201,6 +1205,7 @@ static void _kc85_exp_init(kc85_t* sys) {
}

static void _kc85_exp_reset(kc85_t* sys) {
(void)sys;
/* FIXME? */
}

Expand Down Expand Up @@ -1573,7 +1578,7 @@ static bool _kc85_is_valid_kcc(const uint8_t* ptr, int num_bytes) {
return true;
}

static bool _kc85_load_kcc(kc85_t* sys, const uint8_t* ptr, int num_bytes) {
static bool _kc85_load_kcc(kc85_t* sys, const uint8_t* ptr) {
const _kc85_kcc_header* hdr = (_kc85_kcc_header*) ptr;
uint16_t addr = hdr->load_addr_h<<8 | hdr->load_addr_l;
uint16_t end_addr = hdr->end_addr_h<<8 | hdr->end_addr_l;
Expand Down Expand Up @@ -1630,7 +1635,7 @@ static bool _kc85_is_valid_kctap(const uint8_t* ptr, int num_bytes) {
return true;
}

static bool _kc85_load_kctap(kc85_t* sys, const uint8_t* ptr, int num_bytes) {
static bool _kc85_load_kctap(kc85_t* sys, const uint8_t* ptr) {
const _kc85_kctap_header* hdr = (const _kc85_kctap_header*) ptr;
uint16_t addr = hdr->kcc.load_addr_h<<8 | hdr->kcc.load_addr_l;
uint16_t end_addr = hdr->kcc.end_addr_h<<8 | hdr->kcc.end_addr_l;
Expand All @@ -1654,10 +1659,10 @@ bool kc85_quickload(kc85_t* sys, const uint8_t* ptr, int num_bytes) {
CHIPS_ASSERT(sys && sys->valid && ptr);
/* first check for KC-TAP format, since this can be properly identified */
if (_kc85_is_valid_kctap(ptr, num_bytes)) {
return _kc85_load_kctap(sys, ptr, num_bytes);
return _kc85_load_kctap(sys, ptr);
}
else if (_kc85_is_valid_kcc(ptr, num_bytes)) {
return _kc85_load_kcc(sys, ptr, num_bytes);
return _kc85_load_kcc(sys, ptr);
}
else {
/* not a known file type, or not enough data */
Expand Down
5 changes: 5 additions & 0 deletions systems/lc80.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ static uint32_t _lc80_vqe23_write(uint32_t vqe23, int digit, uint8_t data) {
}

uint8_t _lc80_pio_sys_in(int port_id, void* user_data) {
(void)port_id;
(void)user_data;
// FIXME: TAPE IN
return 0xFF;
}
Expand Down Expand Up @@ -651,6 +653,9 @@ uint8_t _lc80_pio_usr_in(int port_id, void* user_data) {

void _lc80_pio_usr_out(int port_id, uint8_t data, void* user_data) {
// FIXME
(void)port_id;
(void)data;
(void)user_data;
}

#endif /* CHIPS_IMPL */
2 changes: 2 additions & 0 deletions systems/namco.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,10 +912,12 @@ int namco_std_display_height(void) {
}

int namco_display_width(namco_t* sys) {
(void)sys;
return NAMCO_DISPLAY_WIDTH;
}

int namco_display_height(namco_t* sys) {
(void)sys;
return NAMCO_DISPLAY_HEIGHT;
}

Expand Down
3 changes: 3 additions & 0 deletions systems/z1013.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ int z1013_max_display_size(void) {
}

int z1013_display_width(z1013_t* sys) {
(void)sys;
return _Z1013_DISPLAY_WIDTH;
}

int z1013_display_height(z1013_t* sys) {
(void)sys;
return _Z1013_DISPLAY_HEIGHT;
}

Expand Down Expand Up @@ -343,6 +345,7 @@ void z1013_key_up(z1013_t* sys, int key_code) {
}

static uint64_t _z1013_tick(int num_ticks, uint64_t pins, void* user_data) {
(void)num_ticks;
z1013_t* sys = (z1013_t*) user_data;
if (pins & Z80_MREQ) {
/* a memory request */
Expand Down
12 changes: 8 additions & 4 deletions systems/z9001.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,12 @@ int z9001_max_display_size(void) {
}

int z9001_display_width(z9001_t* sys) {
(void)sys;
return _Z9001_DISPLAY_WIDTH;
}

int z9001_display_height(z9001_t* sys) {
(void)sys;
return _Z9001_DISPLAY_HEIGHT;
}

Expand Down Expand Up @@ -542,10 +544,12 @@ static uint64_t _z9001_tick(int num_ticks, uint64_t pins, void* user_data) {


static uint8_t _z9001_pio1_in(int port_id, void* user_data) {
(void)port_id; (void)user_data;
return 0x00;
}

static void _z9001_pio1_out(int port_id, uint8_t data, void* user_data) {
(void)data; (void)user_data;
if (Z80PIO_PORT_A == port_id) {
/*
PIO1-A bits:
Expand Down Expand Up @@ -707,7 +711,7 @@ static bool _z9001_is_valid_kcc(const uint8_t* ptr, int num_bytes) {
return true;
}

static bool _z9001_load_kcc(z9001_t* sys, const uint8_t* ptr, int num_bytes) {
static bool _z9001_load_kcc(z9001_t* sys, const uint8_t* ptr) {
const _z9001_kcc_header* hdr = (_z9001_kcc_header*) ptr;
uint16_t addr = hdr->load_addr_h<<8 | hdr->load_addr_l;
uint16_t end_addr = hdr->end_addr_h<<8 | hdr->end_addr_l;
Expand Down Expand Up @@ -759,7 +763,7 @@ static bool _z9001_is_valid_kctap(const uint8_t* ptr, int num_bytes) {
return true;
}

static bool _z9001_load_kctap(z9001_t* sys, const uint8_t* ptr, int num_bytes) {
static bool _z9001_load_kctap(z9001_t* sys, const uint8_t* ptr) {
const _z9001_kctap_header* hdr = (const _z9001_kctap_header*) ptr;
uint16_t addr = hdr->kcc.load_addr_h<<8 | hdr->kcc.load_addr_l;
uint16_t end_addr = hdr->kcc.end_addr_h<<8 | hdr->kcc.end_addr_l;
Expand All @@ -782,10 +786,10 @@ bool z9001_quickload(z9001_t* sys, const uint8_t* ptr, int num_bytes) {
CHIPS_ASSERT(sys && sys->valid && ptr);
/* first check for KC TAP, since this can be properly identified */
if (_z9001_is_valid_kctap(ptr, num_bytes)) {
return _z9001_load_kctap(sys, ptr, num_bytes);
return _z9001_load_kctap(sys, ptr);
}
else if (_z9001_is_valid_kcc(ptr, num_bytes)) {
return _z9001_load_kcc(sys, ptr, num_bytes);
return _z9001_load_kcc(sys, ptr);
}
else {
/* not a known file type, or not enough data */
Expand Down
Loading

0 comments on commit fdef73e

Please sign in to comment.