diff --git a/src/android/app/src/main/jni/game_info.h b/src/android/app/src/main/jni/game_info.h index ad3254aabd..7b9750fe22 100644 --- a/src/android/app/src/main/jni/game_info.h +++ b/src/android/app/src/main/jni/game_info.h @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "common/common_types.h" diff --git a/src/android/app/src/main/jni/input_manager.h b/src/android/app/src/main/jni/input_manager.h index 637eeb67b9..31d4b756e9 100644 --- a/src/android/app/src/main/jni/input_manager.h +++ b/src/android/app/src/main/jni/input_manager.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include #include "core/frontend/input.h" diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 43dc55bbda..9c0e022fbc 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -3,8 +3,6 @@ // Refer to the license.txt file included. #include -#include -#include #include #include @@ -666,6 +664,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_InstallCIAS(JNIEnv* env, [[maybe_un jobjectArray path) { const jsize count{env->GetArrayLength(path)}; std::vector paths; + paths.reserve(count); for (jsize idx{0}; idx < count; ++idx) { paths.emplace_back( GetJString(env, static_cast(env->GetObjectArrayElement(path, idx)))); diff --git a/src/audio_core/lle/lle.cpp b/src/audio_core/lle/lle.cpp index b83e0676bb..fbb6f1f07e 100644 --- a/src/audio_core/lle/lle.cpp +++ b/src/audio_core/lle/lle.cpp @@ -69,6 +69,7 @@ Dsp1::Dsp1(const std::vector& raw) { Header header; std::memcpy(&header, raw.data(), sizeof(header)); recv_data_on_start = header.recv_data_on_start != 0; + segments.reserve(header.num_segments); for (u32 i = 0; i < header.num_segments; ++i) { Segment segment; segment.data = diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 7e155830b3..d8d93a9a87 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include "citra/config.h" diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index f3311d98fc..b74c707313 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include "common/common_types.h" #include "core/frontend/emu_window.h" struct SDL_Window; diff --git a/src/citra/emu_window/emu_window_sdl2_gl.cpp b/src/citra/emu_window/emu_window_sdl2_gl.cpp index f0256fc1e5..090050ef93 100644 --- a/src/citra/emu_window/emu_window_sdl2_gl.cpp +++ b/src/citra/emu_window/emu_window_sdl2_gl.cpp @@ -10,6 +10,7 @@ #include #include "citra/emu_window/emu_window_sdl2_gl.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "video_core/renderer_base.h" #include "video_core/video_core.h" diff --git a/src/citra/emu_window/emu_window_sdl2_sw.cpp b/src/citra/emu_window/emu_window_sdl2_sw.cpp index 0bc794b8d4..e9d047bb9e 100644 --- a/src/citra/emu_window/emu_window_sdl2_sw.cpp +++ b/src/citra/emu_window/emu_window_sdl2_sw.cpp @@ -11,6 +11,7 @@ #include "citra/emu_window/emu_window_sdl2_sw.h" #include "common/color.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "core/frontend/emu_window.h" #include "core/hw/gpu.h" #include "core/memory.h" diff --git a/src/citra_qt/applets/mii_selector.h b/src/citra_qt/applets/mii_selector.h index c3b6eabb25..c345493443 100644 --- a/src/citra_qt/applets/mii_selector.h +++ b/src/citra_qt/applets/mii_selector.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "core/frontend/applets/mii_selector.h" diff --git a/src/citra_qt/applets/swkbd.cpp b/src/citra_qt/applets/swkbd.cpp index ce01a8496f..44e6c5738f 100644 --- a/src/citra_qt/applets/swkbd.cpp +++ b/src/citra_qt/applets/swkbd.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index c740f5dd73..fcb268d32c 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include "citra_qt/configuration/config.h" diff --git a/src/citra_qt/configuration/configure_input.h b/src/citra_qt/configuration/configure_input.h index b6867a39c1..fb00444c65 100644 --- a/src/citra_qt/configuration/configure_input.h +++ b/src/citra_qt/configuration/configure_input.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include "common/param_package.h" diff --git a/src/citra_qt/debugger/ipc/recorder.h b/src/citra_qt/debugger/ipc/recorder.h index 63b1907901..aa02041e86 100644 --- a/src/citra_qt/debugger/ipc/recorder.h +++ b/src/citra_qt/debugger/ipc/recorder.h @@ -4,9 +4,7 @@ #pragma once -#include #include -#include #include #include "core/hle/kernel/ipc_debugger/recorder.h" diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 9f195f1ee9..06ae3bdaa2 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -214,6 +214,7 @@ void MicroProfileDrawLine2D(u32 vertices_length, float* vertices, u32 hex_color) // the allocation across calls. static std::vector point_buf; + point_buf.reserve(vertices_length); for (u32 i = 0; i < vertices_length; ++i) { point_buf.emplace_back(vertices[i * 2 + 0], vertices[i * 2 + 1]); } diff --git a/src/citra_qt/debugger/wait_tree.cpp b/src/citra_qt/debugger/wait_tree.cpp index 5892ce48c4..6d09457fdd 100644 --- a/src/citra_qt/debugger/wait_tree.cpp +++ b/src/citra_qt/debugger/wait_tree.cpp @@ -77,8 +77,9 @@ std::size_t WaitTreeItem::Row() const { } std::vector> WaitTreeItem::MakeThreadItemList() { - u32 num_cores = Core::GetNumCores(); + const u32 num_cores = Core::GetNumCores(); std::vector> item_list; + item_list.reserve(num_cores); for (u32 i = 0; i < num_cores; ++i) { const auto& threads = Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList(); diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index c4f1f24651..9fe4b4c0e6 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -32,6 +32,7 @@ #include "common/settings.h" #include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/archive_source_sd_savedata.h" +#include "core/hle/service/am/am.h" #include "core/hle/service/fs/archive.h" #include "qcursor.h" diff --git a/src/citra_qt/game_list_worker.h b/src/citra_qt/game_list_worker.h index 4decfa37f5..b5ca89463d 100644 --- a/src/citra_qt/game_list_worker.h +++ b/src/citra_qt/game_list_worker.h @@ -5,10 +5,8 @@ #pragma once #include -#include #include #include -#include #include #include #include diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 34b5319e68..5464689147 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -3,8 +3,6 @@ // Refer to the license.txt file included. #include -#include -#include #include #include #include @@ -87,6 +85,7 @@ #include "core/file_sys/archive_source_sd_savedata.h" #include "core/frontend/applets/default_applets.h" #include "core/gdbstub/gdbstub.h" +#include "core/hle/service/am/am.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/nfc/nfc.h" diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 6ee7dc5625..a36fd83c5f 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -13,7 +13,6 @@ #include "citra_qt/hotkeys.h" #include "common/announce_multiplayer_room.h" #include "core/core.h" -#include "core/hle/service/am/am.h" #include "core/savestate.h" #ifdef __unix__ @@ -58,6 +57,10 @@ namespace Ui { class MainWindow; } +namespace Service::AM { +enum class InstallStatus : u32; +} + class GMainWindow : public QMainWindow { Q_OBJECT diff --git a/src/common/android_storage.cpp b/src/common/android_storage.cpp index d5975ee771..a18ecefac7 100644 --- a/src/common/android_storage.cpp +++ b/src/common/android_storage.cpp @@ -141,7 +141,8 @@ std::vector GetFilesName(const std::string& filepath) { jstring j_filepath = env->NewStringUTF(filepath.c_str()); auto j_object = (jobjectArray)env->CallStaticObjectMethod(native_library, get_files_name, j_filepath); - jsize j_size = env->GetArrayLength(j_object); + const jsize j_size = env->GetArrayLength(j_object); + vector.reserve(j_size); for (int i = 0; i < j_size; i++) { auto string = (jstring)(env->GetObjectArrayElement(j_object, i)); vector.emplace_back(env->GetStringUTFChars(string, nullptr)); diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 4ec3af1af4..53434df309 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -33,7 +33,6 @@ #include #include #include -#include "common/common_funcs.h" #include "common/swap.h" /* diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index ce9dfba67d..da4bcd6e03 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include #include diff --git a/src/common/file_util.h b/src/common/file_util.h index 6c04ff5610..41e2af8450 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -6,8 +6,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index db015c1b70..bbf0b48f9f 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -3,12 +3,10 @@ // Refer to the license.txt file included. #include -#include #include #include #include #include -#include #include #include #ifdef _WIN32 diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index dc8d62d2a5..396560eaf5 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -5,7 +5,6 @@ #define CITRA_IGNORE_EXIT(x) #include -#include #include #include "common/common_types.h" #include "common/logging/log.h" diff --git a/src/core/arm/skyeye_common/vfp/vfp_helper.h b/src/core/arm/skyeye_common/vfp/vfp_helper.h index 3c1da2407d..53d7ae6702 100644 --- a/src/core/arm/skyeye_common/vfp/vfp_helper.h +++ b/src/core/arm/skyeye_common/vfp/vfp_helper.h @@ -32,7 +32,6 @@ #pragma once -#include #include "common/common_types.h" #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" diff --git a/src/core/core.cpp b/src/core/core.cpp index 4dddfb5e14..60cd7a61cb 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include #include @@ -377,6 +376,7 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, *memory, *timing, [this] { PrepareReschedule(); }, system_mode, num_cores, n3ds_mode); exclusive_monitor = MakeExclusiveMonitor(*memory, num_cores); + cpu_cores.reserve(num_cores); if (Settings::values.use_cpu_jit) { #if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64) for (u32 i = 0; i < num_cores; ++i) { diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index a865bd4aac..41a80b3fab 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/core/dumping/ffmpeg_backend.cpp b/src/core/dumping/ffmpeg_backend.cpp index f4ef07308c..ee9f36130d 100644 --- a/src/core/dumping/ffmpeg_backend.cpp +++ b/src/core/dumping/ffmpeg_backend.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include #include "common/assert.h" #include "common/file_util.h" #include "common/logging/log.h" diff --git a/src/core/file_sys/archive_ncch.cpp b/src/core/file_sys/archive_ncch.cpp index 23a7f98c27..142b6d2fea 100644 --- a/src/core/file_sys/archive_ncch.cpp +++ b/src/core/file_sys/archive_ncch.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include #include diff --git a/src/core/file_sys/archive_selfncch.cpp b/src/core/file_sys/archive_selfncch.cpp index e4f7218a75..5cf0362784 100644 --- a/src/core/file_sys/archive_selfncch.cpp +++ b/src/core/file_sys/archive_selfncch.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include "common/archives.h" #include "common/common_types.h" #include "common/logging/log.h" diff --git a/src/core/file_sys/cia_container.cpp b/src/core/file_sys/cia_container.cpp index 5764a76329..8cd987ee06 100644 --- a/src/core/file_sys/cia_container.cpp +++ b/src/core/file_sys/cia_container.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "common/alignment.h" #include "common/file_util.h" diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index cf1a3c5675..e3e95a08f1 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include "common/archives.h" #include "common/common_types.h" diff --git a/src/core/file_sys/ncch_container.cpp b/src/core/file_sys/ncch_container.cpp index 4592c67237..1e1b1ec44f 100644 --- a/src/core/file_sys/ncch_container.cpp +++ b/src/core/file_sys/ncch_container.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include #include diff --git a/src/core/file_sys/plugin_3gx.cpp b/src/core/file_sys/plugin_3gx.cpp index 61928982de..dcb73005e6 100644 --- a/src/core/file_sys/plugin_3gx.cpp +++ b/src/core/file_sys/plugin_3gx.cpp @@ -112,6 +112,7 @@ Loader::ResultStatus FileSys::Plugin3GXLoader::Load( header.targets.count * sizeof(u32))) { return Loader::ResultStatus::Error; } + compatible_TID.reserve(header.targets.count); // compatible_TID should be empty right now for (u32 i = 0; i < u32(header.targets.count); i++) { compatible_TID.push_back( u32_le(*reinterpret_cast(raw_TID_data.data() + i * sizeof(u32)))); diff --git a/src/core/file_sys/title_metadata.cpp b/src/core/file_sys/title_metadata.cpp index e25d2d2383..f028b52d48 100644 --- a/src/core/file_sys/title_metadata.cpp +++ b/src/core/file_sys/title_metadata.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "common/alignment.h" #include "common/file_util.h" diff --git a/src/core/frontend/applets/swkbd.h b/src/core/frontend/applets/swkbd.h index f38f23d65e..8e3ae3e8b4 100644 --- a/src/core/frontend/applets/swkbd.h +++ b/src/core/frontend/applets/swkbd.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include #include "common/assert.h" diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 8dcb6354de..ce11833618 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h @@ -5,7 +5,10 @@ #pragma once #include "common/math_util.h" -#include "common/settings.h" + +namespace Settings { +enum class LayoutOption : u32; +} namespace Layout { diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 073ecdc0e6..0fab5418bf 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index b10795b76e..d8b03704de 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -18,23 +18,6 @@ #include "core/hle/applets/swkbd.h" #include "core/hle/result.h" -//////////////////////////////////////////////////////////////////////////////////////////////////// - -// Specializes std::hash for AppletId, so that we can use it in std::unordered_map. -// Workaround for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970 -namespace std { -template <> -struct hash { - typedef Service::APT::AppletId argument_type; - typedef std::size_t result_type; - - result_type operator()(const argument_type& id_code) const { - typedef std::underlying_type::type Type; - return std::hash()(static_cast(id_code)); - } -}; -} // namespace std - namespace HLE::Applets { static std::unordered_map> applets; diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 9f26847b03..04536002bf 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include "common/archives.h" #include "common/assert.h" diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index 5ef9de3d42..680503f426 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -3,8 +3,6 @@ // Refer to the license.txt file included. #include -#include -#include #include #include #include diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 77a5fe9036..cf2621ed88 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include #include "common/archives.h" #include "common/assert.h" diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 0d7c4894d1..4c075b541e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -4,8 +4,6 @@ #include #include -#include -#include #include #include "common/logging/log.h" #include "common/microprofile.h" diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 0e4c6e370a..6c7b93d05c 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include "common/archives.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index d2a12ade1d..d970b0a2f4 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include -#include #include "common/archives.h" #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index dd00b71c4a..439574be2e 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include #include diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index cd8f4dcf79..3ea266a0a3 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -14,6 +14,7 @@ #include #include "common/common_types.h" #include "common/construct.h" +#include "common/swap.h" #include "core/file_sys/cia_container.h" #include "core/file_sys/file_backend.h" #include "core/global.h" diff --git a/src/core/hle/service/apt/ns.cpp b/src/core/hle/service/apt/ns.cpp index cff88a5aae..7c5b301386 100644 --- a/src/core/hle/service/apt/ns.cpp +++ b/src/core/hle/service/apt/ns.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include "core/core.h" #include "core/hle/service/am/am.h" #include "core/hle/service/apt/ns.h" diff --git a/src/core/hle/service/apt/ns.h b/src/core/hle/service/apt/ns.h index ce52fb462c..5d84106816 100644 --- a/src/core/hle/service/apt/ns.h +++ b/src/core/hle/service/apt/ns.h @@ -4,6 +4,7 @@ #pragma once +#include "common/common_types.h" #include "core/hle/kernel/process.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 86ba6b45ac..0652ad8bfd 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -313,7 +313,7 @@ void Module::Interface::GetRegionCanadaUSA(Kernel::HLERequestContext& ctx) { void Module::Interface::GetSystemModel(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x05, 0, 0); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); - u32 data; + u32 data{}; // TODO(Subv): Find out the correct error codes rb.Push(cfg->GetConfigInfoBlock(ConsoleModelBlockID, 4, 0x8, reinterpret_cast(&data))); @@ -879,13 +879,13 @@ ResultCode Module::SetConsoleUniqueId(u32 random_number, u64 console_id) { } u64 Module::GetConsoleUniqueId() { - u64_le console_id_le; + u64_le console_id_le{}; GetConfigInfoBlock(ConsoleUniqueID2BlockID, sizeof(console_id_le), 0xE, &console_id_le); return console_id_le; } EULAVersion Module::GetEULAVersion() { - u32_le data; + u32_le data{}; GetConfigInfoBlock(EULAVersionBlockID, sizeof(data), 0xE, &data); EULAVersion version; version.minor = data & 0xFF; diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index e36fec4de1..65e1453443 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include #include diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 08ce878afb..0ec46a8920 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include "common/archives.h" #include "common/assert.h" #include "common/common_types.h" diff --git a/src/core/hle/service/http_c.cpp b/src/core/hle/service/http_c.cpp index 331500a08a..c9a4392204 100644 --- a/src/core/hle/service/http_c.cpp +++ b/src/core/hle/service/http_c.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include #include "common/archives.h" diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 8278b0c554..c68f0095c9 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include #include "common/archives.h" #include "common/common_paths.h" #include "common/file_util.h" diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index f84d076c74..063a1cd3c6 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "common/archives.h" #include "common/assert.h" diff --git a/src/core/hw/aes/key.cpp b/src/core/hw/aes/key.cpp index 62e9b6ecae..5cd5d82147 100644 --- a/src/core/hw/aes/key.cpp +++ b/src/core/hw/aes/key.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 20cf17b63f..91fbe5800f 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include -#include #include #include #include diff --git a/src/core/savestate.cpp b/src/core/savestate.cpp index efbbe3eb46..4c88eade4e 100644 --- a/src/core/savestate.cpp +++ b/src/core/savestate.cpp @@ -67,6 +67,7 @@ static bool ValidateSaveState(const CSTHeader& header, SaveStateInfo& info, u64 std::vector ListSaveStates(u64 program_id) { std::vector result; + result.reserve(SaveStateSlotCount); for (u32 slot = 1; slot <= SaveStateSlotCount; ++slot) { const auto path = GetSaveStatePath(program_id, slot); if (!FileUtil::Exists(path)) { diff --git a/src/dedicated_room/citra-room.cpp b/src/dedicated_room/citra-room.cpp index c57ccc7ef6..46072de2d0 100644 --- a/src/dedicated_room/citra-room.cpp +++ b/src/dedicated_room/citra-room.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h index f4d7a5b89d..d7d18eaaa2 100644 --- a/src/input_common/gcadapter/gc_adapter.h +++ b/src/input_common/gcadapter/gc_adapter.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "common/common_types.h" #include "common/threadsafe_queue.h" diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h index bb6671951d..0ce094b622 100644 --- a/src/input_common/sdl/sdl_impl.h +++ b/src/input_common/sdl/sdl_impl.h @@ -7,6 +7,7 @@ #include #include #include +#include #include "common/settings.h" #include "common/threadsafe_queue.h" #include "input_common/sdl/sdl.h" diff --git a/src/network/room.cpp b/src/network/room.cpp index 2dc69c112d..4623b31d4e 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.cpp b/src/video_core/rasterizer_cache/rasterizer_cache.cpp index 319a5263c9..f40aeb885b 100644 --- a/src/video_core/rasterizer_cache/rasterizer_cache.cpp +++ b/src/video_core/rasterizer_cache/rasterizer_cache.cpp @@ -7,6 +7,7 @@ #include "common/alignment.h" #include "common/logging/log.h" #include "common/microprofile.h" +#include "common/settings.h" #include "core/memory.h" #include "video_core/custom_textures/custom_tex_manager.h" #include "video_core/rasterizer_cache/rasterizer_cache.h" diff --git a/src/video_core/regs_rasterizer.h b/src/video_core/regs_rasterizer.h index c88f9d8fe2..245d18b3fb 100644 --- a/src/video_core/regs_rasterizer.h +++ b/src/video_core/regs_rasterizer.h @@ -6,6 +6,7 @@ #include #include "common/bit_field.h" +#include "common/common_funcs.h" #include "common/math_util.h" #include "common/vector_math.h" #include "video_core/pica_types.h" diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index d8fb904dd3..79986592bc 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/core.h" #include "core/frontend/emu_window.h" #include "core/tracer/recorder.h" diff --git a/src/video_core/renderer_opengl/gl_format_reinterpreter.h b/src/video_core/renderer_opengl/gl_format_reinterpreter.h index b576f049fb..b4b9468eb0 100644 --- a/src/video_core/renderer_opengl/gl_format_reinterpreter.h +++ b/src/video_core/renderer_opengl/gl_format_reinterpreter.h @@ -4,7 +4,6 @@ #pragma once -#include #include "common/math_util.h" #include "video_core/rasterizer_cache/pixel_format.h" #include "video_core/renderer_opengl/gl_resource_manager.h" diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.h b/src/video_core/renderer_opengl/gl_shader_disk_cache.h index eb9c1bb51e..3c3c76666f 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index 0be733e950..9246c86602 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -8,6 +8,7 @@ #include #include #include "common/scope_exit.h" +#include "core/frontend/emu_window.h" #include "video_core/renderer_opengl/gl_driver.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_shader_disk_cache.h" diff --git a/src/video_core/renderer_opengl/post_processing_opengl.cpp b/src/video_core/renderer_opengl/post_processing_opengl.cpp index aa4057f2d2..1e479b65fc 100644 --- a/src/video_core/renderer_opengl/post_processing_opengl.cpp +++ b/src/video_core/renderer_opengl/post_processing_opengl.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include diff --git a/src/video_core/renderer_software/sw_lighting.cpp b/src/video_core/renderer_software/sw_lighting.cpp index c1138bcf99..b5394c65db 100644 --- a/src/video_core/renderer_software/sw_lighting.cpp +++ b/src/video_core/renderer_software/sw_lighting.cpp @@ -35,8 +35,8 @@ std::tuple, Common::Vec4> ComputeFragmentsColors( shadow = Common::MakeVec(1.0f, 1.0f, 1.0f, 1.0f); } - Common::Vec3 surface_normal; - Common::Vec3 surface_tangent; + Common::Vec3 surface_normal{}; + Common::Vec3 surface_tangent{}; if (lighting.config0.bump_mode != LightingRegs::LightingBumpMode::None) { Common::Vec3 perturbation = diff --git a/src/video_core/shader/shader_jit_x64_compiler.h b/src/video_core/shader/shader_jit_x64_compiler.h index 96dbfe82a4..fc0036fd49 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.h +++ b/src/video_core/shader/shader_jit_x64_compiler.h @@ -15,7 +15,6 @@ #include #include #include -#include "common/bit_set.h" #include "common/common_types.h" #include "video_core/shader/shader.h" diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index fb2239df78..b38ca9d553 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -7,6 +7,7 @@ #include "common/logging/log.h" #include "common/settings.h" #include "core/core.h" +#include "core/frontend/emu_window.h" #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/renderer_base.h" diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index ff29c307d3..611a76d7ef 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h @@ -6,9 +6,7 @@ #include #include -#include #include -#include "core/frontend/emu_window.h" namespace Frontend { class EmuWindow;