diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 3fbb94b1f3..eecf9f23ab 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -1398,7 +1398,7 @@ std::optional QtHost::DownloadFile(QWidget* parent, const QString& title, QtModalProgressCallback progress(parent); progress.GetDialog().setLabelText( qApp->translate("EmuThread", "Downloading %1...").arg(QtUtils::StringViewToQString( - std::string_view(url).substr((url_file_part_pos >= 0) ? (url_file_part_pos + 1) : 0)))); + std::string_view(url).substr((url_file_part_pos != std::string::npos) ? (url_file_part_pos + 1) : 0)))); progress.GetDialog().setWindowTitle(title); progress.GetDialog().setWindowIcon(GetAppIcon()); progress.SetCancellable(true); diff --git a/pcsx2/GS/GSCapture.cpp b/pcsx2/GS/GSCapture.cpp index f0c7c178e1..73c4e9cc34 100644 --- a/pcsx2/GS/GSCapture.cpp +++ b/pcsx2/GS/GSCapture.cpp @@ -25,11 +25,13 @@ #include #include +// We're using deprecated fields because we're targeting multiple ffmpeg versions. #if defined(_MSC_VER) #pragma warning(disable:4996) // warning C4996: 'AVCodecContext::channels': was declared deprecated #elif defined (__clang__) -// We're using deprecated fields because we're targeting multiple ffmpeg versions. #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#elif defined (__GNUC__) +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif extern "C" { @@ -1359,7 +1361,7 @@ std::string GSCapture::GetNextCaptureFileName() // Should end with a number. int partnum = 2; std::string_view::size_type pos = name.rfind("_part"); - if (pos >= 0) + if (pos != std::string_view::npos) { std::string_view::size_type cpos = pos + 5; for (; cpos < name.length(); cpos++)