Merge branch 'multiple_compile_fixes' into 'main'

fix: Multiple Compiler Warnings

See merge request citron/emulator!92
This commit is contained in:
Zephyron
2025-10-07 18:36:25 +10:00
11 changed files with 102 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -184,7 +185,7 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
CheckIfParametersMet();
});
connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) {
connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) {
player_groupboxes[i]->setChecked(state == Qt::Checked);
UpdateControllerIcon(i);
UpdateControllerState(i);

View File

@@ -998,7 +998,7 @@ void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) {
screenshot_image.bits(),
[=, this](bool invert_y) {
const std::string std_screenshot_path = screenshot_path.toStdString();
if (screenshot_image.mirrored(false, invert_y).save(screenshot_path)) {
if ((invert_y ? screenshot_image.flipped(Qt::Vertical) : screenshot_image).save(screenshot_path)) {
LOG_INFO(Frontend, "Screenshot saved to \"{}\"", std_screenshot_path);
} else {
LOG_ERROR(Frontend, "Failed to save screenshot to \"{}\"", std_screenshot_path);

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QFileDialog>
@@ -29,9 +30,9 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
connect(ui->reset_game_list_cache, &QPushButton::pressed, this,
&ConfigureFilesystem::ResetMetadata);
connect(ui->gamecard_inserted, &QCheckBox::stateChanged, this,
connect(ui->gamecard_inserted, &QCheckBox::checkStateChanged, this,
&ConfigureFilesystem::UpdateEnabledControls);
connect(ui->gamecard_current_game, &QCheckBox::stateChanged, this,
connect(ui->gamecard_current_game, &QCheckBox::checkStateChanged, this,
&ConfigureFilesystem::UpdateEnabledControls);
}

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-FileCopyrightText: 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <memory>
@@ -121,7 +122,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
&ConfigureInput::UpdateAllInputDevices);
connect(player_controllers[i], &ConfigureInputPlayer::RefreshInputProfiles, this,
&ConfigureInput::UpdateAllInputProfiles, Qt::QueuedConnection);
connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) {
connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) {
// Keep activated controllers synced with the "Connected Controllers" checkboxes
player_controllers[i]->ConnectPlayer(state == Qt::Checked);
});

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QColorDialog>
@@ -74,13 +75,13 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QW
}
}
connect(ui->mouse_enabled, &QCheckBox::stateChanged, this,
connect(ui->mouse_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->debug_enabled, &QCheckBox::stateChanged, this,
connect(ui->debug_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->touchscreen_enabled, &QCheckBox::stateChanged, this,
connect(ui->touchscreen_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->enable_ring_controller, &QCheckBox::stateChanged, this,
connect(ui->enable_ring_controller, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->debug_configure, &QPushButton::clicked, this,

View File

@@ -85,7 +85,7 @@ ConfigureSystem::ConfigureSystem(Core::System& system_,
connect(combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
connect(combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
connect(checkbox_rtc, qOverload<int>(&QCheckBox::stateChanged), this, update_rtc_date);
connect(checkbox_rtc, &QCheckBox::checkStateChanged, this, update_rtc_date);
connect(date_rtc_offset, qOverload<int>(&QSpinBox::valueChanged), this, update_rtc_date);
connect(date_rtc, &QDateTimeEdit::dateTimeChanged, this, update_date_offset);

View File

@@ -708,7 +708,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
restore_func();
}
};
connect(checkbox, &QCheckBox::stateChanged, reset);
connect(checkbox, &QCheckBox::checkStateChanged, reset);
reset(checkbox->checkState());
}
}

View File

@@ -5440,10 +5440,6 @@ static void SetHighDPIAttributes() {
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
// Enable high DPI scaling and pixmaps
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
// Set the DPI awareness for better scaling on Windows
#ifdef _WIN32
// Enable Per Monitor DPI Awareness for Windows 8.1+

View File

@@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-FileCopyrightText: 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -141,21 +142,63 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
return result;
}
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
std::string UTF16ToUTF8(std::u16string_view input) {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
return convert.to_bytes(input.data(), input.data() + input.size());
}
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
std::u16string UTF8ToUTF16(std::string_view input) {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
return convert.from_bytes(input.data(), input.data() + input.size());
}
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
std::u32string UTF8ToUTF32(std::string_view input) {
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> convert;
return convert.from_bytes(input.data(), input.data() + input.size());
}
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
#ifdef _WIN32
static std::wstring CPToUTF16(u32 code_page, std::string_view input) {
const auto size =