From fce755127ce462cc6b4713399666cfa3a9ab5d6b Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Fri, 17 Jan 2025 20:06:25 +0100 Subject: [PATCH] Cleanups/style nits --- libretro-db/libretrodb.c | 9 +++++---- state_manager.c | 3 ++- tasks/task_save.c | 5 +++-- uwp/uwp_async.h | 3 +-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index 13bb4e8b79ab..aabe1e8c4cc7 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -238,7 +238,8 @@ static int libretrodb_find_index(libretrodb_t *db, const char *index_name, "key_size", &idx->key_size, "next", &idx->next, "count", &idx->count, - NULL) < 0) { + NULL) < 0) + { printf("Invalid index header\n"); break; } @@ -309,13 +310,13 @@ int libretrodb_find_entry(libretrodb_t *db, const char *index_name, rv = binsearch(buff, key, idx.count, (ssize_t)idx.key_size, &offset); free(buff); - if (rv == 0) { + if (rv == 0) + { filestream_seek(db->fd, (ssize_t)offset, RETRO_VFS_SEEK_POSITION_START); rmsgpack_dom_read(db->fd, out); return 0; - } else { - return -1; } + return -1; } /** diff --git a/state_manager.c b/state_manager.c index 8b16fa8bc12c..2ac5d729e812 100644 --- a/state_manager.c +++ b/state_manager.c @@ -513,7 +513,8 @@ static void state_manager_push_do(state_manager_t *state) uint8_t *compressed; const uint8_t *oldb, *newb; size_t headpos, tailpos, remaining; - if (state->capacity < sizeof(size_t) + state->maxcompsize) { + if (state->capacity < sizeof(size_t) + state->maxcompsize) + { RARCH_ERR("State capacity insufficient\n"); return; } diff --git a/tasks/task_save.c b/tasks/task_save.c index 6ee35921f13f..8419b391f9a5 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -911,10 +911,11 @@ static bool content_load_rastate1(unsigned char* input, size_t len) input += CONTENT_ALIGN_SIZE(block_size); } - if (!seen_core) { + if (!seen_core) + { RARCH_LOG("[State] no core\n"); return false; - } + } #ifdef HAVE_CHEEVOS if (!seen_cheevos) diff --git a/uwp/uwp_async.h b/uwp/uwp_async.h index f4c6b7fc0acd..f85387ea522a 100644 --- a/uwp/uwp_async.h +++ b/uwp/uwp_async.h @@ -59,9 +59,8 @@ namespace Windows::UI::Core::CoreWindow^ corewindow = Windows::UI::Core::CoreWindow::GetForCurrentThread(); while (!finished) { - if (corewindow) { + if (corewindow) corewindow->Dispatcher->ProcessEvents(Windows::UI::Core::CoreProcessEventsOption::ProcessAllIfPresent); - } } if (exception != nullptr)