Next round of sonarlint cleanups

This commit is contained in:
Jasmine Iwanek
2023-06-26 12:47:04 -04:00
parent 2fe3bcd5d2
commit 21adfd4d50
176 changed files with 2791 additions and 1377 deletions

View File

@@ -35,6 +35,7 @@
#include <86box/joystick_standard.h>
#include <86box/joystick_sw_pad.h>
#include <86box/joystick_tm_fcs.h>
#include <86box/plat_unused.h>
typedef struct {
pc_timer_t timer;
@@ -214,7 +215,7 @@ gameport_time(joystick_instance_t *joystick, int nr, int axis)
}
static void
gameport_write(uint16_t addr, uint8_t val, void *priv)
gameport_write(UNUSED(uint16_t addr), UNUSED(uint8_t val), void *priv)
{
gameport_t *dev = (gameport_t *) priv;
joystick_instance_t *joystick = dev->joystick;
@@ -238,7 +239,7 @@ gameport_write(uint16_t addr, uint8_t val, void *priv)
}
static uint8_t
gameport_read(uint16_t addr, void *priv)
gameport_read(UNUSED(uint16_t addr), void *priv)
{
gameport_t *dev = (gameport_t *) priv;
joystick_instance_t *joystick = dev->joystick;
@@ -400,7 +401,7 @@ gameport_init(const device_t *info)
}
static void *
tmacm_init(const device_t *info)
tmacm_init(UNUSED(const device_t *info))
{
uint16_t port = 0x0000;
gameport_t *dev = NULL;

View File

@@ -44,6 +44,7 @@
#include <86box/timer.h>
#include <86box/gameport.h>
#include <86box/joystick_standard.h>
#include <86box/plat_unused.h>
static void *
ch_flightstick_pro_init(void)
@@ -52,12 +53,13 @@ ch_flightstick_pro_init(void)
}
static void
ch_flightstick_pro_close(void *p)
ch_flightstick_pro_close(UNUSED(void *priv))
{
//
}
static uint8_t
ch_flightstick_pro_read(void *p)
ch_flightstick_pro_read(UNUSED(void *priv))
{
uint8_t ret = 0xf0;
@@ -86,12 +88,13 @@ ch_flightstick_pro_read(void *p)
}
static void
ch_flightstick_pro_write(void *p)
ch_flightstick_pro_write(UNUSED(void *priv))
{
//
}
static int
ch_flightstick_pro_read_axis(void *p, int axis)
ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -111,8 +114,9 @@ ch_flightstick_pro_read_axis(void *p, int axis)
}
static void
ch_flightstick_pro_a0_over(void *p)
ch_flightstick_pro_a0_over(UNUSED(void *priv))
{
//
}
const joystick_if_t joystick_ch_flightstick_pro = {

View File

@@ -44,6 +44,7 @@
#include <86box/timer.h>
#include <86box/gameport.h>
#include <86box/joystick_standard.h>
#include <86box/plat_unused.h>
static void *
joystick_standard_init(void)
@@ -52,12 +53,13 @@ joystick_standard_init(void)
}
static void
joystick_standard_close(void *p)
joystick_standard_close(UNUSED(void *priv))
{
//
}
static uint8_t
joystick_standard_read(void *p)
joystick_standard_read(UNUSED(void *priv))
{
uint8_t ret = 0xf0;
@@ -78,7 +80,7 @@ joystick_standard_read(void *p)
}
static uint8_t
joystick_standard_read_4button(void *p)
joystick_standard_read_4button(UNUSED(void *priv))
{
uint8_t ret = 0xf0;
@@ -97,12 +99,13 @@ joystick_standard_read_4button(void *p)
}
static void
joystick_standard_write(void *p)
joystick_standard_write(UNUSED(void *priv))
{
//
}
static int
joystick_standard_read_axis(void *p, int axis)
joystick_standard_read_axis(UNUSED(void *priv), int axis)
{
switch (axis) {
case 0:
@@ -127,7 +130,7 @@ joystick_standard_read_axis(void *p, int axis)
}
static int
joystick_standard_read_axis_4button(void *p, int axis)
joystick_standard_read_axis_4button(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -147,7 +150,7 @@ joystick_standard_read_axis_4button(void *p, int axis)
}
static int
joystick_standard_read_axis_3axis(void *p, int axis)
joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -167,7 +170,7 @@ joystick_standard_read_axis_3axis(void *p, int axis)
}
static int
joystick_standard_read_axis_4axis(void *p, int axis)
joystick_standard_read_axis_4axis(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -187,7 +190,7 @@ joystick_standard_read_axis_4axis(void *p, int axis)
}
static int
joystick_standard_read_axis_6button(void *p, int axis)
joystick_standard_read_axis_6button(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -206,7 +209,7 @@ joystick_standard_read_axis_6button(void *p, int axis)
}
}
static int
joystick_standard_read_axis_8button(void *p, int axis)
joystick_standard_read_axis_8button(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -234,8 +237,9 @@ joystick_standard_read_axis_8button(void *p, int axis)
}
static void
joystick_standard_a0_over(void *p)
joystick_standard_a0_over(UNUSED(void *priv))
{
//
}
const joystick_if_t joystick_2axis_2button = {

View File

@@ -65,6 +65,7 @@
#include <86box/timer.h>
#include <86box/gameport.h>
#include <86box/joystick_sw_pad.h>
#include <86box/plat_unused.h>
typedef struct
{
@@ -79,9 +80,9 @@ typedef struct
} sw_data;
static void
sw_timer_over(void *p)
sw_timer_over(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
sw->poll_clock = !sw->poll_clock;
@@ -99,9 +100,9 @@ sw_timer_over(void *p)
}
static void
sw_trigger_timer_over(void *p)
sw_trigger_timer_over(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
timer_disable(&sw->trigger_timer);
}
@@ -132,17 +133,17 @@ sw_init(void)
}
static void
sw_close(void *p)
sw_close(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
free(sw);
}
static uint8_t
sw_read(void *p)
sw_read(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
uint8_t temp = 0;
if (!JOYSTICK_PRESENT(0))
@@ -166,9 +167,9 @@ sw_read(void *p)
}
static void
sw_write(void *p)
sw_write(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
int64_t time_since_last = timer_get_remaining_us(&sw->trigger_timer);
if (!JOYSTICK_PRESENT(0))
@@ -234,7 +235,7 @@ sw_write(void *p)
}
static int
sw_read_axis(void *p, int axis)
sw_read_axis(UNUSED(void *priv), UNUSED(int axis))
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -243,9 +244,9 @@ sw_read_axis(void *p, int axis)
}
static void
sw_a0_over(void *p)
sw_a0_over(void *priv)
{
sw_data *sw = (sw_data *) p;
sw_data *sw = (sw_data *) priv;
timer_set_delay_u64(&sw->trigger_timer, TIMER_USEC * 10000);
}

View File

@@ -44,6 +44,7 @@
#include <86box/timer.h>
#include <86box/gameport.h>
#include <86box/joystick_standard.h>
#include <86box/plat_unused.h>
static void *
tm_fcs_init(void)
@@ -52,12 +53,13 @@ tm_fcs_init(void)
}
static void
tm_fcs_close(void *p)
tm_fcs_close(UNUSED(void *priv))
{
//
}
static uint8_t
tm_fcs_read(void *p)
tm_fcs_read(UNUSED(void *priv))
{
uint8_t ret = 0xf0;
@@ -76,12 +78,13 @@ tm_fcs_read(void *p)
}
static void
tm_fcs_write(void *p)
tm_fcs_write(UNUSED(void *priv))
{
//
}
static int
tm_fcs_read_axis(void *p, int axis)
tm_fcs_read_axis(UNUSED(void *priv), int axis)
{
if (!JOYSTICK_PRESENT(0))
return AXIS_NOT_PRESENT;
@@ -111,8 +114,9 @@ tm_fcs_read_axis(void *p, int axis)
}
static void
tm_fcs_a0_over(void *p)
tm_fcs_a0_over(UNUSED(void *priv))
{
//
}
const joystick_if_t joystick_tm_fcs = {