Some code smell fixes from sonarlint

This commit is contained in:
Jasmine Iwanek
2023-05-11 03:02:36 -04:00
parent d314255362
commit 6c1e4a8e2c
137 changed files with 3354 additions and 2900 deletions

View File

@@ -443,12 +443,12 @@ joystick_get_axis(int joystick_nr, int mapping)
void
joystick_process(void)
{
int c, d;
int d;
if (joystick_type == 7)
return;
for (c = 0; c < joystick_get_max_joysticks(joystick_type); c++) {
for (int c = 0; c < joystick_get_max_joysticks(joystick_type); c++) {
if (joystick_state[c].plat_joystick_nr) {
int joystick_nr = joystick_state[c].plat_joystick_nr - 1;
@@ -458,8 +458,10 @@ joystick_process(void)
joystick_state[c].button[d] = plat_joystick_state[joystick_nr].b[joystick_state[c].button_mapping[d]];
for (d = 0; d < joystick_get_pov_count(joystick_type); d++) {
int x, y;
double angle, magnitude;
int x;
int y;
double angle;
double magnitude;
x = joystick_get_axis(joystick_nr, joystick_state[c].pov_mapping[d][0]);
y = joystick_get_axis(joystick_nr, joystick_state[c].pov_mapping[d][1]);

View File

@@ -111,9 +111,9 @@ plat_serpt_set_params(void *p)
} else {
serialattr.fParity = 1;
if (dev->serial->lcr & 0x20) {
serialattr.Parity = (MARKPARITY) + !!(dev->serial->lcr & 0x10);
serialattr.Parity = MARKPARITY + !!(dev->serial->lcr & 0x10);
} else {
serialattr.Parity = (ODDPARITY) + !!(dev->serial->lcr & 0x10);
serialattr.Parity = ODDPARITY + !!(dev->serial->lcr & 0x10);
}
}