From ed274c8a7ea037b70dac57c5867597c5bf5b7db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 24 Jan 2026 00:28:54 +0100 Subject: [PATCH] Just some lint fixing --- Common/Data/Format/IniFile.cpp | 14 +++++++------- Common/GPU/Vulkan/VulkanDebug.cpp | 2 ++ UI/EmuScreen.cpp | 2 +- android/jni/app-android.cpp | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Common/Data/Format/IniFile.cpp b/Common/Data/Format/IniFile.cpp index 3189645ddf..57a54e7a40 100644 --- a/Common/Data/Format/IniFile.cpp +++ b/Common/Data/Format/IniFile.cpp @@ -30,11 +30,11 @@ // This unescapes # signs. // NOTE: These parse functions can make better use of the string_view - the pos argument should not be needed, for example. static bool ParseLineKey(std::string_view line, size_t &pos, std::string *keyOut) { - std::string key = ""; + std::string key; while (pos < line.size()) { size_t next = line.find_first_of("=#", pos); - if (next == line.npos || next == 0) { + if (next == std::string::npos || next == 0) { // Key never ended or empty, invalid. return false; } else if (line[next] == '#') { @@ -68,14 +68,14 @@ static bool ParseLineValue(std::string_view line, size_t &pos, std::string *valu if (strippedLine.size() >= 2 && strippedLine[0] == '"' && strippedLine[strippedLine.size() - 1] == '"') { // Don't remove comment if is surrounded by " " value += line.substr(pos); - pos = line.npos; // Won't enter the while below + pos = std::string_view::npos; // Won't enter the while below } while (pos < line.size()) { size_t next = line.find('#', pos); - if (next == line.npos) { + if (next == std::string_view::npos) { value += line.substr(pos); - pos = line.npos; + pos = std::string_view::npos; break; } else if (line[next - 1] != '\\') { // It wasn't escaped, so finish before the #. @@ -148,9 +148,9 @@ static std::string EscapeHash(std::string_view value) { for (size_t pos = 0; pos < value.size(); ) { size_t next = value.find('#', pos); - if (next == value.npos) { + if (next == std::string_view::npos) { result += value.substr(pos); - pos = value.npos; + pos = std::string_view::npos; } else { result += value.substr(pos, next - pos); result += "\\#"; diff --git a/Common/GPU/Vulkan/VulkanDebug.cpp b/Common/GPU/Vulkan/VulkanDebug.cpp index 35176f9cc7..8867ff0162 100644 --- a/Common/GPU/Vulkan/VulkanDebug.cpp +++ b/Common/GPU/Vulkan/VulkanDebug.cpp @@ -148,6 +148,8 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( OutputDebugStringA(msg.c_str()); if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { if (options->breakOnError && System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { + // If you hit this, you have a vulkan validation error. + // Check the console or the Output window in Visual Studio, if you're using that. DebugBreak(); } if (options->msgBoxOnError) { diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 58d5148e24..b294842044 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1469,7 +1469,7 @@ void EmuScreen::update() { UpdateUIState(coreState != CORE_RUNTIME_ERROR ? UISTATE_INGAME : UISTATE_EXCEPTION); } - if (errorMessage_.size()) { + if (!errorMessage_.empty()) { auto err = GetI18NCategory(I18NCat::ERRORS); auto di = GetI18NCategory(I18NCat::DIALOG); std::string errLoadingFile = GetFriendlyPath(gamePath_) + "\n\n"; diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index c826a2b6d8..84daae7224 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -1197,7 +1197,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendRequestResult(JNIEn std::string value = jvalue ? GetJavaString(env, jvalue) : "(no value)"; INFO_LOG(Log::System, "Received result of request %d from Java: %d: %d '%s'", jrequestID, (int)result, jintValue, value.c_str()); if (result) { - g_requestManager.PostSystemSuccess(jrequestID, value.c_str(), jintValue); + g_requestManager.PostSystemSuccess(jrequestID, value, jintValue); } else { g_requestManager.PostSystemFailure(jrequestID, jintValue); }