From 1cd1ecfc5c26fd8a3573cdb8f1c0063db091f1a2 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Thu, 19 Nov 2015 13:43:48 +0100 Subject: [PATCH] More C89_BUILD buildfixes --- libretro-db/query.c | 32 ++++++++++++++++++++------------ tasks/task_database.c | 13 +++++++++---- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/libretro-db/query.c b/libretro-db/query.c index f029d87e9f..8a9b0addc0 100644 --- a/libretro-db/query.c +++ b/libretro-db/query.c @@ -151,28 +151,34 @@ static void raise_unknown_function(ssize_t where, const char *name, } static void raise_expected_eof(ssize_t where, char found, const char **error) { - snprintf(tmp_error_buff, MAX_ERROR_LEN, #ifdef _WIN32 + snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected EOF found '%c'", -#else - "%llu::Expected EOF found '%c'", -#endif (unsigned long long)where, found ); +#else + snprintf(tmp_error_buff, MAX_ERROR_LEN, + "%llu::Expected EOF found '%c'", + (unsigned long long)where, + found + ); +#endif *error = tmp_error_buff; } static void raise_unexpected_char(ssize_t where, char expected, char found, const char **error) { - snprintf(tmp_error_buff, MAX_ERROR_LEN, #ifdef _WIN32 + snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected '%c' found '%c'", -#else - "%llu::Expected '%c' found '%c'", -#endif (unsigned long long)where, expected, found); +#else + snprintf(tmp_error_buff, MAX_ERROR_LEN, + "%llu::Expected '%c' found '%c'", + (unsigned long long)where, expected, found); +#endif *error = tmp_error_buff; } @@ -577,13 +583,15 @@ static struct buffer parse_integer(struct buffer buff, { value->type = RDT_INT; - if (sscanf(buff.data + buff.offset, #ifdef _WIN32 + if (sscanf(buff.data + buff.offset, "%I64d", -#else - "%lld", -#endif (signed long long*)&value->val.int_) == 0) +#else + if (sscanf(buff.data + buff.offset, + "%lld", + (signed long long*)&value->val.int_) == 0) +#endif raise_expected_number(buff.offset, error); else { diff --git a/tasks/task_database.c b/tasks/task_database.c index d3ffdf64a3..3673ca5c93 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -100,16 +100,21 @@ static int database_info_iterate_start { char msg[PATH_MAX_LENGTH] = {0}; - snprintf(msg, sizeof(msg), #ifdef _WIN32 + snprintf(msg, sizeof(msg), "%Iu/%Iu: %s %s...\n", -#else - "%zu/%zu: %s %s...\n", -#endif db->list_ptr, db->list->size, msg_hash_to_str(MSG_SCANNING), name); +#else + snprintf(msg, sizeof(msg), + "%zu/%zu: %s %s...\n", + db->list_ptr, + db->list->size, + msg_hash_to_str(MSG_SCANNING), + name); +#endif if (msg[0] != '\0') rarch_main_msg_queue_push(msg, 1, 180, true);