diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index d09c356f4..9c9e99232 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" @@ -233,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/bootmanager.h b/src/citra_qt/bootmanager.h index 40946abb6..c0f1134b8 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -16,7 +16,6 @@ #include "core/frontend/emu_window.h" class QKeyEvent; -class QScreen; class QTouchEvent; class QOffscreenSurface; class QOpenGLContext; 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/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_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index e84c1c4a8..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(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 c1ce931d6..64fb7c840 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/citra_qt/configuration/configure_motion_touch.cpp b/src/citra_qt/configuration/configure_motion_touch.cpp index 7573e2217..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) { UpdateUiDisplay(); }); + [this]([[maybe_unused]] int index) { UpdateUiDisplay(); }); connect(ui->touch_provider, static_cast(&QComboBox::currentIndexChanged), this, - [this](int 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 12473e3f6..376ab6ada 100644 --- a/src/citra_qt/configuration/configure_touch_from_button.cpp +++ b/src/citra_qt/configuration/configure_touch_from_button.cpp @@ -326,7 +326,8 @@ void ConfigureTouchFromButton::OnBindingChanged(QStandardItem* item) { } } -void ConfigureTouchFromButton::OnBindingDeleted(const QModelIndex& parent, int first, int last) { +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()) { @@ -513,7 +514,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) { } } -void TouchScreenPreview::leaveEvent(QEvent* 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 65d10f78b..1a3c0157c 100644 --- a/src/citra_qt/debugger/graphics/graphics.cpp +++ b/src/citra_qt/debugger/graphics/graphics.cpp @@ -14,7 +14,7 @@ GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent) &GPUCommandStreamItemModel::OnGXCommandFinishedInternal); } -int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const { +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 477762cff..55ab0a98e 100644 --- a/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp @@ -16,11 +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 { +int BreakPointModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 1; } -int BreakPointModel::rowCount(const QModelIndex& parent) const { +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 9b94b17d6..af99c111c 100644 --- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -57,11 +57,11 @@ public: GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} -int GPUCommandListModel::rowCount(const QModelIndex& parent) const { +int GPUCommandListModel::rowCount([[maybe_unused]] const QModelIndex& parent) const { return static_cast(pica_trace.writes.size()); } -int GPUCommandListModel::columnCount(const QModelIndex& parent) const { +int GPUCommandListModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 4; } @@ -89,7 +89,8 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { return QVariant(); } -QVariant GPUCommandListModel::headerData(int section, Qt::Orientation orientation, int role) const { +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_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; 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.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 91695f43a..5ce5d7996 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -29,15 +29,16 @@ using nihstro::SwizzlePattern; GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent) : QAbstractTableModel(parent), par(parent) {} -int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { +int GraphicsVertexShaderModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 3; } -int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { +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 { switch (role) { case Qt::DisplayRole: { 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" diff --git a/src/citra_qt/debugger/ipc/recorder.cpp b/src/citra_qt/debugger/ipc/recorder.cpp index ef634d750..b4ed84ad0 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 @@ -72,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 || @@ -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/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index e005d01a2..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(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(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; 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/game_list.cpp b/src/citra_qt/game_list.cpp index d75df2859..f2c0860c7 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -768,6 +768,6 @@ void GameListPlaceholder::onUpdateThemedIcons() { image->setPixmap(QIcon::fromTheme(QStringLiteral("plus_folder")).pixmap(200)); } -void GameListPlaceholder::mouseDoubleClickEvent(QMouseEvent* event) { +void GameListPlaceholder::mouseDoubleClickEvent([[maybe_unused]] QMouseEvent* event) { emit GameListPlaceholder::AddDirectory(); } 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 { diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index c8639f616..b93df716e 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1459,7 +1459,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); @@ -2102,15 +2101,15 @@ void GMainWindow::OnMouseActivity() { ShowMouseCursor(); } -void GMainWindow::mouseMoveEvent(QMouseEvent* event) { +void GMainWindow::mouseMoveEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } -void GMainWindow::mousePressEvent(QMouseEvent* event) { +void GMainWindow::mousePressEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } -void GMainWindow::mouseReleaseEvent(QMouseEvent* event) { +void GMainWindow::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) { OnMouseActivity(); } 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)"); diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index 8701eee7b..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::error), - this, &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); + connect(main_process, + static_cast(&QProcess::errorOccurred), this, + &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); main_process->start(QIODevice::ReadOnly); running = true; diff --git a/src/citra_qt/util/clickable_label.cpp b/src/citra_qt/util/clickable_label.cpp index e990423a9..2a1ea5df1 100644 --- a/src/citra_qt/util/clickable_label.cpp +++ b/src/citra_qt/util/clickable_label.cpp @@ -4,8 +4,9 @@ #include "citra_qt/util/clickable_label.h" -ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent) {} +ClickableLabel::ClickableLabel(QWidget* parent, [[maybe_unused]] Qt::WindowFlags f) + : QLabel(parent) {} -void ClickableLabel::mouseReleaseEvent(QMouseEvent* event) { +void ClickableLabel::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) { emit clicked(); } 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/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/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 diff --git a/src/core/hle/service/csnd/csnd_snd.cpp b/src/core/hle/service/csnd/csnd_snd.cpp index 4dc96d77c..160ce313f 100644 --- a/src/core/hle/service/csnd/csnd_snd.cpp +++ b/src/core/hle/service/csnd/csnd_snd.cpp @@ -459,8 +459,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); @@ -472,8 +472,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); @@ -485,8 +485,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 ea179ef55..ff6fecb3b 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); diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index bf165d9fb..c4a429ccb 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'; 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); }