From f25d7f6e093c7751f969b71162d09cfe8fa05bfc Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 3 Oct 2022 23:20:03 +1000 Subject: [PATCH] Misc: Fix various warnings --- src/core/system.cpp | 2 +- src/duckstation-qt/generalsettingswidget.cpp | 2 +- src/duckstation-qt/postprocessingshaderconfigwidget.cpp | 4 ++-- src/frontend-common/fullscreen_ui.cpp | 9 +-------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index cbd83bbf5..b63886e46 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2288,7 +2288,7 @@ void System::UpdateDisplaySync() const bool video_sync_enabled = ShouldUseVSync(); const bool syncing_to_host_vsync = (s_syncing_to_host && video_sync_enabled && s_display_all_frames); const float max_display_fps = (s_throttler_enabled || s_syncing_to_host) ? 0.0f : g_settings.display_max_fps; - Log_VerbosePrintf("Using vsync: %s", video_sync_enabled ? "YES" : "NO", + Log_VerbosePrintf("Using vsync: %s%s", video_sync_enabled ? "YES" : "NO", syncing_to_host_vsync ? " (for throttling)" : ""); Log_VerbosePrintf("Max display fps: %f (%s)", max_display_fps, s_display_all_frames ? "displaying all frames" : "skipping displaying frames when needed"); diff --git a/src/duckstation-qt/generalsettingswidget.cpp b/src/duckstation-qt/generalsettingswidget.cpp index a42867225..3e7d275a6 100644 --- a/src/duckstation-qt/generalsettingswidget.cpp +++ b/src/duckstation-qt/generalsettingswidget.cpp @@ -105,7 +105,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(SettingsDialog* dialog, QWidget* pa AutoUpdaterDialog::getDefaultTag()); m_ui.autoUpdateCurrentVersion->setText(tr("%1 (%2)").arg(g_scm_tag_str).arg(g_scm_date_str)); - connect(m_ui.checkForUpdates, &QPushButton::clicked, [this]() { g_main_window->checkForUpdates(true); }); + connect(m_ui.checkForUpdates, &QPushButton::clicked, []() { g_main_window->checkForUpdates(true); }); } else { diff --git a/src/duckstation-qt/postprocessingshaderconfigwidget.cpp b/src/duckstation-qt/postprocessingshaderconfigwidget.cpp index c71b41d0a..b64d7f5d8 100644 --- a/src/duckstation-qt/postprocessingshaderconfigwidget.cpp +++ b/src/duckstation-qt/postprocessingshaderconfigwidget.cpp @@ -76,7 +76,7 @@ void PostProcessingShaderConfigWidget::createUi() slider->setSingleStep(1); slider->setTickInterval(step_value); slider->setValue((option.value[i].int_value - option.min_value[i].int_value) / step_value); - connect(slider, &QSlider::valueChanged, [this, &option, i, slider_label, step_value](int value) { + connect(slider, &QSlider::valueChanged, [this, &option, i, slider_label](int value) { const int new_value = std::clamp(option.min_value[i].int_value + (value * option.step_value[i].int_value), option.min_value[i].int_value, option.max_value[i].int_value); option.value[i].int_value = new_value; @@ -105,7 +105,7 @@ void PostProcessingShaderConfigWidget::createUi() slider->setTickInterval(step_value); slider->setValue( static_cast((option.value[i].float_value - option.min_value[i].float_value) / step_value)); - connect(slider, &QSlider::valueChanged, [this, &option, i, slider_label, step_value](int value) { + connect(slider, &QSlider::valueChanged, [this, &option, i, slider_label](int value) { const float new_value = std::clamp(option.min_value[i].float_value + (static_cast(value) * option.step_value[i].float_value), option.min_value[i].float_value, option.max_value[i].float_value); diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index 6372e1d6c..41a37ac36 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -44,8 +44,6 @@ Log_SetChannel(FullscreenUI); #ifdef WITH_CHEEVOS #include "achievements.h" #endif -static constexpr float LAYOUT_MAIN_MENU_BAR_SIZE = 20.0f; // Should be DPI scaled, not layout scaled! -static constexpr s32 MAX_SAVE_STATE_SLOTS = 10; using ImGuiFullscreen::g_large_font; using ImGuiFullscreen::g_layout_padding_left; @@ -252,7 +250,6 @@ static void DoToggleAnalogMode(); ////////////////////////////////////////////////////////////////////////// static constexpr double INPUT_BINDING_TIMEOUT_SECONDS = 5.0; -static constexpr u32 NUM_MEMORY_CARD_PORTS = 2; static void SwitchToSettings(); static void SwitchToGameSettings(); @@ -1154,7 +1151,7 @@ void FullscreenUI::DrawLandingWindow() ImGui::SetCursorPos(ImVec2(ImGui::GetWindowWidth() - rev_size.x - LayoutScale(20.0f), ImGui::GetWindowHeight() - rev_size.y - LayoutScale(20.0f))); ImGui::PushFont(g_medium_font); - ImGui::Text(g_scm_tag_str); + ImGui::TextUnformatted(g_scm_tag_str); ImGui::PopFont(); } @@ -4344,9 +4341,6 @@ void FullscreenUI::DrawResumeStateSelector() bool is_open = true; if (ImGui::BeginPopupModal("Load Resume State", &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize)) { - static constexpr float max_image_width = 96.0f; - static constexpr float max_image_height = 96.0f; - const SaveStateListEntry& entry = s_save_state_selector_slots.front(); ImGui::TextWrapped("A resume save state created at %s was found.\n\nDo you want to load this save and continue?", TimeToPrintableString(entry.timestamp).c_str()); @@ -5794,7 +5788,6 @@ void FullscreenUI::DrawLeaderboardsWindow() float right = bb.Max.x - padding; float top = bb.Min.y + padding; SmallString text; - ImVec2 text_size; const u32 leaderboard_count = Achievements::GetLeaderboardCount();