(GCC12) Get rid of warning: the comparison will always evaluate as 'true' for the pointer operand in 'binds + (sizetype)((long long unsigned int)port * 4032)' must not be NULL [-Waddress]

This commit is contained in:
libretroadmin 2022-06-04 08:50:35 +02:00
parent 0fbb36c61a
commit c9149895f5
3 changed files with 7 additions and 15 deletions

View File

@ -129,7 +129,8 @@ static int16_t sdl_input_state(
unsigned idx,
unsigned id)
{
sdl_input_t *sdl = (sdl_input_t*)data;
int16_t ret = 0;
sdl_input_t *sdl = (sdl_input_t*)data;
switch (device)
{
@ -137,7 +138,6 @@ static int16_t sdl_input_state(
if (id == RETRO_DEVICE_ID_JOYPAD_MASK)
{
unsigned i;
int16_t ret = 0;
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
@ -157,13 +157,11 @@ static int16_t sdl_input_state(
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int id_minus_key = 0;
int id_plus_key = 0;
unsigned id_minus = 0;
unsigned id_plus = 0;
int16_t ret = 0;
bool id_plus_valid = false;
bool id_minus_valid = false;
@ -184,10 +182,8 @@ static int16_t sdl_input_state(
if (sdl_key_pressed(id_minus_key))
ret += -0x7fff;
}
return ret;
}
break;
return ret;
case RETRO_DEVICE_MOUSE:
case RARCH_DEVICE_MOUSE_SCREEN:
if (config_get_ptr()->uints.input_mouse_index[ port ] == 0)

View File

@ -697,6 +697,7 @@ static int16_t winraw_input_state(
unsigned idx,
unsigned id)
{
int16_t ret = 0;
settings_t *settings = NULL;
winraw_mouse_t *mouse = NULL;
winraw_input_t *wr = (winraw_input_t*)data;
@ -733,7 +734,6 @@ static int16_t winraw_input_state(
if (id == RETRO_DEVICE_ID_JOYPAD_MASK)
{
unsigned i;
int16_t ret = 0;
if (mouse)
{
@ -782,13 +782,11 @@ static int16_t winraw_input_state(
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int id_minus_key = 0;
int id_plus_key = 0;
unsigned id_minus = 0;
unsigned id_plus = 0;
int16_t ret = 0;
bool id_plus_valid = false;
bool id_minus_valid = false;
@ -809,9 +807,8 @@ static int16_t winraw_input_state(
if (WINRAW_KEYBOARD_PRESSED(wr, id_minus_key))
ret += -0x7fff;
}
return ret;
}
break;
return ret;
case RETRO_DEVICE_KEYBOARD:
return (id < RETROK_LAST) && WINRAW_KEYBOARD_PRESSED(wr, id);
case RETRO_DEVICE_MOUSE:

View File

@ -681,9 +681,8 @@ int16_t input_state_wrap(
{
int16_t ret = 0;
if(!binds || !binds[_port]) {
if (!binds)
return 0;
}
/* Do a bitwise OR to combine input states together */
@ -3536,7 +3535,7 @@ void input_keys_pressed(
unsigned i;
input_driver_state_t *input_st = &input_driver_st;
if(!binds || !binds[port])
if (!binds)
return;
if (CHECK_INPUT_DRIVER_BLOCK_HOTKEY(binds_norm, binds_auto))