From cc8e8972224f77f560b00a76f9d34cd412d5b597 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 22 Sep 2017 05:12:26 +0200 Subject: [PATCH] C89_BUILD fixes --- libretro-common/include/streams/chd_stream.h | 6 +++--- tasks/task_database.c | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libretro-common/include/streams/chd_stream.h b/libretro-common/include/streams/chd_stream.h index 9abece73e3..2f51cae162 100644 --- a/libretro-common/include/streams/chd_stream.h +++ b/libretro-common/include/streams/chd_stream.h @@ -32,11 +32,11 @@ RETRO_BEGIN_DECLS typedef struct chdstream chdstream_t; -// First data track +/* First data track */ #define CHDSTREAM_TRACK_FIRST_DATA (-1) -// Last track +/* Last track */ #define CHDSTREAM_TRACK_LAST (-2) -// Primary (largest) data track, used for CRC identification purposes +/* Primary (largest) data track, used for CRC identification purposes */ #define CHDSTREAM_TRACK_PRIMARY (-3) chdstream_t *chdstream_open(const char *path, int32_t track); diff --git a/tasks/task_database.c b/tasks/task_database.c index dfc8eab337..f485d33d38 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -1137,18 +1137,22 @@ static void task_database_handler(retro_task_t *task) * save time by only processing that database. */ if (dbstate->list && db->is_directory) { + size_t i; char *dirname = find_last_slash(db->fullpath) + 1; - for (size_t i = 0; i < dbstate->list->size; i++) + for (i = 0; i < dbstate->list->size; i++) { + char *dbname; char *dbpath = strdup(dbstate->list->elems[i].data); path_remove_extension(dbpath); - char *dbname = find_last_slash(dbpath) + 1; + + dbname = find_last_slash(dbpath) + 1; if (strcasecmp(dbname, dirname) == 0) { + struct string_list *single_list = NULL; free(dbpath); - struct string_list *single_list = string_list_new(); + single_list = string_list_new(); string_list_append(single_list, dbstate->list->elems[i].data, dbstate->list->elems[i].attr); dir_list_free(dbstate->list);