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

@@ -26,6 +26,7 @@
#include <86box/timer.h>
#include <86box/serial.h>
#include <86box/mouse.h>
#include <86box/plat_unused.h>
#define SERMOUSE_PORT 0 /* attach to Serial0 */
@@ -138,8 +139,8 @@ sermouse_transmit_period(mouse_t *dev, int bps, int rps)
case 5: /* MM Series format: 8 data, odd parity, 1 stop, 1 start */
word_len = 11;
break;
default:
case 7: /* Microsoft-compatible format: 7 data, no parity, 1 stop, 1 start */
default:
word_len = 9;
break;
}
@@ -158,7 +159,7 @@ sermouse_transmit_period(mouse_t *dev, int bps, int rps)
/* Callback from serial driver: RTS was toggled. */
static void
sermouse_callback(struct serial_s *serial, void *priv)
sermouse_callback(UNUSED(struct serial_s *serial), void *priv)
{
mouse_t *dev = (mouse_t *) priv;
@@ -332,6 +333,9 @@ sermouse_report(int x, int y, int z, int b, mouse_t *dev)
case 7:
len = sermouse_data_ms(dev, x, y, z, b);
break;
default:
break;
}
dev->data_len = len;
@@ -527,7 +531,7 @@ sermouse_command_timer(void *priv)
}
static int
sermouse_poll(int x, int y, int z, int b, double abs_x, double abs_y, void *priv)
sermouse_poll(int x, int y, int z, int b, UNUSED(double abs_x), UNUSED(double abs_y), void *priv)
{
mouse_t *dev = (mouse_t *) priv;
@@ -613,7 +617,7 @@ ltsermouse_switch_baud_rate(mouse_t *dev, int phase)
}
static void
ltsermouse_write(struct serial_s *serial, void *priv, uint8_t data)
ltsermouse_write(UNUSED(struct serial_s *serial), void *priv, uint8_t data)
{
mouse_t *dev = (mouse_t *) priv;
@@ -644,6 +648,8 @@ ltsermouse_write(struct serial_s *serial, void *priv, uint8_t data)
}
ltsermouse_switch_baud_rate(dev, PHASE_BAUD_RATE);
break;
default:
break;
}
else
switch (data) {
@@ -728,11 +734,13 @@ ltsermouse_write(struct serial_s *serial, void *priv, uint8_t data)
case 0x6B:
ltsermouse_command_phase(dev, PHASE_BUTTONS);
break;
default:
break;
}
}
static void
ltsermouse_transmit_period(serial_t *serial, void *priv, double transmit_period)
ltsermouse_transmit_period(UNUSED(serial_t *serial), void *priv, double transmit_period)
{
mouse_t *dev = (mouse_t *) priv;
@@ -796,8 +804,8 @@ sermouse_init(const device_t *info)
dev->id_len = 1;
dev->id[0] = 'M';
switch (dev->but) {
case 2:
default:
case 2:
dev->type = info->local ? MOUSE_TYPE_LOGITECH : MOUSE_TYPE_MICROSOFT;
break;
case 3:
@@ -846,7 +854,7 @@ sermouse_init(const device_t *info)
mouse_set_buttons((dev->flags & FLAG_3BTN) ? 3 : 2);
/* Return our private data to the I/O layer. */
return (dev);
return dev;
}
static const device_config_t mssermouse_config[] = {