diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index f9aeb692a4..75d2cc8fff 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp @@ -135,7 +135,7 @@ void Fiber::YieldTo(std::weak_ptr weak_from, Fiber& to) { } std::shared_ptr Fiber::ThreadToFiber() { - std::shared_ptr fiber = std::shared_ptr{new Fiber()}; + auto fiber = std::make_shared(); fiber->impl->guard.lock(); fiber->impl->is_thread_fiber = true; return fiber; diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h index 7272ac6e8d..f23e19da18 100644 --- a/src/common/threadsafe_queue.h +++ b/src/common/threadsafe_queue.h @@ -120,7 +120,7 @@ private: // and a pointer to the next ElementPtr class ElementPtr { public: - ElementPtr() {} + ElementPtr() = default; ~ElementPtr() { ElementPtr* next_ptr = next.load(); diff --git a/src/core/hle/kernel/slab_helpers.h b/src/core/hle/kernel/slab_helpers.h index 299a981a8a..1e3eda7ff7 100644 --- a/src/core/hle/kernel/slab_helpers.h +++ b/src/core/hle/kernel/slab_helpers.h @@ -67,7 +67,7 @@ private: public: KAutoObjectWithSlabHeapAndContainer(KernelCore& kernel_) : Base(kernel_), kernel(kernel_) {} - virtual ~KAutoObjectWithSlabHeapAndContainer() {} + virtual ~KAutoObjectWithSlabHeapAndContainer() = default; virtual void Destroy() override { const bool is_initialized = this->IsInitialized(); diff --git a/src/core/hle/service/jit/jit_context.cpp b/src/core/hle/service/jit/jit_context.cpp index 19bd85b6c2..5d7b2ec295 100644 --- a/src/core/hle/service/jit/jit_context.cpp +++ b/src/core/hle/service/jit/jit_context.cpp @@ -409,7 +409,7 @@ void DynarmicCallbacks64::InterpreterFallback(u64 pc, size_t num_instructions) { JITContext::JITContext(Core::Memory::Memory& memory) : impl{std::make_unique(memory)} {} -JITContext::~JITContext() {} +JITContext::~JITContext() = default; bool JITContext::LoadNRO(std::span data) { return impl->LoadNRO(data); diff --git a/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp b/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp index dc9b2a9ecd..c4dc20cc27 100644 --- a/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp +++ b/src/core/hle/service/nvflinger/hos_binder_driver_server.cpp @@ -11,7 +11,7 @@ namespace Service::NVFlinger { HosBinderDriverServer::HosBinderDriverServer(Core::System& system_) : service_context(system_, "HosBinderDriverServer") {} -HosBinderDriverServer::~HosBinderDriverServer() {} +HosBinderDriverServer::~HosBinderDriverServer() = default; u64 HosBinderDriverServer::RegisterProducer(std::unique_ptr&& binder) { std::scoped_lock lk{lock}; diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 9d676612ce..c96431d905 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -135,7 +135,7 @@ private: class RescalingPushConstant { public: - explicit RescalingPushConstant() noexcept {} + explicit RescalingPushConstant() noexcept = default; void PushTexture(bool is_rescaled) noexcept { *texture_ptr |= is_rescaled ? texture_bit : 0u; diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 58b0c2f10f..35e2d0118c 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -105,7 +105,7 @@ struct Client::Impl { httplib::Request request; request.method = method; request.path = path; - request.headers = params; + request.headers = std::move(params); request.body = data; httplib::Response response; diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index b4f5d172aa..418e3abbbf 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -234,7 +234,6 @@ QString ConfigureInputPlayer::AnalogToText(const Common::ParamPackage& param, return QObject::tr("[unknown]"); } - const auto engine_str = param.Get("engine", ""); const QString axis_x_str = QString::fromStdString(param.Get("axis_x", "")); const QString axis_y_str = QString::fromStdString(param.Get("axis_y", "")); const bool invert_x = param.Get("invert_x", "+") == "-"; diff --git a/src/yuzu/configuration/configure_per_game_addons.cpp b/src/yuzu/configuration/configure_per_game_addons.cpp index 7893a85bb9..5a71ddcb18 100644 --- a/src/yuzu/configuration/configure_per_game_addons.cpp +++ b/src/yuzu/configuration/configure_per_game_addons.cpp @@ -86,7 +86,7 @@ void ConfigurePerGameAddons::ApplyConfiguration() { "game_list" / fmt::format("{:016X}.pv.txt", title_id)); } - Settings::values.disabled_addons[title_id] = disabled_addons; + Settings::values.disabled_addons[title_id] = std::move(disabled_addons); } void ConfigurePerGameAddons::LoadFromFile(FileSys::VirtualFile file) { diff --git a/src/yuzu/configuration/configure_ringcon.cpp b/src/yuzu/configuration/configure_ringcon.cpp index 4fcc22b7a8..8badb88526 100644 --- a/src/yuzu/configuration/configure_ringcon.cpp +++ b/src/yuzu/configuration/configure_ringcon.cpp @@ -392,7 +392,6 @@ QString ConfigureRingController::AnalogToText(const Common::ParamPackage& param, return QObject::tr("[unknown]"); } - const auto engine_str = param.Get("engine", ""); const QString axis_x_str = QString::fromStdString(param.Get("axis_x", "")); const QString axis_y_str = QString::fromStdString(param.Get("axis_y", "")); const bool invert_x = param.Get("invert_x", "+") == "-"; diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 8f486a131c..0ed7133253 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp @@ -131,6 +131,7 @@ std::vector> WaitTreeMutexInfo::GetChildren() cons const bool has_waiters = (mutex_value & Kernel::Svc::HandleWaitMask) != 0; std::vector> list; + list.reserve(3); list.push_back(std::make_unique(tr("has waiters: %1").arg(has_waiters))); list.push_back(std::make_unique( tr("owner handle: 0x%1").arg(owner_handle, 8, 16, QLatin1Char{'0'}))); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index fc16f0f0c4..8f224b890a 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -159,7 +159,7 @@ void Config::ReadValues() { "ControlsGeneral", std::string("debug_pad_") + Settings::NativeButton::mapping[i], default_param); if (Settings::values.debug_pad_buttons[i].empty()) - Settings::values.debug_pad_buttons[i] = default_param; + Settings::values.debug_pad_buttons[i] = std::move(default_param); } for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { @@ -170,7 +170,7 @@ void Config::ReadValues() { "ControlsGeneral", std::string("debug_pad_") + Settings::NativeAnalog::mapping[i], default_param); if (Settings::values.debug_pad_analogs[i].empty()) - Settings::values.debug_pad_analogs[i] = default_param; + Settings::values.debug_pad_analogs[i] = std::move(default_param); } ReadSetting("ControlsGeneral", Settings::values.vibration_enabled);