From e68aeedc3d20ad33426810d317931434f2fefd07 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Wed, 22 Jul 2020 21:41:10 -0300 Subject: [PATCH 01/13] resolve warnings of deprecated Qt members --- src/citra_qt/debugger/ipc/recorder.cpp | 3 ++- src/citra_qt/updater/updater.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/debugger/ipc/recorder.cpp b/src/citra_qt/debugger/ipc/recorder.cpp index ef634d750..4226e74fe 100644 --- a/src/citra_qt/debugger/ipc/recorder.cpp +++ b/src/citra_qt/debugger/ipc/recorder.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include @@ -90,7 +91,7 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) { auto* item = ui->main->invisibleRootItem()->child(row_id); for (int column = 0; column < item->columnCount(); ++column) { - item->setBackgroundColor(column, QColor::fromRgb(255, 0, 0)); + item->setBackground(column, QBrush(QColor::fromRgb(255, 0, 0))); } } diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index 8701eee7b..cafffd2b0 100644 --- a/src/citra_qt/updater/updater.cpp +++ b/src/citra_qt/updater/updater.cpp @@ -133,7 +133,7 @@ bool UpdaterPrivate::StartUpdateCheck() { connect(main_process, static_cast(&QProcess::finished), this, &UpdaterPrivate::UpdaterReady, Qt::QueuedConnection); - connect(main_process, static_cast(&QProcess::error), + connect(main_process, static_cast(&QProcess::errorOccurred), this, &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); main_process->start(QIODevice::ReadOnly); From 2696add2fd13998cec97c28bfef739d31dab7de1 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Wed, 22 Jul 2020 22:48:50 -0300 Subject: [PATCH 02/13] remove unnecessary headers --- src/citra_qt/bootmanager.cpp | 3 --- src/citra_qt/bootmanager.h | 1 - src/citra_qt/loading_screen.cpp | 7 +------ src/citra_qt/loading_screen.h | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 18f7e8ea6..3fdc12344 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -10,9 +10,6 @@ #include #include #include -#include -#include -#include #include #include "citra_qt/bootmanager.h" #include "citra_qt/main.h" diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 3dec9751b..030ffbd2a 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -15,7 +15,6 @@ #include "core/frontend/emu_window.h" class QKeyEvent; -class QScreen; class QTouchEvent; class QOffscreenSurface; class QOpenGLContext; diff --git a/src/citra_qt/loading_screen.cpp b/src/citra_qt/loading_screen.cpp index dff964174..7b9537ac9 100644 --- a/src/citra_qt/loading_screen.cpp +++ b/src/citra_qt/loading_screen.cpp @@ -3,21 +3,16 @@ // Refer to the license.txt file included. #include -#include -#include #include -#include -#include #include #include #include -#include #include #include #include +#include #include #include -#include #include "citra_qt/loading_screen.h" #include "common/logging/log.h" #include "core/loader/loader.h" diff --git a/src/citra_qt/loading_screen.h b/src/citra_qt/loading_screen.h index 59e841f9d..fb18f2be9 100644 --- a/src/citra_qt/loading_screen.h +++ b/src/citra_qt/loading_screen.h @@ -6,7 +6,6 @@ #include #include -#include #include namespace Loader { From 1df939469adb24d7f6eebe1d5ffb9830618d9b6d Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Wed, 22 Jul 2020 22:49:58 -0300 Subject: [PATCH 03/13] Resolve some type conversion warnings --- src/core/cheats/cheats.cpp | 2 +- src/core/cheats/cheats.h | 2 +- src/core/file_sys/patch.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/cheats/cheats.cpp b/src/core/cheats/cheats.cpp index f4b48fd06..37700bb2c 100644 --- a/src/core/cheats/cheats.cpp +++ b/src/core/cheats/cheats.cpp @@ -102,7 +102,7 @@ void CheatEngine::LoadCheatFile() { } } -void CheatEngine::RunCallback([[maybe_unused]] u64 userdata, int cycles_late) { +void CheatEngine::RunCallback([[maybe_unused]] u64 userdata, s64 cycles_late) { { std::shared_lock lock(cheats_list_mutex); for (auto& cheat : cheats_list) { diff --git a/src/core/cheats/cheats.h b/src/core/cheats/cheats.h index 1dfed7ab8..c45c1044f 100644 --- a/src/core/cheats/cheats.h +++ b/src/core/cheats/cheats.h @@ -35,7 +35,7 @@ public: private: void LoadCheatFile(); - void RunCallback(u64 userdata, int cycles_late); + void RunCallback(u64 userdata, s64 cycles_late); std::vector> cheats_list; mutable std::shared_mutex cheats_list_mutex; Core::TimingEventType* event; diff --git a/src/core/file_sys/patch.cpp b/src/core/file_sys/patch.cpp index c93767165..f4fb05ac2 100644 --- a/src/core/file_sys/patch.cpp +++ b/src/core/file_sys/patch.cpp @@ -15,8 +15,8 @@ namespace FileSys::Patch { bool ApplyIpsPatch(const std::vector& ips, std::vector& buffer) { - u32 cursor = 5; - u32 patch_length = ips.size() - 3; + std::size_t cursor = 5; + std::size_t patch_length = ips.size() - 3; std::string ips_header(ips.begin(), ips.begin() + 5); if (ips_header != "PATCH") { @@ -30,7 +30,7 @@ bool ApplyIpsPatch(const std::vector& ips, std::vector& buffer) { if (eof_check == "EOF") return false; - u32 offset = ips[cursor] << 16 | ips[cursor + 1] << 8 | ips[cursor + 2]; + std::size_t offset = ips[cursor] << 16 | ips[cursor + 1] << 8 | ips[cursor + 2]; std::size_t length = ips[cursor + 3] << 8 | ips[cursor + 4]; // check for an rle record From e331fac0043bdc28775f134928373797b0b09e58 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Wed, 22 Jul 2020 22:51:39 -0300 Subject: [PATCH 04/13] Resolve unused variable warnings (C4101 unreferenced local variable) --- src/core/cheats/gateway_cheat.cpp | 2 +- src/web_service/announce_room_json.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/cheats/gateway_cheat.cpp b/src/core/cheats/gateway_cheat.cpp index b36309d26..f5b5ff0b4 100644 --- a/src/core/cheats/gateway_cheat.cpp +++ b/src/core/cheats/gateway_cheat.cpp @@ -198,7 +198,7 @@ GatewayCheat::CheatLine::CheatLine(const std::string& line) { address = first & 0x0FFFFFFF; value = std::stoul(line.substr(9, 8), 0, 16); cheat_line = line; - } catch (const std::logic_error& e) { + } catch (const std::logic_error&) { type = CheatType::Null; cheat_line = line; LOG_ERROR(Core_Cheats, "Cheat contains invalid line: {}", line); diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 44d0b0578..e64bd7ea4 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp @@ -30,7 +30,7 @@ void from_json(const nlohmann::json& json, Room::Member& member) { try { member.username = json.at("username").get(); member.avatar_url = json.at("avatarUrl").get(); - } catch (const nlohmann::detail::out_of_range& e) { + } catch (const nlohmann::detail::out_of_range&) { member.username = member.avatar_url = ""; LOG_DEBUG(Network, "Member \'{}\' isn't authenticated", member.nickname); } @@ -59,7 +59,7 @@ void from_json(const nlohmann::json& json, Room& room) { room.name = json.at("name").get(); try { room.description = json.at("description").get(); - } catch (const nlohmann::detail::out_of_range& e) { + } catch (const nlohmann::detail::out_of_range&) { room.description = ""; LOG_DEBUG(Network, "Room \'{}\' doesn't contain a description", room.name); } From d87fee05a9e18b04688006291021e03f3c8eb6eb Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 00:34:43 -0300 Subject: [PATCH 05/13] Resolve some variable hiding warnings (C4456: variable hides previous local declaration) --- src/citra_qt/camera/camera_util.cpp | 6 +++--- src/citra_qt/debugger/ipc/recorder.cpp | 6 +++--- src/citra_qt/debugger/wait_tree.cpp | 6 +++--- src/citra_qt/main.cpp | 1 - src/citra_qt/multiplayer/state.cpp | 5 ++--- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/citra_qt/camera/camera_util.cpp b/src/citra_qt/camera/camera_util.cpp index 8e67ca452..878ac910c 100644 --- a/src/citra_qt/camera/camera_util.cpp +++ b/src/citra_qt/camera/camera_util.cpp @@ -175,9 +175,9 @@ std::vector Rgb2Yuv(const QImage& source, int width, int height) { auto dest = buffer.begin(); bool write = false; int py, pu, pv; - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - QRgb rgb = source.pixel(x, y); + for (int j = 0; j < height; ++j) { + for (int i = 0; i < width; ++i) { + QRgb rgb = source.pixel(i, j); int r = qRed(rgb); int g = qGreen(rgb); int b = qBlue(rgb); diff --git a/src/citra_qt/debugger/ipc/recorder.cpp b/src/citra_qt/debugger/ipc/recorder.cpp index 4226e74fe..b4ed84ad0 100644 --- a/src/citra_qt/debugger/ipc/recorder.cpp +++ b/src/citra_qt/debugger/ipc/recorder.cpp @@ -73,16 +73,16 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) { service = QStringLiteral("%1 (%2)").arg(service, record.is_hle ? tr("HLE") : tr("LLE")); } - QTreeWidgetItem item{ + QTreeWidgetItem entry{ {QString::number(record.id), GetStatusStr(record), service, GetFunctionName(record)}}; const int row_id = record.id - id_offset; if (ui->main->invisibleRootItem()->childCount() > row_id) { records[row_id] = record; - (*ui->main->invisibleRootItem()->child(row_id)) = item; + (*ui->main->invisibleRootItem()->child(row_id)) = entry; } else { records.emplace_back(record); - ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(item)); + ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(entry)); } if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented || diff --git a/src/citra_qt/debugger/wait_tree.cpp b/src/citra_qt/debugger/wait_tree.cpp index 907c5f6bb..d46d99758 100644 --- a/src/citra_qt/debugger/wait_tree.cpp +++ b/src/citra_qt/debugger/wait_tree.cpp @@ -83,9 +83,9 @@ std::vector> WaitTreeItem::MakeThreadItemList() const auto& threads = Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList(); item_list.reserve(item_list.size() + threads.size()); - for (std::size_t i = 0; i < threads.size(); ++i) { - item_list.push_back(std::make_unique(*threads[i])); - item_list.back()->row = i; + for (std::size_t j = 0; j < threads.size(); ++j) { + item_list.push_back(std::make_unique(*threads[j])); + item_list.back()->row = j; } } return item_list; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index a804bfb98..1c1374349 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1454,7 +1454,6 @@ void GMainWindow::InstallCIA(QStringList filepaths) { progress_bar->setMaximum(INT_MAX); QtConcurrent::run([&, filepaths] { - QString current_path; Service::AM::InstallStatus status; const auto cia_progress = [&](std::size_t written, std::size_t total) { emit UpdateProgress(written, total); diff --git a/src/citra_qt/multiplayer/state.cpp b/src/citra_qt/multiplayer/state.cpp index 6fa6d1809..28f884a12 100644 --- a/src/citra_qt/multiplayer/state.cpp +++ b/src/citra_qt/multiplayer/state.cpp @@ -232,9 +232,8 @@ bool MultiplayerState::OnCloseRoom() { return true; } // Save ban list - if (auto room = Network::GetRoom().lock()) { - UISettings::values.ban_list = std::move(room->GetBanList()); - } + UISettings::values.ban_list = std::move(room->GetBanList()); + room->Destroy(); announce_multiplayer_session->Stop(); LOG_DEBUG(Frontend, "Closed the room (as a server)"); From ecb2541a930220826d11c476887d61f0c0e31edd Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 01:35:52 -0300 Subject: [PATCH 06/13] Solve some unreferenced parameter warnings (C4100: unreferenced formal parameter) --- src/citra_qt/configuration/configure_motion_touch.cpp | 4 ++-- src/citra_qt/configuration/configure_touch_from_button.cpp | 2 ++ src/citra_qt/debugger/graphics/graphics.cpp | 1 + src/citra_qt/debugger/graphics/graphics_breakpoints.cpp | 2 ++ src/citra_qt/debugger/graphics/graphics_cmdlists.cpp | 3 +++ src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 3 +++ src/citra_qt/debugger/profiler.cpp | 1 + src/citra_qt/game_list.cpp | 1 + src/citra_qt/main.cpp | 3 +++ src/citra_qt/util/clickable_label.cpp | 5 ++++- 10 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/citra_qt/configuration/configure_motion_touch.cpp b/src/citra_qt/configuration/configure_motion_touch.cpp index 7573e2217..9ba3ca2e0 100644 --- a/src/citra_qt/configuration/configure_motion_touch.cpp +++ b/src/citra_qt/configuration/configure_motion_touch.cpp @@ -168,10 +168,10 @@ void ConfigureMotionTouch::UpdateUiDisplay() { void ConfigureMotionTouch::ConnectEvents() { connect(ui->motion_provider, static_cast(&QComboBox::currentIndexChanged), this, - [this](int index) { UpdateUiDisplay(); }); + [this](int index) { Q_UNUSED(index); UpdateUiDisplay(); }); connect(ui->touch_provider, static_cast(&QComboBox::currentIndexChanged), this, - [this](int index) { UpdateUiDisplay(); }); + [this](int index) { Q_UNUSED(index); UpdateUiDisplay(); }); connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest); connect(ui->touch_calibration_config, &QPushButton::clicked, this, &ConfigureMotionTouch::OnConfigureTouchCalibration); diff --git a/src/citra_qt/configuration/configure_touch_from_button.cpp b/src/citra_qt/configuration/configure_touch_from_button.cpp index 12473e3f6..db222fa75 100644 --- a/src/citra_qt/configuration/configure_touch_from_button.cpp +++ b/src/citra_qt/configuration/configure_touch_from_button.cpp @@ -327,6 +327,7 @@ void ConfigureTouchFromButton::OnBindingChanged(QStandardItem* item) { } void ConfigureTouchFromButton::OnBindingDeleted(const QModelIndex& parent, int first, int last) { + Q_UNUSED(parent); for (int i = first; i <= last; ++i) { auto ix = binding_list_model->index(i, 0); if (!ix.isValid()) { @@ -514,6 +515,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) { } void TouchScreenPreview::leaveEvent(QEvent* event) { + Q_UNUSED(event); if (coord_label) { coord_label->clear(); } diff --git a/src/citra_qt/debugger/graphics/graphics.cpp b/src/citra_qt/debugger/graphics/graphics.cpp index 65d10f78b..6d0914fec 100644 --- a/src/citra_qt/debugger/graphics/graphics.cpp +++ b/src/citra_qt/debugger/graphics/graphics.cpp @@ -15,6 +15,7 @@ GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent) } int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return command_count; } diff --git a/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp index 477762cff..ffd1bfbfc 100644 --- a/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp @@ -17,10 +17,12 @@ BreakPointModel::BreakPointModel(std::shared_ptr debug_conte active_breakpoint(debug_context->active_breakpoint) {} int BreakPointModel::columnCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return 1; } int BreakPointModel::rowCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return static_cast(Pica::DebugContext::Event::NumEvents); } diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp index 9b94b17d6..1396b3b0d 100644 --- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -58,10 +58,12 @@ public: GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} int GPUCommandListModel::rowCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return static_cast(pica_trace.writes.size()); } int GPUCommandListModel::columnCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return 4; } @@ -90,6 +92,7 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { } QVariant GPUCommandListModel::headerData(int section, Qt::Orientation orientation, int role) const { + Q_UNUSED(orientation); switch (role) { case Qt::DisplayRole: { switch (section) { diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 91695f43a..6241dacc2 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -30,15 +30,18 @@ GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* : QAbstractTableModel(parent), par(parent) {} int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return 3; } int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { + Q_UNUSED(parent); return static_cast(par->info.code.size()); } QVariant GraphicsVertexShaderModel::headerData(int section, Qt::Orientation orientation, int role) const { + Q_UNUSED(orientation); switch (role) { case Qt::DisplayRole: { if (section == 0) { diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index e005d01a2..712242466 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -113,6 +113,7 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) { } void MicroProfileWidget::paintEvent(QPaintEvent* ev) { + Q_UNUSED(ev); QPainter painter(this); // The units used by Microprofile for drawing are based in pixels on a 96 dpi display. diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 582e3d00d..cc0264c5e 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -755,5 +755,6 @@ void GameListPlaceholder::onUpdateThemedIcons() { } void GameListPlaceholder::mouseDoubleClickEvent(QMouseEvent* event) { + Q_UNUSED(event); emit GameListPlaceholder::AddDirectory(); } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 1c1374349..9a6825422 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -2097,14 +2097,17 @@ void GMainWindow::OnMouseActivity() { } void GMainWindow::mouseMoveEvent(QMouseEvent* event) { + Q_UNUSED(event); OnMouseActivity(); } void GMainWindow::mousePressEvent(QMouseEvent* event) { + Q_UNUSED(event); OnMouseActivity(); } void GMainWindow::mouseReleaseEvent(QMouseEvent* event) { + Q_UNUSED(event); OnMouseActivity(); } diff --git a/src/citra_qt/util/clickable_label.cpp b/src/citra_qt/util/clickable_label.cpp index e990423a9..22b517c11 100644 --- a/src/citra_qt/util/clickable_label.cpp +++ b/src/citra_qt/util/clickable_label.cpp @@ -4,8 +4,11 @@ #include "citra_qt/util/clickable_label.h" -ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent) {} +ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent) { + Q_UNUSED(f); +} void ClickableLabel::mouseReleaseEvent(QMouseEvent* event) { + Q_UNUSED(event); emit clicked(); } From e4285d574a05caf1c5f21eb69b256347a2388330 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 14:10:40 -0300 Subject: [PATCH 07/13] Fix nihstro include style to conform to the style used in other instances. --- src/citra_qt/debugger/graphics/graphics_tracing.cpp | 2 +- src/citra_qt/debugger/graphics/graphics_vertex_shader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/debugger/graphics/graphics_tracing.cpp b/src/citra_qt/debugger/graphics/graphics_tracing.cpp index c24576834..a38d15bc5 100644 --- a/src/citra_qt/debugger/graphics/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics/graphics_tracing.cpp @@ -12,12 +12,12 @@ #include #include #include +#include #include "citra_qt/debugger/graphics/graphics_tracing.h" #include "common/common_types.h" #include "core/hw/gpu.h" #include "core/hw/lcd.h" #include "core/tracer/recorder.h" -#include "nihstro/float24.h" #include "video_core/pica_state.h" GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr debug_context, diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h index aeb827c3a..166b6ba23 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h @@ -6,8 +6,8 @@ #include #include +#include #include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" -#include "nihstro/parser_shbin.h" #include "video_core/shader/debug_data.h" #include "video_core/shader/shader.h" From 3381a05f7c51f3c4d42e362e8f301273e4f946ef Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 15:00:18 -0300 Subject: [PATCH 08/13] unreachable code --- src/citra_qt/debugger/graphics/graphics_surface.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index 1e11ca371..95a7df824 100644 --- a/src/citra_qt/debugger/graphics/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp @@ -398,7 +398,6 @@ void GraphicsSurfaceWidget::Pick(int x, int y) { default: return QStringLiteral("Unhandled format"); } - return QString{}; }; QString nibbles; From 8e54e7cf1a4d5dbcba62e6da605a5ea8eb393b2c Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 16:33:09 -0300 Subject: [PATCH 09/13] fix some conversion warnings --- src/citra_qt/bootmanager.cpp | 4 ++-- src/citra_qt/configuration/configure_audio.cpp | 2 +- src/citra_qt/configuration/configure_camera.cpp | 4 ++-- src/citra_qt/configuration/configure_input.cpp | 2 +- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 3fdc12344..bb9062807 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -230,8 +230,8 @@ void GRenderWindow::OnFramebufferSizeChanged() { // Screen changes potentially incur a change in screen DPI, hence we should update the // framebuffer size const qreal pixel_ratio = windowPixelRatio(); - const u32 width = this->width() * pixel_ratio; - const u32 height = this->height() * pixel_ratio; + const u32 width = static_cast(this->width() * pixel_ratio); + const u32 height = static_cast(this->height() * pixel_ratio); UpdateCurrentFramebufferLayout(width, height); } diff --git a/src/citra_qt/configuration/configure_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index e84c1c4a8..11fa08b97 100644 --- a/src/citra_qt/configuration/configure_audio.cpp +++ b/src/citra_qt/configuration/configure_audio.cpp @@ -61,7 +61,7 @@ void ConfigureAudio::SetConfiguration() { SetAudioDeviceFromDeviceID(); ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching); - ui->volume_slider->setValue(Settings::values.volume * ui->volume_slider->maximum()); + ui->volume_slider->setValue(static_cast(Settings::values.volume * ui->volume_slider->maximum())); SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); int selection; diff --git a/src/citra_qt/configuration/configure_camera.cpp b/src/citra_qt/configuration/configure_camera.cpp index 1ee577988..c11dbca62 100644 --- a/src/citra_qt/configuration/configure_camera.cpp +++ b/src/citra_qt/configuration/configure_camera.cpp @@ -184,7 +184,7 @@ void ConfigureCamera::StartPreviewing() { ui->preview_box->setHidden(false); ui->preview_button->setHidden(true); preview_width = ui->preview_box->size().width(); - preview_height = preview_width * 0.75; + preview_height = static_cast(preview_width * 0.75); ui->preview_box->setToolTip( tr("Resolution: %1*%2") .arg(QString::number(preview_width), QString::number(preview_height))); @@ -232,7 +232,7 @@ void ConfigureCamera::timerEvent(QTimerEvent* event) { } std::vector frame = previewing_camera->ReceiveFrame(); int width = ui->preview_box->size().width(); - int height = width * 0.75; + int height = static_cast(width * 0.75); if (width != preview_width || height != preview_height) { StopPreviewing(); return; diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index b5fd9bda2..dc8394583 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -256,7 +256,7 @@ ConfigureInput::ConfigureInput(QWidget* parent) } }); connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged, [=] { - const float slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value(); + const int slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value(); if (analogs_param[analog_id].Get("engine", "") == "sdl") { analog_map_deadzone_and_modifier_slider_label[analog_id]->setText( tr("Deadzone: %1%").arg(slider_value)); diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index e52aa0869..1f044b175 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -236,7 +236,7 @@ private: template std::string GetSelectorSrc(const SwizzlePattern& pattern) { std::string out; - for (std::size_t i = 0; i < 4; ++i) { + for (int i = 0; i < 4; ++i) { switch ((pattern.*getter)(i)) { case SwizzlePattern::Selector::x: out += 'x'; From 62a69e0547af5ee6e07cbb4b5f34d7b3fd147bd6 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 22:48:25 -0300 Subject: [PATCH 10/13] fix clang format --- src/citra_qt/configuration/configure_audio.cpp | 3 ++- src/citra_qt/updater/updater.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/citra_qt/configuration/configure_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index 11fa08b97..40d2ae759 100644 --- a/src/citra_qt/configuration/configure_audio.cpp +++ b/src/citra_qt/configuration/configure_audio.cpp @@ -61,7 +61,8 @@ void ConfigureAudio::SetConfiguration() { SetAudioDeviceFromDeviceID(); ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching); - ui->volume_slider->setValue(static_cast(Settings::values.volume * ui->volume_slider->maximum())); + ui->volume_slider->setValue( + static_cast(Settings::values.volume * ui->volume_slider->maximum())); SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); int selection; diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index cafffd2b0..33d5c9da0 100644 --- a/src/citra_qt/updater/updater.cpp +++ b/src/citra_qt/updater/updater.cpp @@ -133,8 +133,9 @@ bool UpdaterPrivate::StartUpdateCheck() { connect(main_process, static_cast(&QProcess::finished), this, &UpdaterPrivate::UpdaterReady, Qt::QueuedConnection); - connect(main_process, static_cast(&QProcess::errorOccurred), - this, &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); + connect(main_process, + static_cast(&QProcess::errorOccurred), this, + &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); main_process->start(QIODevice::ReadOnly); running = true; From db0383fe0eda954731d4d8e10169305308b68f2e Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 15 Aug 2020 10:55:54 -0300 Subject: [PATCH 11/13] Use maybe_unused instead of Q_UNUSED --- src/citra_qt/camera/qt_multimedia_camera.cpp | 5 ++--- src/citra_qt/configuration/configure_motion_touch.cpp | 4 ++-- .../configuration/configure_touch_from_button.cpp | 7 +++---- src/citra_qt/debugger/graphics/graphics.cpp | 3 +-- .../debugger/graphics/graphics_breakpoints.cpp | 6 ++---- src/citra_qt/debugger/graphics/graphics_cmdlists.cpp | 10 ++++------ .../debugger/graphics/graphics_vertex_shader.cpp | 10 ++++------ src/citra_qt/debugger/profiler.cpp | 3 +-- src/citra_qt/game_list.cpp | 3 +-- src/citra_qt/main.cpp | 9 +++------ src/citra_qt/util/clickable_label.cpp | 8 +++----- 11 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/citra_qt/camera/qt_multimedia_camera.cpp b/src/citra_qt/camera/qt_multimedia_camera.cpp index 0e977cc6e..f7c3b14d8 100644 --- a/src/citra_qt/camera/qt_multimedia_camera.cpp +++ b/src/citra_qt/camera/qt_multimedia_camera.cpp @@ -12,9 +12,8 @@ namespace Camera { -QList QtCameraSurface::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const { - Q_UNUSED(handleType); +QList QtCameraSurface::supportedPixelFormats([ + [maybe_unused]] QAbstractVideoBuffer::HandleType handleType) const { return QList() << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_ARGB32_Premultiplied << QVideoFrame::Format_RGB32 << QVideoFrame::Format_RGB24 << QVideoFrame::Format_RGB565 diff --git a/src/citra_qt/configuration/configure_motion_touch.cpp b/src/citra_qt/configuration/configure_motion_touch.cpp index 9ba3ca2e0..b0398a77d 100644 --- a/src/citra_qt/configuration/configure_motion_touch.cpp +++ b/src/citra_qt/configuration/configure_motion_touch.cpp @@ -168,10 +168,10 @@ void ConfigureMotionTouch::UpdateUiDisplay() { void ConfigureMotionTouch::ConnectEvents() { connect(ui->motion_provider, static_cast(&QComboBox::currentIndexChanged), this, - [this](int index) { Q_UNUSED(index); UpdateUiDisplay(); }); + [this]([[maybe_unused]] int index) { UpdateUiDisplay(); }); connect(ui->touch_provider, static_cast(&QComboBox::currentIndexChanged), this, - [this](int index) { Q_UNUSED(index); UpdateUiDisplay(); }); + [this]([[maybe_unused]] int index) { UpdateUiDisplay(); }); connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest); connect(ui->touch_calibration_config, &QPushButton::clicked, this, &ConfigureMotionTouch::OnConfigureTouchCalibration); diff --git a/src/citra_qt/configuration/configure_touch_from_button.cpp b/src/citra_qt/configuration/configure_touch_from_button.cpp index db222fa75..376ab6ada 100644 --- a/src/citra_qt/configuration/configure_touch_from_button.cpp +++ b/src/citra_qt/configuration/configure_touch_from_button.cpp @@ -326,8 +326,8 @@ void ConfigureTouchFromButton::OnBindingChanged(QStandardItem* item) { } } -void ConfigureTouchFromButton::OnBindingDeleted(const QModelIndex& parent, int first, int last) { - Q_UNUSED(parent); +void ConfigureTouchFromButton::OnBindingDeleted([[maybe_unused]] const QModelIndex& parent, + int first, int last) { for (int i = first; i <= last; ++i) { auto ix = binding_list_model->index(i, 0); if (!ix.isValid()) { @@ -514,8 +514,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) { } } -void TouchScreenPreview::leaveEvent(QEvent* event) { - Q_UNUSED(event); +void TouchScreenPreview::leaveEvent([[maybe_unused]] QEvent* event) { if (coord_label) { coord_label->clear(); } diff --git a/src/citra_qt/debugger/graphics/graphics.cpp b/src/citra_qt/debugger/graphics/graphics.cpp index 6d0914fec..1a3c0157c 100644 --- a/src/citra_qt/debugger/graphics/graphics.cpp +++ b/src/citra_qt/debugger/graphics/graphics.cpp @@ -14,8 +14,7 @@ GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent) &GPUCommandStreamItemModel::OnGXCommandFinishedInternal); } -int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int GPUCommandStreamItemModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { return command_count; } diff --git a/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp index ffd1bfbfc..55ab0a98e 100644 --- a/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp @@ -16,13 +16,11 @@ BreakPointModel::BreakPointModel(std::shared_ptr debug_conte at_breakpoint(debug_context->at_breakpoint), active_breakpoint(debug_context->active_breakpoint) {} -int BreakPointModel::columnCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int BreakPointModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 1; } -int BreakPointModel::rowCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int BreakPointModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { return static_cast(Pica::DebugContext::Event::NumEvents); } diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp index 1396b3b0d..af99c111c 100644 --- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -57,13 +57,11 @@ public: GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} -int GPUCommandListModel::rowCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int GPUCommandListModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { return static_cast(pica_trace.writes.size()); } -int GPUCommandListModel::columnCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int GPUCommandListModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 4; } @@ -91,8 +89,8 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { return QVariant(); } -QVariant GPUCommandListModel::headerData(int section, Qt::Orientation orientation, int role) const { - Q_UNUSED(orientation); +QVariant GPUCommandListModel::headerData(int section, [[maybe_unused]] Qt::Orientation orientation, + int role) const { switch (role) { case Qt::DisplayRole: { switch (section) { diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 6241dacc2..5ce5d7996 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -29,19 +29,17 @@ using nihstro::SwizzlePattern; GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent) : QAbstractTableModel(parent), par(parent) {} -int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int GraphicsVertexShaderModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 3; } -int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { - Q_UNUSED(parent); +int GraphicsVertexShaderModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { return static_cast(par->info.code.size()); } -QVariant GraphicsVertexShaderModel::headerData(int section, Qt::Orientation orientation, +QVariant GraphicsVertexShaderModel::headerData(int section, + [[maybe_unused]] Qt::Orientation orientation, int role) const { - Q_UNUSED(orientation); switch (role) { case Qt::DisplayRole: { if (section == 0) { diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 712242466..e36bc5a6f 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -112,8 +112,7 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) { connect(&update_timer, &QTimer::timeout, this, qOverload<>(&MicroProfileWidget::update)); } -void MicroProfileWidget::paintEvent(QPaintEvent* ev) { - Q_UNUSED(ev); +void MicroProfileWidget::paintEvent([[maybe_unused]] QPaintEvent* ev) { QPainter painter(this); // The units used by Microprofile for drawing are based in pixels on a 96 dpi display. diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index cc0264c5e..41d6ffbdb 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -754,7 +754,6 @@ void GameListPlaceholder::onUpdateThemedIcons() { image->setPixmap(QIcon::fromTheme(QStringLiteral("plus_folder")).pixmap(200)); } -void GameListPlaceholder::mouseDoubleClickEvent(QMouseEvent* event) { - Q_UNUSED(event); +void GameListPlaceholder::mouseDoubleClickEvent([[maybe_unused]] QMouseEvent* event) { emit GameListPlaceholder::AddDirectory(); } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 9a6825422..dd846e0bd 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -2096,18 +2096,15 @@ void GMainWindow::OnMouseActivity() { ShowMouseCursor(); } -void GMainWindow::mouseMoveEvent(QMouseEvent* event) { - Q_UNUSED(event); +void GMainWindow::mouseMoveEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } -void GMainWindow::mousePressEvent(QMouseEvent* event) { - Q_UNUSED(event); +void GMainWindow::mousePressEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } -void GMainWindow::mouseReleaseEvent(QMouseEvent* event) { - Q_UNUSED(event); +void GMainWindow::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } diff --git a/src/citra_qt/util/clickable_label.cpp b/src/citra_qt/util/clickable_label.cpp index 22b517c11..2a1ea5df1 100644 --- a/src/citra_qt/util/clickable_label.cpp +++ b/src/citra_qt/util/clickable_label.cpp @@ -4,11 +4,9 @@ #include "citra_qt/util/clickable_label.h" -ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent) { - Q_UNUSED(f); -} +ClickableLabel::ClickableLabel(QWidget* parent, [[maybe_unused]] Qt::WindowFlags f) + : QLabel(parent) {} -void ClickableLabel::mouseReleaseEvent(QMouseEvent* event) { - Q_UNUSED(event); +void ClickableLabel::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) { emit clicked(); } From 981a4611a4e66b56f092dac58d487c888669fb64 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 15 Aug 2020 11:13:08 -0300 Subject: [PATCH 12/13] Mark variables only used on trace logs as maybe_unused Fixes some -Wunused-variable warnings --- src/core/hle/service/csnd/csnd_snd.cpp | 12 ++++++------ src/core/hle/service/dsp/dsp_dsp.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/hle/service/csnd/csnd_snd.cpp b/src/core/hle/service/csnd/csnd_snd.cpp index 1a7a00964..4f0488a24 100644 --- a/src/core/hle/service/csnd/csnd_snd.cpp +++ b/src/core/hle/service/csnd/csnd_snd.cpp @@ -460,8 +460,8 @@ void CSND_SND::ReleaseCapUnit(Kernel::HLERequestContext& ctx) { void CSND_SND::FlushDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x9, 2, 2); - const VAddr address = rp.Pop(); - const u32 size = rp.Pop(); + [[maybe_unused]] const VAddr address = rp.Pop(); + [[maybe_unused]] const u32 size = rp.Pop(); const auto process = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -473,8 +473,8 @@ void CSND_SND::FlushDataCache(Kernel::HLERequestContext& ctx) { void CSND_SND::StoreDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xA, 2, 2); - const VAddr address = rp.Pop(); - const u32 size = rp.Pop(); + [[maybe_unused]] const VAddr address = rp.Pop(); + [[maybe_unused]] const u32 size = rp.Pop(); const auto process = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -486,8 +486,8 @@ void CSND_SND::StoreDataCache(Kernel::HLERequestContext& ctx) { void CSND_SND::InvalidateDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0xB, 2, 2); - const VAddr address = rp.Pop(); - const u32 size = rp.Pop(); + [[maybe_unused]] const VAddr address = rp.Pop(); + [[maybe_unused]] const u32 size = rp.Pop(); const auto process = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); diff --git a/src/core/hle/service/dsp/dsp_dsp.cpp b/src/core/hle/service/dsp/dsp_dsp.cpp index 720c4595a..94bfe2cdc 100644 --- a/src/core/hle/service/dsp/dsp_dsp.cpp +++ b/src/core/hle/service/dsp/dsp_dsp.cpp @@ -202,8 +202,8 @@ void DSP_DSP::UnloadComponent(Kernel::HLERequestContext& ctx) { void DSP_DSP::FlushDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x13, 2, 2); - const VAddr address = rp.Pop(); - const u32 size = rp.Pop(); + [[maybe_unused]] const VAddr address = rp.Pop(); + [[maybe_unused]] const u32 size = rp.Pop(); const auto process = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -215,8 +215,8 @@ void DSP_DSP::FlushDataCache(Kernel::HLERequestContext& ctx) { void DSP_DSP::InvalidateDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x14, 2, 2); - const VAddr address = rp.Pop(); - const u32 size = rp.Pop(); + [[maybe_unused]] const VAddr address = rp.Pop(); + [[maybe_unused]] const u32 size = rp.Pop(); const auto process = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); From 7e19ed130903c69e902a08170f32198466e745c0 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 15 Aug 2020 11:34:56 -0300 Subject: [PATCH 13/13] Rename profiler parameter names Rename the parameter names of the overriden methods to match the qt names. --- src/citra_qt/debugger/profiler.cpp | 76 +++++++++++++++--------------- src/citra_qt/debugger/profiler.h | 4 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index e36bc5a6f..be51e61c1 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -24,17 +24,17 @@ public: MicroProfileWidget(QWidget* parent = nullptr); protected: - void paintEvent(QPaintEvent* ev) override; - void showEvent(QShowEvent* ev) override; - void hideEvent(QHideEvent* ev) override; + void paintEvent(QPaintEvent* event) override; + void showEvent(QShowEvent* event) override; + void hideEvent(QHideEvent* event) override; - void mouseMoveEvent(QMouseEvent* ev) override; - void mousePressEvent(QMouseEvent* ev) override; - void mouseReleaseEvent(QMouseEvent* ev) override; - void wheelEvent(QWheelEvent* ev) override; + void mouseMoveEvent(QMouseEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; + void wheelEvent(QWheelEvent* event) override; - void keyPressEvent(QKeyEvent* ev) override; - void keyReleaseEvent(QKeyEvent* ev) override; + void keyPressEvent(QKeyEvent* event) override; + void keyReleaseEvent(QKeyEvent* event) override; private: /// This timer is used to redraw the widget's contents continuously. To save resources, it only @@ -82,18 +82,18 @@ QAction* MicroProfileDialog::toggleViewAction() { return toggle_view_action; } -void MicroProfileDialog::showEvent(QShowEvent* ev) { +void MicroProfileDialog::showEvent(QShowEvent* event) { if (toggle_view_action) { toggle_view_action->setChecked(isVisible()); } - QWidget::showEvent(ev); + QWidget::showEvent(event); } -void MicroProfileDialog::hideEvent(QHideEvent* ev) { +void MicroProfileDialog::hideEvent(QHideEvent* event) { if (toggle_view_action) { toggle_view_action->setChecked(isVisible()); } - QWidget::hideEvent(ev); + QWidget::hideEvent(event); } #if MICROPROFILE_ENABLED @@ -112,7 +112,7 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) { connect(&update_timer, &QTimer::timeout, this, qOverload<>(&MicroProfileWidget::update)); } -void MicroProfileWidget::paintEvent([[maybe_unused]] QPaintEvent* ev) { +void MicroProfileWidget::paintEvent([[maybe_unused]] QPaintEvent* event) { QPainter painter(this); // The units used by Microprofile for drawing are based in pixels on a 96 dpi display. @@ -132,51 +132,51 @@ void MicroProfileWidget::paintEvent([[maybe_unused]] QPaintEvent* ev) { mp_painter = nullptr; } -void MicroProfileWidget::showEvent(QShowEvent* ev) { +void MicroProfileWidget::showEvent(QShowEvent* event) { update_timer.start(15); // ~60 Hz - QWidget::showEvent(ev); + QWidget::showEvent(event); } -void MicroProfileWidget::hideEvent(QHideEvent* ev) { +void MicroProfileWidget::hideEvent(QHideEvent* event) { update_timer.stop(); - QWidget::hideEvent(ev); + QWidget::hideEvent(event); } -void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); - ev->accept(); +void MicroProfileWidget::mouseMoveEvent(QMouseEvent* event) { + MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0); + event->accept(); } -void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); - MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); - ev->accept(); +void MicroProfileWidget::mousePressEvent(QMouseEvent* event) { + MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0); + MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton); + event->accept(); } -void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); - MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); - ev->accept(); +void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* event) { + MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0); + MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton); + event->accept(); } -void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { - MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, ev->delta() / 120); - ev->accept(); +void MicroProfileWidget::wheelEvent(QWheelEvent* event) { + MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, event->delta() / 120); + event->accept(); } -void MicroProfileWidget::keyPressEvent(QKeyEvent* ev) { - if (ev->key() == Qt::Key_Control) { +void MicroProfileWidget::keyPressEvent(QKeyEvent* event) { + if (event->key() == Qt::Key_Control) { // Inform MicroProfile that the user is holding Ctrl. MicroProfileModKey(1); } - QWidget::keyPressEvent(ev); + QWidget::keyPressEvent(event); } -void MicroProfileWidget::keyReleaseEvent(QKeyEvent* ev) { - if (ev->key() == Qt::Key_Control) { +void MicroProfileWidget::keyReleaseEvent(QKeyEvent* event) { + if (event->key() == Qt::Key_Control) { MicroProfileModKey(0); } - QWidget::keyReleaseEvent(ev); + QWidget::keyReleaseEvent(event); } // These functions are called by MicroProfileDraw to draw the interface elements on the screen. diff --git a/src/citra_qt/debugger/profiler.h b/src/citra_qt/debugger/profiler.h index e2a542767..43d470aee 100644 --- a/src/citra_qt/debugger/profiler.h +++ b/src/citra_qt/debugger/profiler.h @@ -17,8 +17,8 @@ public: QAction* toggleViewAction(); protected: - void showEvent(QShowEvent* ev) override; - void hideEvent(QHideEvent* ev) override; + void showEvent(QShowEvent* event) override; + void hideEvent(QHideEvent* event) override; private: QAction* toggle_view_action = nullptr;