From 7903f6fbfca54f1a403e9e92fb4812cbe85f6621 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:35:14 -0500 Subject: [PATCH 1/6] Warnings/Network: Handle ENET_EVENT_TYPE_NONE and ENET_EVENT_TYPE_CONNECT in the network packet loop. ENET_EVENT_TYPE_NONE is basically a no-op. ENET_EVENT_TYPE_CONNECT should not happen since we are already connected. Assert in case we do receive it. --- src/network/room_member.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/network/room_member.cpp b/src/network/room_member.cpp index 5814fe12a..e43004027 100644 --- a/src/network/room_member.cpp +++ b/src/network/room_member.cpp @@ -242,6 +242,13 @@ void RoomMember::RoomMemberImpl::MemberLoop() { SetError(Error::LostConnection); } break; + case ENET_EVENT_TYPE_NONE: + break; + case ENET_EVENT_TYPE_CONNECT: + // The ENET_EVENT_TYPE_CONNECT event can not possibly happen here because we're + // already connected + ASSERT_MSG(false, "Received unexpected connect event while already connected"); + break; } } { From d17557c02ce23933c94c052d148213c2b54c4c8e Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:35:53 -0500 Subject: [PATCH 2/6] Warnings/Network: Initialize the members of Room::RoomImpl in the order they are defined. --- src/network/room.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/room.cpp b/src/network/room.cpp index e1b6b77d3..342a2541b 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -53,7 +53,7 @@ public: mutable std::mutex ban_list_mutex; ///< Mutex for the ban lists RoomImpl() - : random_gen(std::random_device()()), NintendoOUI{0x00, 0x1F, 0x32, 0x00, 0x00, 0x00} {} + : NintendoOUI{0x00, 0x1F, 0x32, 0x00, 0x00, 0x00}, random_gen(std::random_device()()) {} /// Thread that receives and dispatches network packets std::unique_ptr room_thread; From 64b612bd6085ec848b82c6f59c96c7c3f48643c2 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:37:45 -0500 Subject: [PATCH 3/6] Warnings/GLWindow: Initialize the members of OpenGLWindow in the order they are defined. --- src/citra_qt/bootmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 2f6ab6829..ddabad13b 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -104,8 +104,8 @@ void EmuThread::run() { } OpenGLWindow::OpenGLWindow(QWindow* parent, QWidget* event_handler, QOpenGLContext* shared_context) - : QWindow(parent), event_handler(event_handler), - context(new QOpenGLContext(shared_context->parent())) { + : QWindow(parent), context(new QOpenGLContext(shared_context->parent())), + event_handler(event_handler) { // disable vsync for any shared contexts auto format = shared_context->format(); From b80911162f6863335082786c46e51c39ad0ca1cc Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:39:40 -0500 Subject: [PATCH 4/6] Warnings/QtMotionControls: There is no need to use std::move after std::make_unique. This fixes a Clang warning about the move preventing copy elision (-Wpessimizing-move) --- src/citra_qt/configuration/configure_motion_touch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/configuration/configure_motion_touch.cpp b/src/citra_qt/configuration/configure_motion_touch.cpp index c1961d71e..a5457cdf7 100644 --- a/src/citra_qt/configuration/configure_motion_touch.cpp +++ b/src/citra_qt/configuration/configure_motion_touch.cpp @@ -30,7 +30,7 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent, setLayout(layout); using namespace InputCommon::CemuhookUDP; - job = std::move(std::make_unique( + job = std::make_unique( host, port, pad_index, client_id, [this](CalibrationConfigurationJob::Status status) { QString text; @@ -56,7 +56,7 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent, min_y = min_y_; max_x = max_x_; max_y = max_y_; - })); + }); } CalibrationConfigurationDialog::~CalibrationConfigurationDialog() = default; From 47417e762b3f217d578aebb42da1c4a19f06c75f Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:40:56 -0500 Subject: [PATCH 5/6] Warnings/Qt: Removed unused variable from lambda capture list. --- src/citra_qt/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index f47e359a0..1f2a71286 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1232,7 +1232,7 @@ void GMainWindow::OnGameListDumpRomFS(QString game_path, u64 program_id) { using FutureWatcher = QFutureWatcher>; auto* future_watcher = new FutureWatcher(this); connect(future_watcher, &FutureWatcher::finished, - [this, program_id, dialog, base_path, update_path, future_watcher] { + [this, dialog, base_path, update_path, future_watcher] { dialog->hide(); const auto& [base, update] = future_watcher->result(); if (base != Loader::ResultStatus::Success) { From 0e88940df182a5e67510e891f90deb5e857faa7c Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Apr 2020 18:42:57 -0500 Subject: [PATCH 6/6] Warnings/Thread: Added missing case for the Dormant thread status in ResumeFromWait. --- src/core/hle/kernel/thread.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 47d8cb1df..c86a0fb86 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -194,6 +194,7 @@ void Thread::ResumeFromWait() { case ThreadStatus::WaitArb: case ThreadStatus::WaitSleep: case ThreadStatus::WaitIPC: + case ThreadStatus::Dormant: break; case ThreadStatus::Ready: