Merge pull request #5471 from vitor-k/misc

Fix some warnings and some small changes
This commit is contained in:
bunnei 2021-04-23 22:54:00 -07:00 committed by GitHub
commit 24086d05bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 110 additions and 117 deletions

View File

@ -10,9 +10,6 @@
#include <QOpenGLContext> #include <QOpenGLContext>
#include <QOpenGLFunctions> #include <QOpenGLFunctions>
#include <QOpenGLFunctions_3_3_Core> #include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLWindow>
#include <QScreen>
#include <QWindow>
#include <fmt/format.h> #include <fmt/format.h>
#include "citra_qt/bootmanager.h" #include "citra_qt/bootmanager.h"
#include "citra_qt/main.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 // Screen changes potentially incur a change in screen DPI, hence we should update the
// framebuffer size // framebuffer size
const qreal pixel_ratio = windowPixelRatio(); const qreal pixel_ratio = windowPixelRatio();
const u32 width = this->width() * pixel_ratio; const u32 width = static_cast<u32>(this->width() * pixel_ratio);
const u32 height = this->height() * pixel_ratio; const u32 height = static_cast<u32>(this->height() * pixel_ratio);
UpdateCurrentFramebufferLayout(width, height); UpdateCurrentFramebufferLayout(width, height);
} }

View File

@ -16,7 +16,6 @@
#include "core/frontend/emu_window.h" #include "core/frontend/emu_window.h"
class QKeyEvent; class QKeyEvent;
class QScreen;
class QTouchEvent; class QTouchEvent;
class QOffscreenSurface; class QOffscreenSurface;
class QOpenGLContext; class QOpenGLContext;

View File

@ -175,9 +175,9 @@ std::vector<u16> Rgb2Yuv(const QImage& source, int width, int height) {
auto dest = buffer.begin(); auto dest = buffer.begin();
bool write = false; bool write = false;
int py, pu, pv; int py, pu, pv;
for (int y = 0; y < height; ++y) { for (int j = 0; j < height; ++j) {
for (int x = 0; x < width; ++x) { for (int i = 0; i < width; ++i) {
QRgb rgb = source.pixel(x, y); QRgb rgb = source.pixel(i, j);
int r = qRed(rgb); int r = qRed(rgb);
int g = qGreen(rgb); int g = qGreen(rgb);
int b = qBlue(rgb); int b = qBlue(rgb);

View File

@ -12,9 +12,8 @@
namespace Camera { namespace Camera {
QList<QVideoFrame::PixelFormat> QtCameraSurface::supportedPixelFormats( QList<QVideoFrame::PixelFormat> QtCameraSurface::supportedPixelFormats([
QAbstractVideoBuffer::HandleType handleType) const { [maybe_unused]] QAbstractVideoBuffer::HandleType handleType) const {
Q_UNUSED(handleType);
return QList<QVideoFrame::PixelFormat>() return QList<QVideoFrame::PixelFormat>()
<< QVideoFrame::Format_ARGB32 << QVideoFrame::Format_ARGB32_Premultiplied << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_ARGB32_Premultiplied
<< QVideoFrame::Format_RGB32 << QVideoFrame::Format_RGB24 << QVideoFrame::Format_RGB565 << QVideoFrame::Format_RGB32 << QVideoFrame::Format_RGB24 << QVideoFrame::Format_RGB565

View File

@ -61,7 +61,8 @@ void ConfigureAudio::SetConfiguration() {
SetAudioDeviceFromDeviceID(); SetAudioDeviceFromDeviceID();
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching); 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<int>(Settings::values.volume * ui->volume_slider->maximum()));
SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); SetVolumeIndicatorText(ui->volume_slider->sliderPosition());
int selection; int selection;

View File

@ -184,7 +184,7 @@ void ConfigureCamera::StartPreviewing() {
ui->preview_box->setHidden(false); ui->preview_box->setHidden(false);
ui->preview_button->setHidden(true); ui->preview_button->setHidden(true);
preview_width = ui->preview_box->size().width(); preview_width = ui->preview_box->size().width();
preview_height = preview_width * 0.75; preview_height = static_cast<int>(preview_width * 0.75);
ui->preview_box->setToolTip( ui->preview_box->setToolTip(
tr("Resolution: %1*%2") tr("Resolution: %1*%2")
.arg(QString::number(preview_width), QString::number(preview_height))); .arg(QString::number(preview_width), QString::number(preview_height)));
@ -232,7 +232,7 @@ void ConfigureCamera::timerEvent(QTimerEvent* event) {
} }
std::vector<u16> frame = previewing_camera->ReceiveFrame(); std::vector<u16> frame = previewing_camera->ReceiveFrame();
int width = ui->preview_box->size().width(); int width = ui->preview_box->size().width();
int height = width * 0.75; int height = static_cast<int>(width * 0.75);
if (width != preview_width || height != preview_height) { if (width != preview_width || height != preview_height) {
StopPreviewing(); StopPreviewing();
return; return;

View File

@ -256,7 +256,7 @@ ConfigureInput::ConfigureInput(QWidget* parent)
} }
}); });
connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged, [=] { 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") { if (analogs_param[analog_id].Get("engine", "") == "sdl") {
analog_map_deadzone_and_modifier_slider_label[analog_id]->setText( analog_map_deadzone_and_modifier_slider_label[analog_id]->setText(
tr("Deadzone: %1%").arg(slider_value)); tr("Deadzone: %1%").arg(slider_value));

View File

@ -168,10 +168,10 @@ void ConfigureMotionTouch::UpdateUiDisplay() {
void ConfigureMotionTouch::ConnectEvents() { void ConfigureMotionTouch::ConnectEvents() {
connect(ui->motion_provider, connect(ui->motion_provider,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int index) { UpdateUiDisplay(); }); [this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
connect(ui->touch_provider, connect(ui->touch_provider,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int index) { UpdateUiDisplay(); }); [this]([[maybe_unused]] int index) { UpdateUiDisplay(); });
connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest); connect(ui->udp_test, &QPushButton::clicked, this, &ConfigureMotionTouch::OnCemuhookUDPTest);
connect(ui->touch_calibration_config, &QPushButton::clicked, this, connect(ui->touch_calibration_config, &QPushButton::clicked, this,
&ConfigureMotionTouch::OnConfigureTouchCalibration); &ConfigureMotionTouch::OnConfigureTouchCalibration);

View File

@ -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) { for (int i = first; i <= last; ++i) {
auto ix = binding_list_model->index(i, 0); auto ix = binding_list_model->index(i, 0);
if (!ix.isValid()) { 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) { if (coord_label) {
coord_label->clear(); coord_label->clear();
} }

View File

@ -14,7 +14,7 @@ GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent)
&GPUCommandStreamItemModel::OnGXCommandFinishedInternal); &GPUCommandStreamItemModel::OnGXCommandFinishedInternal);
} }
int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const { int GPUCommandStreamItemModel::rowCount([[maybe_unused]] const QModelIndex& parent) const {
return command_count; return command_count;
} }

View File

@ -16,11 +16,11 @@ BreakPointModel::BreakPointModel(std::shared_ptr<Pica::DebugContext> debug_conte
at_breakpoint(debug_context->at_breakpoint), at_breakpoint(debug_context->at_breakpoint),
active_breakpoint(debug_context->active_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; return 1;
} }
int BreakPointModel::rowCount(const QModelIndex& parent) const { int BreakPointModel::rowCount([[maybe_unused]] const QModelIndex& parent) const {
return static_cast<int>(Pica::DebugContext::Event::NumEvents); return static_cast<int>(Pica::DebugContext::Event::NumEvents);
} }

View File

@ -57,11 +57,11 @@ public:
GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} 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<int>(pica_trace.writes.size()); return static_cast<int>(pica_trace.writes.size());
} }
int GPUCommandListModel::columnCount(const QModelIndex& parent) const { int GPUCommandListModel::columnCount([[maybe_unused]] const QModelIndex& parent) const {
return 4; return 4;
} }
@ -89,7 +89,8 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
return QVariant(); 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) { switch (role) {
case Qt::DisplayRole: { case Qt::DisplayRole: {
switch (section) { switch (section) {

View File

@ -398,7 +398,6 @@ void GraphicsSurfaceWidget::Pick(int x, int y) {
default: default:
return QStringLiteral("Unhandled format"); return QStringLiteral("Unhandled format");
} }
return QString{};
}; };
QString nibbles; QString nibbles;

View File

@ -12,12 +12,12 @@
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <boost/range/algorithm/copy.hpp> #include <boost/range/algorithm/copy.hpp>
#include <nihstro/float24.h>
#include "citra_qt/debugger/graphics/graphics_tracing.h" #include "citra_qt/debugger/graphics/graphics_tracing.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hw/gpu.h" #include "core/hw/gpu.h"
#include "core/hw/lcd.h" #include "core/hw/lcd.h"
#include "core/tracer/recorder.h" #include "core/tracer/recorder.h"
#include "nihstro/float24.h"
#include "video_core/pica_state.h" #include "video_core/pica_state.h"
GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context, GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context,

View File

@ -29,15 +29,16 @@ using nihstro::SwizzlePattern;
GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent) GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent)
: QAbstractTableModel(parent), par(parent) {} : QAbstractTableModel(parent), par(parent) {}
int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { int GraphicsVertexShaderModel::columnCount([[maybe_unused]] const QModelIndex& parent) const {
return 3; return 3;
} }
int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { int GraphicsVertexShaderModel::rowCount([[maybe_unused]] const QModelIndex& parent) const {
return static_cast<int>(par->info.code.size()); return static_cast<int>(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 { int role) const {
switch (role) { switch (role) {
case Qt::DisplayRole: { case Qt::DisplayRole: {

View File

@ -6,8 +6,8 @@
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QTreeView> #include <QTreeView>
#include <nihstro/parser_shbin.h>
#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" #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/debug_data.h"
#include "video_core/shader/shader.h" #include "video_core/shader/shader.h"

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <QBrush>
#include <QString> #include <QString>
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
#include <fmt/format.h> #include <fmt/format.h>
@ -72,16 +73,16 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) {
service = QStringLiteral("%1 (%2)").arg(service, record.is_hle ? tr("HLE") : tr("LLE")); 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)}}; {QString::number(record.id), GetStatusStr(record), service, GetFunctionName(record)}};
const int row_id = record.id - id_offset; const int row_id = record.id - id_offset;
if (ui->main->invisibleRootItem()->childCount() > row_id) { if (ui->main->invisibleRootItem()->childCount() > row_id) {
records[row_id] = record; records[row_id] = record;
(*ui->main->invisibleRootItem()->child(row_id)) = item; (*ui->main->invisibleRootItem()->child(row_id)) = entry;
} else { } else {
records.emplace_back(record); records.emplace_back(record);
ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(item)); ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(entry));
} }
if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented || if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented ||
@ -90,7 +91,7 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) {
auto* item = ui->main->invisibleRootItem()->child(row_id); auto* item = ui->main->invisibleRootItem()->child(row_id);
for (int column = 0; column < item->columnCount(); ++column) { 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)));
} }
} }

View File

@ -24,17 +24,17 @@ public:
MicroProfileWidget(QWidget* parent = nullptr); MicroProfileWidget(QWidget* parent = nullptr);
protected: protected:
void paintEvent(QPaintEvent* ev) override; void paintEvent(QPaintEvent* event) override;
void showEvent(QShowEvent* ev) override; void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent* ev) override; void hideEvent(QHideEvent* event) override;
void mouseMoveEvent(QMouseEvent* ev) override; void mouseMoveEvent(QMouseEvent* event) override;
void mousePressEvent(QMouseEvent* ev) override; void mousePressEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* ev) override; void mouseReleaseEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* ev) override; void wheelEvent(QWheelEvent* event) override;
void keyPressEvent(QKeyEvent* ev) override; void keyPressEvent(QKeyEvent* event) override;
void keyReleaseEvent(QKeyEvent* ev) override; void keyReleaseEvent(QKeyEvent* event) override;
private: private:
/// This timer is used to redraw the widget's contents continuously. To save resources, it only /// 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; return toggle_view_action;
} }
void MicroProfileDialog::showEvent(QShowEvent* ev) { void MicroProfileDialog::showEvent(QShowEvent* event) {
if (toggle_view_action) { if (toggle_view_action) {
toggle_view_action->setChecked(isVisible()); 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) { if (toggle_view_action) {
toggle_view_action->setChecked(isVisible()); toggle_view_action->setChecked(isVisible());
} }
QWidget::hideEvent(ev); QWidget::hideEvent(event);
} }
#if MICROPROFILE_ENABLED #if MICROPROFILE_ENABLED
@ -112,7 +112,7 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) {
connect(&update_timer, &QTimer::timeout, this, qOverload<>(&MicroProfileWidget::update)); connect(&update_timer, &QTimer::timeout, this, qOverload<>(&MicroProfileWidget::update));
} }
void MicroProfileWidget::paintEvent(QPaintEvent* ev) { void MicroProfileWidget::paintEvent([[maybe_unused]] QPaintEvent* event) {
QPainter painter(this); QPainter painter(this);
// The units used by Microprofile for drawing are based in pixels on a 96 dpi display. // 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; mp_painter = nullptr;
} }
void MicroProfileWidget::showEvent(QShowEvent* ev) { void MicroProfileWidget::showEvent(QShowEvent* event) {
update_timer.start(15); // ~60 Hz 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(); update_timer.stop();
QWidget::hideEvent(ev); QWidget::hideEvent(event);
} }
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { void MicroProfileWidget::mouseMoveEvent(QMouseEvent* event) {
MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
ev->accept(); event->accept();
} }
void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { void MicroProfileWidget::mousePressEvent(QMouseEvent* event) {
MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
ev->accept(); event->accept();
} }
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* event) {
MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, 0); MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
ev->accept(); event->accept();
} }
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { void MicroProfileWidget::wheelEvent(QWheelEvent* event) {
MicroProfileMousePosition(ev->x() / x_scale, ev->y() / y_scale, ev->delta() / 120); MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, event->delta() / 120);
ev->accept(); event->accept();
} }
void MicroProfileWidget::keyPressEvent(QKeyEvent* ev) { void MicroProfileWidget::keyPressEvent(QKeyEvent* event) {
if (ev->key() == Qt::Key_Control) { if (event->key() == Qt::Key_Control) {
// Inform MicroProfile that the user is holding Ctrl. // Inform MicroProfile that the user is holding Ctrl.
MicroProfileModKey(1); MicroProfileModKey(1);
} }
QWidget::keyPressEvent(ev); QWidget::keyPressEvent(event);
} }
void MicroProfileWidget::keyReleaseEvent(QKeyEvent* ev) { void MicroProfileWidget::keyReleaseEvent(QKeyEvent* event) {
if (ev->key() == Qt::Key_Control) { if (event->key() == Qt::Key_Control) {
MicroProfileModKey(0); MicroProfileModKey(0);
} }
QWidget::keyReleaseEvent(ev); QWidget::keyReleaseEvent(event);
} }
// These functions are called by MicroProfileDraw to draw the interface elements on the screen. // These functions are called by MicroProfileDraw to draw the interface elements on the screen.

View File

@ -17,8 +17,8 @@ public:
QAction* toggleViewAction(); QAction* toggleViewAction();
protected: protected:
void showEvent(QShowEvent* ev) override; void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent* ev) override; void hideEvent(QHideEvent* event) override;
private: private:
QAction* toggle_view_action = nullptr; QAction* toggle_view_action = nullptr;

View File

@ -83,9 +83,9 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList()
const auto& threads = const auto& threads =
Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList(); Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList();
item_list.reserve(item_list.size() + threads.size()); item_list.reserve(item_list.size() + threads.size());
for (std::size_t i = 0; i < threads.size(); ++i) { for (std::size_t j = 0; j < threads.size(); ++j) {
item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i])); item_list.push_back(std::make_unique<WaitTreeThread>(*threads[j]));
item_list.back()->row = i; item_list.back()->row = j;
} }
} }
return item_list; return item_list;

View File

@ -768,6 +768,6 @@ void GameListPlaceholder::onUpdateThemedIcons() {
image->setPixmap(QIcon::fromTheme(QStringLiteral("plus_folder")).pixmap(200)); image->setPixmap(QIcon::fromTheme(QStringLiteral("plus_folder")).pixmap(200));
} }
void GameListPlaceholder::mouseDoubleClickEvent(QMouseEvent* event) { void GameListPlaceholder::mouseDoubleClickEvent([[maybe_unused]] QMouseEvent* event) {
emit GameListPlaceholder::AddDirectory(); emit GameListPlaceholder::AddDirectory();
} }

View File

@ -3,21 +3,16 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <unordered_map> #include <unordered_map>
#include <QBuffer>
#include <QByteArray>
#include <QGraphicsOpacityEffect> #include <QGraphicsOpacityEffect>
#include <QHBoxLayout>
#include <QIODevice>
#include <QImage> #include <QImage>
#include <QLabel> #include <QLabel>
#include <QPainter> #include <QPainter>
#include <QPalette>
#include <QPixmap> #include <QPixmap>
#include <QProgressBar> #include <QProgressBar>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QString>
#include <QStyleOption> #include <QStyleOption>
#include <QTime> #include <QTime>
#include <QtConcurrent/QtConcurrentRun>
#include "citra_qt/loading_screen.h" #include "citra_qt/loading_screen.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"

View File

@ -6,7 +6,6 @@
#include <chrono> #include <chrono>
#include <memory> #include <memory>
#include <QString>
#include <QWidget> #include <QWidget>
namespace Loader { namespace Loader {

View File

@ -1459,7 +1459,6 @@ void GMainWindow::InstallCIA(QStringList filepaths) {
progress_bar->setMaximum(INT_MAX); progress_bar->setMaximum(INT_MAX);
QtConcurrent::run([&, filepaths] { QtConcurrent::run([&, filepaths] {
QString current_path;
Service::AM::InstallStatus status; Service::AM::InstallStatus status;
const auto cia_progress = [&](std::size_t written, std::size_t total) { const auto cia_progress = [&](std::size_t written, std::size_t total) {
emit UpdateProgress(written, total); emit UpdateProgress(written, total);
@ -2102,15 +2101,15 @@ void GMainWindow::OnMouseActivity() {
ShowMouseCursor(); ShowMouseCursor();
} }
void GMainWindow::mouseMoveEvent(QMouseEvent* event) { void GMainWindow::mouseMoveEvent([[maybe_unused]] QMouseEvent* event) {
OnMouseActivity(); OnMouseActivity();
} }
void GMainWindow::mousePressEvent(QMouseEvent* event) { void GMainWindow::mousePressEvent([[maybe_unused]] QMouseEvent* event) {
OnMouseActivity(); OnMouseActivity();
} }
void GMainWindow::mouseReleaseEvent(QMouseEvent* event) { void GMainWindow::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) {
OnMouseActivity(); OnMouseActivity();
} }

View File

@ -232,9 +232,8 @@ bool MultiplayerState::OnCloseRoom() {
return true; return true;
} }
// Save ban list // 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(); room->Destroy();
announce_multiplayer_session->Stop(); announce_multiplayer_session->Stop();
LOG_DEBUG(Frontend, "Closed the room (as a server)"); LOG_DEBUG(Frontend, "Closed the room (as a server)");

View File

@ -133,8 +133,9 @@ bool UpdaterPrivate::StartUpdateCheck() {
connect(main_process, connect(main_process,
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this,
&UpdaterPrivate::UpdaterReady, Qt::QueuedConnection); &UpdaterPrivate::UpdaterReady, Qt::QueuedConnection);
connect(main_process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), connect(main_process,
this, &UpdaterPrivate::UpdaterError, Qt::QueuedConnection); static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::errorOccurred), this,
&UpdaterPrivate::UpdaterError, Qt::QueuedConnection);
main_process->start(QIODevice::ReadOnly); main_process->start(QIODevice::ReadOnly);
running = true; running = true;

View File

@ -4,8 +4,9 @@
#include "citra_qt/util/clickable_label.h" #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(); emit clicked();
} }

View File

@ -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<std::shared_mutex> lock(cheats_list_mutex); std::shared_lock<std::shared_mutex> lock(cheats_list_mutex);
for (auto& cheat : cheats_list) { for (auto& cheat : cheats_list) {

View File

@ -35,7 +35,7 @@ public:
private: private:
void LoadCheatFile(); void LoadCheatFile();
void RunCallback(u64 userdata, int cycles_late); void RunCallback(u64 userdata, s64 cycles_late);
std::vector<std::shared_ptr<CheatBase>> cheats_list; std::vector<std::shared_ptr<CheatBase>> cheats_list;
mutable std::shared_mutex cheats_list_mutex; mutable std::shared_mutex cheats_list_mutex;
Core::TimingEventType* event; Core::TimingEventType* event;

View File

@ -198,7 +198,7 @@ GatewayCheat::CheatLine::CheatLine(const std::string& line) {
address = first & 0x0FFFFFFF; address = first & 0x0FFFFFFF;
value = std::stoul(line.substr(9, 8), 0, 16); value = std::stoul(line.substr(9, 8), 0, 16);
cheat_line = line; cheat_line = line;
} catch (const std::logic_error& e) { } catch (const std::logic_error&) {
type = CheatType::Null; type = CheatType::Null;
cheat_line = line; cheat_line = line;
LOG_ERROR(Core_Cheats, "Cheat contains invalid line: {}", line); LOG_ERROR(Core_Cheats, "Cheat contains invalid line: {}", line);

View File

@ -15,8 +15,8 @@
namespace FileSys::Patch { namespace FileSys::Patch {
bool ApplyIpsPatch(const std::vector<u8>& ips, std::vector<u8>& buffer) { bool ApplyIpsPatch(const std::vector<u8>& ips, std::vector<u8>& buffer) {
u32 cursor = 5; std::size_t cursor = 5;
u32 patch_length = ips.size() - 3; std::size_t patch_length = ips.size() - 3;
std::string ips_header(ips.begin(), ips.begin() + 5); std::string ips_header(ips.begin(), ips.begin() + 5);
if (ips_header != "PATCH") { if (ips_header != "PATCH") {
@ -30,7 +30,7 @@ bool ApplyIpsPatch(const std::vector<u8>& ips, std::vector<u8>& buffer) {
if (eof_check == "EOF") if (eof_check == "EOF")
return false; 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]; std::size_t length = ips[cursor + 3] << 8 | ips[cursor + 4];
// check for an rle record // check for an rle record

View File

@ -459,8 +459,8 @@ void CSND_SND::ReleaseCapUnit(Kernel::HLERequestContext& ctx) {
void CSND_SND::FlushDataCache(Kernel::HLERequestContext& ctx) { void CSND_SND::FlushDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x9, 2, 2); IPC::RequestParser rp(ctx, 0x9, 2, 2);
const VAddr address = rp.Pop<u32>(); [[maybe_unused]] const VAddr address = rp.Pop<u32>();
const u32 size = rp.Pop<u32>(); [[maybe_unused]] const u32 size = rp.Pop<u32>();
const auto process = rp.PopObject<Kernel::Process>(); const auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); 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) { void CSND_SND::StoreDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0xA, 2, 2); IPC::RequestParser rp(ctx, 0xA, 2, 2);
const VAddr address = rp.Pop<u32>(); [[maybe_unused]] const VAddr address = rp.Pop<u32>();
const u32 size = rp.Pop<u32>(); [[maybe_unused]] const u32 size = rp.Pop<u32>();
const auto process = rp.PopObject<Kernel::Process>(); const auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); 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) { void CSND_SND::InvalidateDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0xB, 2, 2); IPC::RequestParser rp(ctx, 0xB, 2, 2);
const VAddr address = rp.Pop<u32>(); [[maybe_unused]] const VAddr address = rp.Pop<u32>();
const u32 size = rp.Pop<u32>(); [[maybe_unused]] const u32 size = rp.Pop<u32>();
const auto process = rp.PopObject<Kernel::Process>(); const auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);

View File

@ -202,8 +202,8 @@ void DSP_DSP::UnloadComponent(Kernel::HLERequestContext& ctx) {
void DSP_DSP::FlushDataCache(Kernel::HLERequestContext& ctx) { void DSP_DSP::FlushDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x13, 2, 2); IPC::RequestParser rp(ctx, 0x13, 2, 2);
const VAddr address = rp.Pop<u32>(); [[maybe_unused]] const VAddr address = rp.Pop<u32>();
const u32 size = rp.Pop<u32>(); [[maybe_unused]] const u32 size = rp.Pop<u32>();
const auto process = rp.PopObject<Kernel::Process>(); const auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); 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) { void DSP_DSP::InvalidateDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x14, 2, 2); IPC::RequestParser rp(ctx, 0x14, 2, 2);
const VAddr address = rp.Pop<u32>(); [[maybe_unused]] const VAddr address = rp.Pop<u32>();
const u32 size = rp.Pop<u32>(); [[maybe_unused]] const u32 size = rp.Pop<u32>();
const auto process = rp.PopObject<Kernel::Process>(); const auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);

View File

@ -236,7 +236,7 @@ private:
template <SwizzlePattern::Selector (SwizzlePattern::*getter)(int) const> template <SwizzlePattern::Selector (SwizzlePattern::*getter)(int) const>
std::string GetSelectorSrc(const SwizzlePattern& pattern) { std::string GetSelectorSrc(const SwizzlePattern& pattern) {
std::string out; std::string out;
for (std::size_t i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
switch ((pattern.*getter)(i)) { switch ((pattern.*getter)(i)) {
case SwizzlePattern::Selector::x: case SwizzlePattern::Selector::x:
out += 'x'; out += 'x';

View File

@ -30,7 +30,7 @@ void from_json(const nlohmann::json& json, Room::Member& member) {
try { try {
member.username = json.at("username").get<std::string>(); member.username = json.at("username").get<std::string>();
member.avatar_url = json.at("avatarUrl").get<std::string>(); member.avatar_url = json.at("avatarUrl").get<std::string>();
} catch (const nlohmann::detail::out_of_range& e) { } catch (const nlohmann::detail::out_of_range&) {
member.username = member.avatar_url = ""; member.username = member.avatar_url = "";
LOG_DEBUG(Network, "Member \'{}\' isn't authenticated", member.nickname); 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<std::string>(); room.name = json.at("name").get<std::string>();
try { try {
room.description = json.at("description").get<std::string>(); room.description = json.at("description").get<std::string>();
} catch (const nlohmann::detail::out_of_range& e) { } catch (const nlohmann::detail::out_of_range&) {
room.description = ""; room.description = "";
LOG_DEBUG(Network, "Room \'{}\' doesn't contain a description", room.name); LOG_DEBUG(Network, "Room \'{}\' doesn't contain a description", room.name);
} }