Fix several compiler warnings

This commit is contained in:
GaryOderNichts 2022-01-18 16:29:54 +01:00
parent 4cbc618674
commit 88161f53c1
3 changed files with 14 additions and 11 deletions

View File

@ -79,11 +79,14 @@ void handleAccountSelection() {
} }
accountInfoList.push_back(accountInfo); accountInfoList.push_back(accountInfo);
} }
if (accountInfoList.size() > 0) {
auto slot = handleAccountSelectScreen(accountInfoList); auto slot = handleAccountSelectScreen(accountInfoList);
DEBUG_FUNCTION_LINE("Load slot %d", slot); DEBUG_FUNCTION_LINE("Load slot %d", slot);
nn::act::LoadConsoleAccount(slot, 0, nullptr, false); nn::act::LoadConsoleAccount(slot, 0, nullptr, false);
} }
}
nn::act::Finalize(); nn::act::Finalize();
} }

View File

@ -78,7 +78,7 @@ int32_t handleMenuScreen(std::string &configPath, int32_t autobootOptionInput) {
uint32_t tvBufferSize = OSScreenGetBufferSizeEx(SCREEN_TV); uint32_t tvBufferSize = OSScreenGetBufferSizeEx(SCREEN_TV);
uint32_t drcBufferSize = OSScreenGetBufferSizeEx(SCREEN_DRC); 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(); DrawUtils::initFont();
uint32_t selected = autobootOptionInput > 0 ? autobootOptionInput : 0; uint32_t selected = autobootOptionInput > 0 ? autobootOptionInput : 0;
@ -192,7 +192,7 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector<std::shared_ptr<Acco
redraw = true; redraw = true;
} }
} else if (vpad.trigger & VPAD_BUTTON_DOWN) { } else if (vpad.trigger & VPAD_BUTTON_DOWN) {
if (selected < data.size() - 1) { if (selected < (int32_t) data.size() - 1) {
selected++; selected++;
redraw = true; redraw = true;
} }
@ -207,15 +207,15 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector<std::shared_ptr<Acco
// draw buttons // draw buttons
uint32_t index = 8 + 24 + 8 + 4; uint32_t index = 8 + 24 + 8 + 4;
int32_t start = (selected / 5) * 5; int32_t start = (selected / 5) * 5;
auto end = start + 5 < data.size() ? start + 5 : data.size(); int32_t end = (start + 5) < (int32_t) data.size() ? (start + 5) : data.size();
for (int i = start; i < end; i++) { for (int i = start; i < end; i++) {
auto &val = data[i]; auto &val = data[i];
if (val->miiImageSize > 0) { if (val->miiImageSize > 0) {
// Draw Mii // Draw Mii
auto width = 128; auto width = 128;
auto height = 128; auto height = 128;
auto target_height = 64; auto target_height = 64u;
auto target_width = 64; auto target_width = 64u;
auto xOffset = 20; auto xOffset = 20;
auto yOffset = index; auto yOffset = index;
for (uint32_t y = 0; y < target_height; y++) { for (uint32_t y = 0; y < target_height; y++) {
@ -265,7 +265,7 @@ nn::act::SlotNo handleAccountSelectScreen(const std::vector<std::shared_ptr<Acco
DrawUtils::print(SCREEN_WIDTH - 30, 68, "\uE01B", true); DrawUtils::print(SCREEN_WIDTH - 30, 68, "\uE01B", true);
} }
if (end < data.size()) { if (end < (int32_t) data.size()) {
DrawUtils::setFontSize(36); DrawUtils::setFontSize(36);
DrawUtils::print(SCREEN_WIDTH - 30, SCREEN_HEIGHT - 40, "\uE01C", true); DrawUtils::print(SCREEN_WIDTH - 30, SCREEN_HEIGHT - 40, "\uE01C", true);
} }

View File

@ -59,7 +59,7 @@ static int numberUSBStorageDevicesConnected() {
.match_params = MATCH_ANY .match_params = MATCH_ANY
}; };
int result = 0; UHSStatus result;
if ((result = UhsQueryInterfaces(handle, &filter, profiles, 10)) <= UHS_STATUS_OK) { if ((result = UhsQueryInterfaces(handle, &filter, profiles, 10)) <= UHS_STATUS_OK) {
DEBUG_FUNCTION_LINE("UhsQueryInterfaces failed"); DEBUG_FUNCTION_LINE("UhsQueryInterfaces failed");
UhsClientClose(handle); UhsClientClose(handle);
@ -70,7 +70,7 @@ static int numberUSBStorageDevicesConnected() {
} }
auto found = 0; auto found = 0;
for (int i = 0; i < result; i++) { for (int i = 0; i < (int) result; i++) {
if (profiles[i].if_desc.bInterfaceClass == USBCLASS_STORAGE) { if (profiles[i].if_desc.bInterfaceClass == USBCLASS_STORAGE) {
DEBUG_FUNCTION_LINE("Found USBCLASS_STORAGE"); DEBUG_FUNCTION_LINE("Found USBCLASS_STORAGE");
found++; found++;