From 88161f53c1409b5c4919393c233375fbde3a6cee Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:29:54 +0100 Subject: [PATCH] Fix several compiler warnings --- source/BootUtils.cpp | 9 ++++++--- source/MenuUtils.cpp | 12 ++++++------ source/StorageUtils.cpp | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/source/BootUtils.cpp b/source/BootUtils.cpp index e4b6842..000b075 100644 --- a/source/BootUtils.cpp +++ b/source/BootUtils.cpp @@ -79,10 +79,13 @@ void handleAccountSelection() { } accountInfoList.push_back(accountInfo); } - auto slot = handleAccountSelectScreen(accountInfoList); - DEBUG_FUNCTION_LINE("Load slot %d", slot); - nn::act::LoadConsoleAccount(slot, 0, nullptr, false); + if (accountInfoList.size() > 0) { + auto slot = handleAccountSelectScreen(accountInfoList); + + DEBUG_FUNCTION_LINE("Load slot %d", slot); + nn::act::LoadConsoleAccount(slot, 0, nullptr, false); + } } nn::act::Finalize(); } diff --git a/source/MenuUtils.cpp b/source/MenuUtils.cpp index a59aa2e..c049a48 100644 --- a/source/MenuUtils.cpp +++ b/source/MenuUtils.cpp @@ -78,7 +78,7 @@ int32_t handleMenuScreen(std::string &configPath, int32_t autobootOptionInput) { uint32_t tvBufferSize = OSScreenGetBufferSizeEx(SCREEN_TV); uint32_t drcBufferSize = OSScreenGetBufferSizeEx(SCREEN_DRC); - DrawUtils::initBuffers(screenBuffer, tvBufferSize, screenBuffer + tvBufferSize, drcBufferSize); + DrawUtils::initBuffers(screenBuffer, tvBufferSize, (void *) ((uint32_t) screenBuffer + tvBufferSize), drcBufferSize); DrawUtils::initFont(); uint32_t selected = autobootOptionInput > 0 ? autobootOptionInput : 0; @@ -192,7 +192,7 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vectormiiImageSize > 0) { // Draw Mii auto width = 128; auto height = 128; - auto target_height = 64; - auto target_width = 64; + auto target_height = 64u; + auto target_width = 64u; auto xOffset = 20; auto yOffset = index; for (uint32_t y = 0; y < target_height; y++) { @@ -265,7 +265,7 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector