From 34de77d4291dc078d7e3e15415d784966d423adf Mon Sep 17 00:00:00 2001 From: Vitor K Date: Wed, 3 May 2023 12:24:10 -0300 Subject: [PATCH] Various miscelaneous changes (#6496) --- src/android/app/src/main/jni/game_info.h | 1 - src/android/app/src/main/jni/input_manager.h | 1 - src/android/app/src/main/jni/native.cpp | 3 +-- src/audio_core/lle/lle.cpp | 1 + src/citra/config.cpp | 1 - src/citra/emu_window/emu_window_sdl2.h | 2 +- src/citra/emu_window/emu_window_sdl2_gl.cpp | 1 + src/citra/emu_window/emu_window_sdl2_sw.cpp | 1 + src/citra_qt/applets/mii_selector.h | 1 - src/citra_qt/applets/swkbd.cpp | 1 + src/citra_qt/configuration/config.cpp | 1 - src/citra_qt/configuration/configure_input.h | 1 - src/citra_qt/debugger/ipc/recorder.h | 2 -- src/citra_qt/debugger/profiler.cpp | 1 + src/citra_qt/debugger/wait_tree.cpp | 3 ++- src/citra_qt/game_list.cpp | 1 + src/citra_qt/game_list_worker.h | 2 -- src/citra_qt/main.cpp | 3 +-- src/citra_qt/main.h | 5 ++++- src/common/android_storage.cpp | 3 ++- src/common/bit_field.h | 1 - src/common/file_util.cpp | 1 + src/common/file_util.h | 2 +- src/common/logging/backend.cpp | 2 -- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 1 - src/core/arm/skyeye_common/vfp/vfp_helper.h | 1 - src/core/core.cpp | 2 +- src/core/core_timing.cpp | 1 - src/core/dumping/ffmpeg_backend.cpp | 2 +- src/core/file_sys/archive_ncch.cpp | 1 - src/core/file_sys/archive_selfncch.cpp | 1 - src/core/file_sys/cia_container.cpp | 1 - src/core/file_sys/disk_archive.cpp | 1 - src/core/file_sys/ncch_container.cpp | 1 - src/core/file_sys/plugin_3gx.cpp | 1 + src/core/file_sys/title_metadata.cpp | 1 - src/core/frontend/applets/swkbd.h | 1 - src/core/frontend/framebuffer_layout.h | 5 ++++- src/core/gdbstub/gdbstub.cpp | 1 - src/core/hle/applets/applet.cpp | 17 ----------------- src/core/hle/kernel/event.cpp | 1 - src/core/hle/kernel/memory.cpp | 2 -- src/core/hle/kernel/mutex.cpp | 1 - src/core/hle/kernel/svc.cpp | 2 -- src/core/hle/kernel/thread.cpp | 1 - src/core/hle/kernel/timer.cpp | 2 -- src/core/hle/service/am/am.cpp | 1 - src/core/hle/service/am/am.h | 1 + src/core/hle/service/apt/ns.cpp | 1 - src/core/hle/service/apt/ns.h | 1 + src/core/hle/service/cfg/cfg.cpp | 6 +++--- src/core/hle/service/fs/archive.cpp | 1 - src/core/hle/service/fs/fs_user.cpp | 1 - src/core/hle/service/http_c.cpp | 1 + src/core/hle/service/ptm/ptm.cpp | 1 - src/core/hle/service/soc_u.cpp | 1 + src/core/hw/aes/key.cpp | 1 + src/core/loader/ncch.cpp | 1 - src/core/savestate.cpp | 1 + src/dedicated_room/citra-room.cpp | 1 - src/input_common/gcadapter/gc_adapter.h | 1 - src/input_common/sdl/sdl_impl.h | 1 + src/network/room.cpp | 1 - .../rasterizer_cache/rasterizer_cache.cpp | 1 + src/video_core/regs_rasterizer.h | 1 + src/video_core/renderer_base.cpp | 1 + .../renderer_opengl/gl_format_reinterpreter.h | 1 - .../renderer_opengl/gl_shader_disk_cache.h | 1 - .../renderer_opengl/gl_shader_manager.cpp | 1 + .../renderer_opengl/post_processing_opengl.cpp | 1 + .../renderer_software/sw_lighting.cpp | 4 ++-- src/video_core/shader/shader_jit_x64_compiler.h | 1 - src/video_core/video_core.cpp | 1 + src/video_core/video_core.h | 2 -- 74 files changed, 44 insertions(+), 81 deletions(-) diff --git a/src/android/app/src/main/jni/game_info.h b/src/android/app/src/main/jni/game_info.h index ad3254aab..7b9750fe2 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 637eeb67b..31d4b756e 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 43dc55bbd..9c0e022fb 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 b83e0676b..fbb6f1f07 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 7e155830b..d8d93a9a8 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 f3311d98f..b74c70731 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 f0256fc1e..090050ef9 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 0bc794b8d..e9d047bb9 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 c3b6eabb2..c34549344 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 ce01a8496..44e6c5738 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 c740f5dd7..fcb268d32 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 b6867a39c..fb00444c6 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 63b190790..aa02041e8 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 9f195f1ee..06ae3bdaa 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 5892ce48c..6d09457fd 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 c4f1f2465..9fe4b4c0e 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 4decfa37f..b5ca89463 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 34b5319e6..546468914 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 6ee7dc562..a36fd83c5 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 d5975ee77..a18ecefac 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 4ec3af1af..53434df30 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 ce9dfba67..da4bcd6e0 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 6c04ff561..41e2af845 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 db015c1b7..bbf0b48f9 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 dc8d62d2a..396560eaf 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 3c1da2407..53d7ae670 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 4dddfb5e1..60cd7a61c 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 a865bd4aa..41a80b3fa 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 f4ef07308..ee9f36130 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 23a7f98c2..142b6d2fe 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 e4f7218a7..5cf036278 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 5764a7632..8cd987ee0 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 cf1a3c567..e3e95a08f 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 4592c6723..1e1b1ec44 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 61928982d..dcb73005e 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 e25d2d238..f028b52d4 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 f38f23d65..8e3ae3e8b 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 8dcb6354d..ce1183361 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 073ecdc0e..0fab5418b 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 b10795b76..d8b03704d 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 9f26847b0..04536002b 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 5ef9de3d4..680503f42 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 77a5fe903..cf2621ed8 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 0d7c4894d..4c075b541 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 0e4c6e370..6c7b93d05 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 d2a12ade1..d970b0a2f 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 dd00b71c4..439574be2 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 cd8f4dcf7..3ea266a0a 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 cff88a5aa..7c5b30138 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 ce52fb462..5d8410681 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 86ba6b45a..0652ad8bf 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 e36fec4de..65e145344 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 08ce878af..0ec46a892 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 331500a08..c9a439220 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 8278b0c55..c68f0095c 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 f84d076c7..063a1cd3c 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 62e9b6eca..5cd5d8214 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 20cf17b63..91fbe5800 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 efbbe3eb4..4c88eade4 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 c57ccc7ef..46072de2d 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 f4d7a5b89..d7d18eaaa 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 bb6671951..0ce094b62 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 2dc69c112..4623b31d4 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 319a5263c..f40aeb885 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 c88f9d8fe..245d18b3f 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 d8fb904dd..79986592b 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 b576f049f..b4b9468eb 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 eb9c1bb51..3c3c76666 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 0be733e95..9246c8660 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 aa4057f2d..1e479b65f 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 c1138bcf9..b5394c65d 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 96dbfe82a..fc0036fd4 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 fb2239df7..b38ca9d55 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 ff29c307d..611a76d7e 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;