(cheevos.c) Cleanups

This commit is contained in:
twinaphex 2016-07-11 14:56:23 +02:00
parent ecb69ad938
commit 3db30a9440
1 changed files with 10 additions and 13 deletions

View File

@ -838,10 +838,10 @@ static INLINE const char *cheevos_dupstr(const cheevos_field_t *field)
static int cheevos_new_cheevo(cheevos_readud_t *ud) static int cheevos_new_cheevo(cheevos_readud_t *ud)
{ {
const cheevos_condset_t *end;
unsigned set; unsigned set;
cheevos_condset_t *condset; const cheevos_condset_t *end = NULL;
cheevo_t *cheevo; cheevos_condset_t *condset = NULL;
cheevo_t *cheevo = NULL;
int flags = strtol(ud->flags.string, NULL, 10); int flags = strtol(ud->flags.string, NULL, 10);
if (flags == 3) if (flags == 3)
@ -878,7 +878,8 @@ static int cheevos_new_cheevo(cheevos_readud_t *ud)
if (!cheevo->condsets) if (!cheevo->condsets)
return -1; return -1;
memset((void*)cheevo->condsets, 0, cheevo->count * sizeof(cheevos_condset_t)); memset((void*)cheevo->condsets, 0,
cheevo->count * sizeof(cheevos_condset_t));
end = cheevo->condsets + cheevo->count; end = cheevo->condsets + cheevo->count;
set = 0; set = 0;
@ -1419,10 +1420,8 @@ static int cheevos_login(retro_time_t *timeout)
free((void*)json); free((void*)json);
if (!res) if (!res)
{
return 0; return 0;
} }
}
runloop_msg_queue_push("Retro Achievements login error", runloop_msg_queue_push("Retro Achievements login error",
0, 5 * 60, false); 0, 5 * 60, false);
@ -2198,13 +2197,11 @@ void cheevos_populate_menu(void *data)
#ifdef HAVE_MENU #ifdef HAVE_MENU
unsigned i; unsigned i;
unsigned items_found = 0; unsigned items_found = 0;
const cheevo_t *end = NULL;
cheevo_t *cheevo = NULL;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data; menu_displaylist_info_t *info = (menu_displaylist_info_t*)data;
cheevo_t *cheevo = cheevos_locals.core.cheevos;
cheevo = cheevos_locals.core.cheevos; const cheevo_t *end = cheevos_locals.core.cheevos +
end = cheevos_locals.core.cheevos + cheevos_locals.core.count; cheevos_locals.core.count;
for (i = 0; cheevo < end; i++, cheevo++) for (i = 0; cheevo < end; i++, cheevo++)
{ {