mirror of
https://github.com/libretro/RetroArch
synced 2025-02-27 18:41:01 +00:00
Fix logically dead code warnings
This commit is contained in:
parent
69759f5fd7
commit
974d3245d2
2
driver.c
2
driver.c
@ -139,8 +139,6 @@ static int driver_find_index(const char * label, const char *drv)
|
||||
for (i = 0; (obj = (const void*)
|
||||
find_driver_nonempty(label, i, str, sizeof(str))) != NULL; i++)
|
||||
{
|
||||
if (!obj)
|
||||
return -1;
|
||||
if (string_is_empty(str))
|
||||
break;
|
||||
if (string_is_equal_noncase(drv, str))
|
||||
|
@ -54,12 +54,9 @@ joypad_connection_t *pad_connection_init(unsigned pads)
|
||||
{
|
||||
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
||||
|
||||
if (!conn)
|
||||
continue;
|
||||
|
||||
conn->connected = false;
|
||||
conn->iface = NULL;
|
||||
conn->data = NULL;
|
||||
conn->connected = false;
|
||||
conn->iface = NULL;
|
||||
conn->data = NULL;
|
||||
}
|
||||
|
||||
return joyconn;
|
||||
|
@ -87,8 +87,6 @@ static bool linuxraw_is_pressed(linuxraw_input_t *linuxraw,
|
||||
|
||||
if (id >= RARCH_BIND_LIST_END)
|
||||
return false;
|
||||
if (!bind)
|
||||
return false;
|
||||
|
||||
return bind->valid && linuxraw_key_pressed(linuxraw, binds[id].key);
|
||||
}
|
||||
|
@ -327,16 +327,12 @@ static void parport_joypad_destroy(void)
|
||||
static bool parport_joypad_button(unsigned port, uint16_t joykey)
|
||||
{
|
||||
const struct parport_joypad *pad = (const struct parport_joypad*)&parport_pads[port];
|
||||
if (!pad)
|
||||
return false;
|
||||
return joykey < PARPORT_NUM_BUTTONS && BIT64_GET(pad->buttons, joykey);
|
||||
}
|
||||
|
||||
static uint64_t parport_joypad_get_buttons(unsigned port)
|
||||
{
|
||||
const struct parport_joypad *pad = (const struct parport_joypad*)&parport_pads[port];
|
||||
if (!pad)
|
||||
return false;
|
||||
return pad->buttons;
|
||||
}
|
||||
|
||||
|
@ -136,11 +136,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
|
||||
|
||||
static const void *input_config_bind_map_get(unsigned i)
|
||||
{
|
||||
const struct input_bind_map *keybind =
|
||||
(const struct input_bind_map*)&input_config_bind_map[i];
|
||||
if (!keybind)
|
||||
return NULL;
|
||||
return keybind;
|
||||
return (const struct input_bind_map*)&input_config_bind_map[i];
|
||||
}
|
||||
|
||||
bool input_config_bind_map_get_valid(unsigned i)
|
||||
|
@ -754,9 +754,6 @@ void input_state_overlay(int16_t *ret, unsigned port, unsigned device, unsigned
|
||||
{
|
||||
input_overlay_state_t *ol_state = &overlay_st_ptr;
|
||||
|
||||
if (!ol_state)
|
||||
return;
|
||||
|
||||
if (port != 0)
|
||||
return;
|
||||
|
||||
|
@ -56,9 +56,6 @@ void net_ifinfo_free(net_ifinfo_t *list)
|
||||
struct net_ifinfo_entry *ptr =
|
||||
(struct net_ifinfo_entry*)&list->entries[k];
|
||||
|
||||
if (!ptr)
|
||||
continue;
|
||||
|
||||
if (*ptr->name)
|
||||
free(ptr->name);
|
||||
if (*ptr->host)
|
||||
|
@ -260,9 +260,8 @@ struct string_list *string_list_new_special(enum string_list_type type,
|
||||
|
||||
for (i = 0; i < *list_size; i++)
|
||||
{
|
||||
const char *opt = NULL;
|
||||
const core_info_t *info = (const core_info_t*)&core_info[i];
|
||||
opt = info ? info->display_name : NULL;
|
||||
const char *opt = info->display_name;
|
||||
|
||||
if (!opt)
|
||||
goto error;
|
||||
|
@ -55,9 +55,6 @@ static bool core_option_manager_parse_variable(core_option_manager_t *opt, size_
|
||||
char *config_val = NULL;
|
||||
struct core_option *option = (struct core_option*)&opt->opts[idx];
|
||||
|
||||
if (!option)
|
||||
return false;
|
||||
|
||||
option->key = strdup(var->key);
|
||||
value = strdup(var->value);
|
||||
desc_end = strstr(value, "; ");
|
||||
@ -327,8 +324,6 @@ const char *core_option_manager_get_val(core_option_manager_t *opt, size_t idx)
|
||||
if (!opt)
|
||||
return NULL;
|
||||
option = (struct core_option*)&opt->opts[idx];
|
||||
if (!option)
|
||||
return NULL;
|
||||
return option->vals->elems[option->index].data;
|
||||
}
|
||||
|
||||
|
@ -3387,9 +3387,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
menu_displaylist_ctx_parse_entry_t *entry =
|
||||
(menu_displaylist_ctx_parse_entry_t*)data;
|
||||
|
||||
if (!entry)
|
||||
goto error;
|
||||
|
||||
if (menu_displaylist_parse_settings(entry->data,
|
||||
entry->info,
|
||||
entry->info_label,
|
||||
|
@ -328,7 +328,5 @@ bool rarch_task_push_decompress(
|
||||
error:
|
||||
if (s)
|
||||
free(s);
|
||||
if (t)
|
||||
free(t);
|
||||
return false;
|
||||
}
|
||||
|
@ -296,8 +296,6 @@ void *rarch_task_push_http_transfer(const char *url, const char *type,
|
||||
error:
|
||||
if (conn)
|
||||
net_http_connection_free(conn);
|
||||
if (t)
|
||||
free(t);
|
||||
if (http)
|
||||
free(http);
|
||||
|
||||
|
@ -392,8 +392,6 @@ bool rarch_task_push_image_load(const char *fullpath,
|
||||
|
||||
error:
|
||||
rarch_task_image_load_free(t);
|
||||
if (t)
|
||||
free(t);
|
||||
nbio_free(handle);
|
||||
if (nbio)
|
||||
free(nbio);
|
||||
|
@ -412,9 +412,6 @@ static void rarch_task_overlay_deferred_load(overlay_loader_t *loader)
|
||||
|
||||
overlay = &loader->overlays[loader->pos];
|
||||
|
||||
if (!overlay)
|
||||
continue;
|
||||
|
||||
snprintf(overlay->config.descs.key,
|
||||
sizeof(overlay->config.descs.key), "overlay%u_descs", loader->pos);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user