From 552c0d8404ebd1e0cfa71c2d14ecb81c40f4cd70 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 Mar 2017 14:43:52 -0500 Subject: [PATCH] Common: Move byte swapping utilities into their own header This moves all the byte swapping utilities into a header named Swap.h. A dedicated header is much more preferable here due to the size of the code itself. In general usage throughout the codebase, CommonFuncs.h was generally only included for these functions anyway. These being in their own header avoids dumping the lesser used utilities into scope. As well as providing a localized area for more utilities related to byte swapping in the future (should they be needed). This also makes it nicer to identify which files depend on the byte swapping utilities in particular. Since this is a completely new header, moving the code uncovered a few indirect includes, as well as making some other inclusions unnecessary. --- Source/Core/AudioCommon/Mixer.cpp | 6 +- Source/Core/AudioCommon/WaveFile.cpp | 7 +- Source/Core/Common/ColorUtil.cpp | 2 +- Source/Core/Common/Common.vcxproj | 1 + Source/Core/Common/Common.vcxproj.filters | 1 + Source/Core/Common/CommonFuncs.h | 162 ----------------- Source/Core/Common/NandPaths.cpp | 7 +- Source/Core/Common/SettingsHandler.cpp | 1 - Source/Core/Common/Swap.h | 167 ++++++++++++++++++ Source/Core/Common/SysConf.cpp | 7 +- Source/Core/Core/ARDecrypt.cpp | 4 +- Source/Core/Core/ARDecrypt.h | 1 + Source/Core/Core/Boot/Boot_DOL.cpp | 6 +- Source/Core/Core/Boot/Boot_ELF.cpp | 2 +- Source/Core/Core/Boot/ElfReader.cpp | 2 +- Source/Core/Core/DSP/DSPCore.cpp | 2 - Source/Core/Core/DSP/DSPHWInterface.cpp | 3 +- Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp | 8 +- Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp | 2 +- Source/Core/Core/HW/DSPHLE/UCodes/AXWii.cpp | 3 +- Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp | 1 - Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp | 2 +- Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp | 2 +- Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp | 1 - Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp | 1 + Source/Core/Core/HW/GCMemcard.cpp | 5 +- Source/Core/Core/HW/GCMemcard.h | 2 +- Source/Core/Core/HW/GPFifo.cpp | 5 +- Source/Core/Core/HW/Memmap.cpp | 2 +- Source/Core/Core/HW/Memmap.h | 1 + Source/Core/Core/HW/Sram.cpp | 2 + Source/Core/Core/HW/WiiSaveCrypted.cpp | 6 +- .../Core/HW/WiimoteEmu/EmuSubroutines.cpp | 1 + .../Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 5 +- Source/Core/Core/IOS/ES/ES.cpp | 9 +- Source/Core/Core/IOS/ES/Formats.cpp | 2 +- Source/Core/Core/IOS/MIOS.cpp | 2 +- .../Core/Core/IOS/Network/KD/NWC24Config.cpp | 2 +- Source/Core/Core/IOS/Network/WD/Command.cpp | 2 +- Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp | 6 +- Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp | 2 +- .../Core/IOS/USB/Bluetooth/WiimoteDevice.h | 2 +- Source/Core/Core/IOS/USB/Common.cpp | 5 +- Source/Core/Core/IOS/USB/OH0/OH0.cpp | 5 +- Source/Core/Core/IOS/USB/USBV0.cpp | 5 +- Source/Core/Core/IOS/USB/USBV4.cpp | 5 +- Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp | 5 +- Source/Core/Core/IOS/USB/USB_KBD.cpp | 5 +- Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp | 6 +- Source/Core/Core/PatchEngine.cpp | 3 - .../Interpreter/Interpreter_Integer.cpp | 1 + .../Interpreter/Interpreter_LoadStore.cpp | 1 + .../Core/PowerPC/Jit64Common/Jit64Base.cpp | 2 +- .../PowerPC/JitArm64/JitArm64_BackPatch.cpp | 1 + Source/Core/Core/PowerPC/PPCCache.cpp | 2 +- Source/Core/Core/ec_wii.cpp | 5 +- Source/Core/DiscIO/Blob.h | 3 +- Source/Core/DiscIO/NANDContentLoader.cpp | 6 +- Source/Core/DiscIO/TGCBlob.cpp | 5 +- Source/Core/DiscIO/Volume.cpp | 6 +- Source/Core/DiscIO/Volume.h | 2 +- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 7 +- Source/Core/DiscIO/WbfsBlob.cpp | 6 +- .../Core/DolphinWX/Cheats/CheatSearchTab.cpp | 8 +- Source/Core/DolphinWX/Cheats/CheatSearchTab.h | 2 + .../DolphinWX/Config/InterfaceConfigPane.cpp | 4 +- Source/Core/DolphinWX/FifoPlayerDlg.cpp | 4 +- .../Core/VideoBackends/OGL/SamplerCache.cpp | 4 +- .../Core/VideoBackends/Software/DebugUtil.cpp | 3 +- .../VideoBackends/Software/EfbInterface.cpp | 3 +- .../VideoBackends/Software/TextureEncoder.cpp | 4 +- .../VideoBackends/Software/TransformUnit.cpp | 2 +- Source/Core/VideoCommon/DataReader.h | 3 +- Source/Core/VideoCommon/HiresTextures.cpp | 4 +- .../VideoCommon/TextureDecoder_Common.cpp | 3 +- .../VideoCommon/TextureDecoder_Generic.cpp | 3 +- .../Core/VideoCommon/TextureDecoder_x64.cpp | 2 +- .../Core/VideoCommon/VertexLoader_Color.cpp | 3 +- .../Core/VideoCommon/VertexLoader_Normal.cpp | 5 +- Source/Core/VideoCommon/VertexLoader_Normal.h | 1 + .../VideoCommon/VertexLoader_Position.cpp | 6 +- .../Core/VideoCommon/VertexLoader_Position.h | 1 + .../VideoCommon/VertexLoader_TextCoord.cpp | 6 +- .../Core/VideoCommon/VertexLoader_TextCoord.h | 1 + Source/Core/VideoCommon/XFStructs.cpp | 4 +- Source/UnitTests/Common/CMakeLists.txt | 1 + Source/UnitTests/Common/CommonFuncsTest.cpp | 8 - Source/UnitTests/Common/SwapTest.cpp | 15 ++ 88 files changed, 347 insertions(+), 296 deletions(-) create mode 100644 Source/Core/Common/Swap.h create mode 100644 Source/UnitTests/Common/SwapTest.cpp diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index de5a4fdde8f..427aab557ab 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -2,14 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "AudioCommon/Mixer.h" + #include -#include "AudioCommon/AudioCommon.h" -#include "AudioCommon/Mixer.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MathUtil.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" #if _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__) diff --git a/Source/Core/AudioCommon/WaveFile.cpp b/Source/Core/AudioCommon/WaveFile.cpp index c7013f10aef..2707e33d81c 100644 --- a/Source/Core/AudioCommon/WaveFile.cpp +++ b/Source/Core/AudioCommon/WaveFile.cpp @@ -2,15 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "AudioCommon/WaveFile.h" + #include -#include "AudioCommon/WaveFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" -#include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" - +#include "Common/Swap.h" #include "Core/ConfigManager.h" constexpr size_t WaveFileWriter::BUFFER_SIZE; diff --git a/Source/Core/Common/ColorUtil.cpp b/Source/Core/Common/ColorUtil.cpp index b859f843f8a..bce7276aa12 100644 --- a/Source/Core/Common/ColorUtil.cpp +++ b/Source/Core/Common/ColorUtil.cpp @@ -3,7 +3,7 @@ // Refer to the license.txt file included. #include "Common/ColorUtil.h" -#include "Common/CommonFuncs.h" +#include "Common/Swap.h" namespace ColorUtil { diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index 9f2b64f56d5..a30d70b4c96 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -134,6 +134,7 @@ + diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index 92d5fb2ae16..e68660d752e 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -63,6 +63,7 @@ + diff --git a/Source/Core/Common/CommonFuncs.h b/Source/Core/Common/CommonFuncs.h index 4dc359ee3cd..fe0a6f5a1a1 100644 --- a/Source/Core/Common/CommonFuncs.h +++ b/Source/Core/Common/CommonFuncs.h @@ -4,12 +4,7 @@ #pragma once -#ifdef __APPLE__ -#include -#endif - #include -#include #include #include "Common/CommonTypes.h" @@ -29,13 +24,6 @@ constexpr size_t ArraySize(T (&arr)[N]) #ifndef _WIN32 -#include -#ifdef __linux__ -#include -#elif defined __FreeBSD__ -#include -#endif - // go to debugger mode #define Crash() \ { \ @@ -103,153 +91,3 @@ __declspec(dllimport) void __stdcall DebugBreak(void); // This function might change the error code. // Defined in Misc.cpp. std::string GetLastErrorMsg(); - -namespace Common -{ -inline u8 swap8(u8 _data) -{ - return _data; -} -inline u32 swap24(const u8* _data) -{ - return (_data[0] << 16) | (_data[1] << 8) | _data[2]; -} - -#if defined(ANDROID) || defined(__OpenBSD__) -#undef swap16 -#undef swap32 -#undef swap64 -#endif - -#ifdef _WIN32 -inline u16 swap16(u16 _data) -{ - return _byteswap_ushort(_data); -} -inline u32 swap32(u32 _data) -{ - return _byteswap_ulong(_data); -} -inline u64 swap64(u64 _data) -{ - return _byteswap_uint64(_data); -} -#elif __linux__ -inline u16 swap16(u16 _data) -{ - return bswap_16(_data); -} -inline u32 swap32(u32 _data) -{ - return bswap_32(_data); -} -inline u64 swap64(u64 _data) -{ - return bswap_64(_data); -} -#elif __APPLE__ -inline __attribute__((always_inline)) u16 swap16(u16 _data) -{ - return OSSwapInt16(_data); -} -inline __attribute__((always_inline)) u32 swap32(u32 _data) -{ - return OSSwapInt32(_data); -} -inline __attribute__((always_inline)) u64 swap64(u64 _data) -{ - return OSSwapInt64(_data); -} -#elif __FreeBSD__ -inline u16 swap16(u16 _data) -{ - return bswap16(_data); -} -inline u32 swap32(u32 _data) -{ - return bswap32(_data); -} -inline u64 swap64(u64 _data) -{ - return bswap64(_data); -} -#else -// Slow generic implementation. -inline u16 swap16(u16 data) -{ - return (data >> 8) | (data << 8); -} -inline u32 swap32(u32 data) -{ - return (swap16(data) << 16) | swap16(data >> 16); -} -inline u64 swap64(u64 data) -{ - return ((u64)swap32(data) << 32) | swap32(data >> 32); -} -#endif - -inline u16 swap16(const u8* data) -{ - u16 value; - std::memcpy(&value, data, sizeof(u16)); - - return swap16(value); -} -inline u32 swap32(const u8* data) -{ - u32 value; - std::memcpy(&value, data, sizeof(u32)); - - return swap32(value); -} -inline u64 swap64(const u8* data) -{ - u64 value; - std::memcpy(&value, data, sizeof(u64)); - - return swap64(value); -} - -template -void swap(u8*); - -template <> -inline void swap<1>(u8* data) -{ -} - -template <> -inline void swap<2>(u8* data) -{ - const u16 value = swap16(data); - - std::memcpy(data, &value, sizeof(u16)); -} - -template <> -inline void swap<4>(u8* data) -{ - const u32 value = swap32(data); - - std::memcpy(data, &value, sizeof(u32)); -} - -template <> -inline void swap<8>(u8* data) -{ - const u64 value = swap64(data); - - std::memcpy(data, &value, sizeof(u64)); -} - -template -inline T FromBigEndian(T data) -{ - static_assert(std::is_arithmetic::value, "function only makes sense with arithmetic types"); - - swap(reinterpret_cast(&data)); - return data; -} - -} // Namespace Common diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp index 99c75f01f8f..3984d2d620f 100644 --- a/Source/Core/Common/NandPaths.cpp +++ b/Source/Core/Common/NandPaths.cpp @@ -3,20 +3,17 @@ // Refer to the license.txt file included. #include -#include -#include -#include #include #include #include +#include -#include "Common/CommonFuncs.h" -#include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/NandPaths.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" namespace Common { diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index 54efd77f70c..9d0bd84eb31 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -14,7 +14,6 @@ #include #include #include -#include "Common/CommonFuncs.h" // snprintf #endif #include "Common/CommonTypes.h" diff --git a/Source/Core/Common/Swap.h b/Source/Core/Common/Swap.h new file mode 100644 index 00000000000..6274ce19ccc --- /dev/null +++ b/Source/Core/Common/Swap.h @@ -0,0 +1,167 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#ifdef __APPLE__ +#include +#elif defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#endif + +#include "Common/CommonTypes.h" + +namespace Common +{ +inline u8 swap8(u8 data) +{ + return data; +} +inline u32 swap24(const u8* data) +{ + return (data[0] << 16) | (data[1] << 8) | data[2]; +} + +#if defined(ANDROID) || defined(__OpenBSD__) +#undef swap16 +#undef swap32 +#undef swap64 +#endif + +#ifdef _WIN32 +inline u16 swap16(u16 data) +{ + return _byteswap_ushort(data); +} +inline u32 swap32(u32 data) +{ + return _byteswap_ulong(data); +} +inline u64 swap64(u64 data) +{ + return _byteswap_uint64(data); +} +#elif __linux__ +inline u16 swap16(u16 data) +{ + return bswap_16(data); +} +inline u32 swap32(u32 data) +{ + return bswap_32(data); +} +inline u64 swap64(u64 data) +{ + return bswap_64(data); +} +#elif __APPLE__ +inline __attribute__((always_inline)) u16 swap16(u16 data) +{ + return OSSwapInt16(data); +} +inline __attribute__((always_inline)) u32 swap32(u32 data) +{ + return OSSwapInt32(data); +} +inline __attribute__((always_inline)) u64 swap64(u64 data) +{ + return OSSwapInt64(data); +} +#elif __FreeBSD__ +inline u16 swap16(u16 data) +{ + return bswap16(data); +} +inline u32 swap32(u32 data) +{ + return bswap32(data); +} +inline u64 swap64(u64 data) +{ + return bswap64(data); +} +#else +// Slow generic implementation. +inline u16 swap16(u16 data) +{ + return (data >> 8) | (data << 8); +} +inline u32 swap32(u32 data) +{ + return (swap16(data) << 16) | swap16(data >> 16); +} +inline u64 swap64(u64 data) +{ + return ((u64)swap32(data) << 32) | swap32(data >> 32); +} +#endif + +inline u16 swap16(const u8* data) +{ + u16 value; + std::memcpy(&value, data, sizeof(u16)); + + return swap16(value); +} +inline u32 swap32(const u8* data) +{ + u32 value; + std::memcpy(&value, data, sizeof(u32)); + + return swap32(value); +} +inline u64 swap64(const u8* data) +{ + u64 value; + std::memcpy(&value, data, sizeof(u64)); + + return swap64(value); +} + +template +void swap(u8*); + +template <> +inline void swap<1>(u8* data) +{ +} + +template <> +inline void swap<2>(u8* data) +{ + const u16 value = swap16(data); + + std::memcpy(data, &value, sizeof(u16)); +} + +template <> +inline void swap<4>(u8* data) +{ + const u32 value = swap32(data); + + std::memcpy(data, &value, sizeof(u32)); +} + +template <> +inline void swap<8>(u8* data) +{ + const u64 value = swap64(data); + + std::memcpy(data, &value, sizeof(u64)); +} + +template +inline T FromBigEndian(T data) +{ + static_assert(std::is_arithmetic::value, "function only makes sense with arithmetic types"); + + swap(reinterpret_cast(&data)); + return data; +} +} // Namespace Common diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 56336289483..6b2b1eb6c19 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Common/SysConf.h" + #include #include #include @@ -9,13 +11,10 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" -#include "Common/Logging/Log.h" -#include "Common/SysConf.h" - +#include "Common/Swap.h" #include "Core/Movie.h" SysConf::SysConf(const Common::FromWhichRoot root_type) diff --git a/Source/Core/Core/ARDecrypt.cpp b/Source/Core/Core/ARDecrypt.cpp index cb6b3934237..831caaabc68 100644 --- a/Source/Core/Core/ARDecrypt.cpp +++ b/Source/Core/Core/ARDecrypt.cpp @@ -6,6 +6,8 @@ // GCNcrypt - GameCube AR Crypto Program // Copyright (C) 2003-2004 Parasyte +#include "Core/ARDecrypt.h" + #include #include @@ -16,7 +18,7 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/MsgHandler.h" -#include "Core/ARDecrypt.h" +#include "Common/Swap.h" namespace ActionReplay { diff --git a/Source/Core/Core/ARDecrypt.h b/Source/Core/Core/ARDecrypt.h index 399b5d0dc0c..4179bae95c5 100644 --- a/Source/Core/Core/ARDecrypt.h +++ b/Source/Core/Core/ARDecrypt.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include "Common/CommonTypes.h" diff --git a/Source/Core/Core/Boot/Boot_DOL.cpp b/Source/Core/Core/Boot/Boot_DOL.cpp index cd2660e6456..b86169744da 100644 --- a/Source/Core/Core/Boot/Boot_DOL.cpp +++ b/Source/Core/Core/Boot/Boot_DOL.cpp @@ -2,14 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/Boot/Boot_DOL.h" + #include #include #include -#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" - -#include "Core/Boot/Boot_DOL.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" CDolLoader::CDolLoader(const std::vector& buffer) diff --git a/Source/Core/Core/Boot/Boot_ELF.cpp b/Source/Core/Core/Boot/Boot_ELF.cpp index c6267256988..4dc9cd18d5c 100644 --- a/Source/Core/Core/Boot/Boot_ELF.cpp +++ b/Source/Core/Core/Boot/Boot_ELF.cpp @@ -4,8 +4,8 @@ #include -#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" +#include "Common/Swap.h" #include "Core/Boot/Boot.h" #include "Core/Boot/ElfReader.h" #include "Core/HLE/HLE.h" diff --git a/Source/Core/Core/Boot/ElfReader.cpp b/Source/Core/Core/Boot/ElfReader.cpp index 770f27e548c..91eeba7487b 100644 --- a/Source/Core/Core/Boot/ElfReader.cpp +++ b/Source/Core/Core/Boot/ElfReader.cpp @@ -6,10 +6,10 @@ #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/PowerPC/PPCSymbolDB.h" diff --git a/Source/Core/Core/DSP/DSPCore.cpp b/Source/Core/Core/DSP/DSPCore.cpp index 6299164cc2d..7162b2b600a 100644 --- a/Source/Core/Core/DSP/DSPCore.cpp +++ b/Source/Core/Core/DSP/DSPCore.cpp @@ -9,11 +9,9 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Event.h" #include "Common/Hash.h" -#include "Common/Logging/Log.h" #include "Common/MemoryUtil.h" #include "Common/MsgHandler.h" diff --git a/Source/Core/Core/DSP/DSPHWInterface.cpp b/Source/Core/Core/DSP/DSPHWInterface.cpp index 7620f3bee91..07ea38a16d3 100644 --- a/Source/Core/Core/DSP/DSPHWInterface.cpp +++ b/Source/Core/Core/DSP/DSPHWInterface.cpp @@ -6,10 +6,11 @@ #include "Core/DSP/DSPHWInterface.h" #include "Common/CPUDetect.h" -#include "Common/CommonFuncs.h" +#include "Common/CommonTypes.h" #include "Common/Intrinsics.h" #include "Common/Logging/Log.h" #include "Common/MemoryUtil.h" +#include "Common/Swap.h" #include "Core/DSP/DSPAccelerator.h" #include "Core/DSP/DSPCore.h" diff --git a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp index 77c48bb0a7d..4773d7ab38e 100644 --- a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp @@ -2,14 +2,16 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/FifoPlayer/FifoAnalyzer.h" + #include #include -#include "Core/FifoPlayer/FifoAnalyzer.h" - #include "Common/Assert.h" -#include "Core/Core.h" +#include "Common/Swap.h" + #include "Core/FifoPlayer/FifoRecordAnalyzer.h" + #include "VideoCommon/OpcodeDecoding.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoader_Normal.h" diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp index 6f422ef79c9..7d8e4522f26 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp @@ -5,11 +5,11 @@ #include "Core/HW/DSPHLE/UCodes/AX.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MathUtil.h" +#include "Common/Swap.h" #include "Core/HW/DSP.h" #include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/MailHandler.h" diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/AXWii.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/AXWii.cpp index 469844d2254..22e22681685 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/AXWii.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/AXWii.cpp @@ -7,11 +7,10 @@ #include "Core/HW/DSPHLE/UCodes/AXWii.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MathUtil.h" -#include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/MailHandler.h" #include "Core/HW/DSPHLE/UCodes/AXStructs.h" diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp index 586930c395d..230d8900ff0 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/GBA.cpp @@ -5,7 +5,6 @@ #include "Core/HW/DSPHLE/UCodes/GBA.h" #include "Common/Align.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Core/HW/DSP.h" diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp index 86c578e9994..11f7d73b481 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp @@ -12,12 +12,12 @@ #endif #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Hash.h" #include "Common/Logging/Log.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" #include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/UCodes/AX.h" diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp index 7f848cb63f8..2d7ab824f78 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp @@ -7,9 +7,9 @@ #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" #include "Core/HW/DSP.h" #include "Core/HW/DSPHLE/DSPHLE.h" #include "Core/HW/DSPHLE/MailHandler.h" diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp index 5b28d9abd08..777b96a79e3 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceGecko.cpp @@ -11,7 +11,6 @@ #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/StringUtil.h" diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp index 69511aa9460..b7baf230fc7 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp @@ -14,6 +14,7 @@ #include "Common/Logging/Log.h" #include "Common/MemoryUtil.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Common/Timer.h" #include "Core/ConfigManager.h" diff --git a/Source/Core/Core/HW/GCMemcard.cpp b/Source/Core/Core/HW/GCMemcard.cpp index 5b04adac4c1..c0af034eacb 100644 --- a/Source/Core/Core/HW/GCMemcard.cpp +++ b/Source/Core/Core/HW/GCMemcard.cpp @@ -2,18 +2,21 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/HW/GCMemcard.h" + #include #include #include #include #include "Common/ColorUtil.h" +#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" -#include "Core/HW/GCMemcard.h" +#include "Common/Swap.h" static void ByteSwap(u8* valueA, u8* valueB) { diff --git a/Source/Core/Core/HW/GCMemcard.h b/Source/Core/Core/HW/GCMemcard.h index 8887dffd093..0b501e206f4 100644 --- a/Source/Core/Core/HW/GCMemcard.h +++ b/Source/Core/Core/HW/GCMemcard.h @@ -7,10 +7,10 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/NandPaths.h" #include "Common/NonCopyable.h" +#include "Common/Swap.h" #include "Common/Timer.h" #include "Core/HW/EXI/EXI_DeviceIPL.h" diff --git a/Source/Core/Core/HW/GPFifo.cpp b/Source/Core/Core/HW/GPFifo.cpp index d822dd0d88a..febd1bd3c70 100644 --- a/Source/Core/Core/HW/GPFifo.cpp +++ b/Source/Core/Core/HW/GPFifo.cpp @@ -2,12 +2,13 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/HW/GPFifo.h" + #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" -#include "Core/HW/GPFifo.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/HW/ProcessorInterface.h" #include "Core/PowerPC/JitInterface.h" diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index 62604838814..8fa5e4f3375 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -11,10 +11,10 @@ #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MemArena.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" #include "Core/HW/AudioInterface.h" #include "Core/HW/DSP.h" diff --git a/Source/Core/Core/HW/Memmap.h b/Source/Core/Core/HW/Memmap.h index 1e628fe215f..10baa444abf 100644 --- a/Source/Core/Core/HW/Memmap.h +++ b/Source/Core/Core/HW/Memmap.h @@ -9,6 +9,7 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" #include "Core/PowerPC/PowerPC.h" // Global declarations diff --git a/Source/Core/Core/HW/Sram.cpp b/Source/Core/Core/HW/Sram.cpp index 158a9277476..79b92209d53 100644 --- a/Source/Core/Core/HW/Sram.cpp +++ b/Source/Core/Core/HW/Sram.cpp @@ -3,9 +3,11 @@ // Refer to the license.txt file included. #include "Core/HW/Sram.h" + #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" // english diff --git a/Source/Core/Core/HW/WiiSaveCrypted.cpp b/Source/Core/Core/HW/WiiSaveCrypted.cpp index 442e4b3db1f..d646fae570c 100644 --- a/Source/Core/Core/HW/WiiSaveCrypted.cpp +++ b/Source/Core/Core/HW/WiiSaveCrypted.cpp @@ -7,6 +7,8 @@ // Licensed under the terms of the GNU GPL, version 2 // http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt +#include "Core/HW/WiiSaveCrypted.h" + #include #include #include @@ -19,7 +21,6 @@ #include #include "Common/Align.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Crypto/ec.h" #include "Common/FileUtil.h" @@ -27,8 +28,7 @@ #include "Common/MsgHandler.h" #include "Common/NandPaths.h" #include "Common/StringUtil.h" - -#include "Core/HW/WiiSaveCrypted.h" +#include "Common/Swap.h" const u8 CWiiSaveCrypted::s_sd_key[16] = {0xAB, 0x01, 0xB9, 0xD8, 0xE1, 0x62, 0x2B, 0x08, 0xAF, 0xBA, 0xD8, 0x4D, 0xBF, 0xC2, 0xA5, 0x5D}; diff --git a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp index af968ff1437..7c11cec49eb 100644 --- a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp @@ -25,6 +25,7 @@ #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "Core/Core.h" #include "Core/HW/WiimoteEmu/Attachment/Attachment.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h" diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 5d8e81ab7ec..e896b6f40d1 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -2,17 +2,18 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/HW/WiimoteReal/WiimoteReal.h" + #include #include #include #include -#include "Core/HW/WiimoteReal/WiimoteReal.h" - #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" #include "Common/IniFile.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Common/Thread.h" #include "Core/ConfigManager.h" #include "Core/Core.h" diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index 2e8ec78de9c..073c1307297 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/ES/ES.h" + #include #include #include @@ -15,23 +17,18 @@ #include "Common/Align.h" #include "Common/Assert.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/NandPaths.h" +#include "Common/Swap.h" #include "Core/Boot/Boot.h" -#include "Core/Boot/Boot_DOL.h" #include "Core/ConfigManager.h" #include "Core/HLE/HLE.h" -#include "Core/HW/DVDInterface.h" #include "Core/HW/Memmap.h" -#include "Core/IOS/ES/ES.h" #include "Core/IOS/ES/Formats.h" #include "Core/PatchEngine.h" #include "Core/PowerPC/PPCSymbolDB.h" -#include "Core/PowerPC/PowerPC.h" -#include "Core/WiiRoot.h" #include "Core/ec_wii.h" #include "DiscIO/NANDContentLoader.h" #include "DiscIO/Volume.h" diff --git a/Source/Core/Core/IOS/ES/Formats.cpp b/Source/Core/Core/IOS/ES/Formats.cpp index 96a81004e51..602811a83c6 100644 --- a/Source/Core/Core/IOS/ES/Formats.cpp +++ b/Source/Core/Core/IOS/ES/Formats.cpp @@ -11,9 +11,9 @@ #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Crypto/AES.h" +#include "Common/Swap.h" namespace IOS { diff --git a/Source/Core/Core/IOS/MIOS.cpp b/Source/Core/Core/IOS/MIOS.cpp index 2a9e55402f5..d20cf9f5942 100644 --- a/Source/Core/Core/IOS/MIOS.cpp +++ b/Source/Core/Core/IOS/MIOS.cpp @@ -6,12 +6,12 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/NandPaths.h" +#include "Common/Swap.h" #include "Core/Boot/Boot.h" #include "Core/Boot/ElfReader.h" #include "Core/ConfigManager.h" diff --git a/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp b/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp index 4492f22443e..543b4904294 100644 --- a/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp +++ b/Source/Core/Core/IOS/Network/KD/NWC24Config.cpp @@ -6,11 +6,11 @@ #include -#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" namespace IOS { diff --git a/Source/Core/Core/IOS/Network/WD/Command.cpp b/Source/Core/Core/IOS/Network/WD/Command.cpp index 236355e32a6..3cbbcf9296d 100644 --- a/Source/Core/Core/IOS/Network/WD/Command.cpp +++ b/Source/Core/Core/IOS/Network/WD/Command.cpp @@ -7,10 +7,10 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/Network.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/IOS/Network/MACUtils.h" diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp index 2eb03c862fc..fd1f7e6ead8 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp @@ -2,19 +2,17 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/Bluetooth/BTBase.h" + #include #include #include -#include "Common/Assert.h" -#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" #include "Common/SysConf.h" -#include "Core/HW/Memmap.h" -#include "Core/IOS/USB/Bluetooth/BTBase.h" namespace IOS { diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp index 72d536fd3ad..e76becfc969 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp @@ -15,12 +15,12 @@ #include "Common/Assert.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/LibusbContext.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/Network.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Common/Thread.h" #include "Core/ConfigManager.h" #include "Core/Core.h" diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.h b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.h index 3937a0c777c..8253566b712 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.h +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.h @@ -8,8 +8,8 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" #include "Core/IOS/USB/Bluetooth/hci.h" class PointerWrap; diff --git a/Source/Core/Core/IOS/USB/Common.cpp b/Source/Core/Core/IOS/USB/Common.cpp index 0c1a7317a77..b8fecd5faf0 100644 --- a/Source/Core/Core/IOS/USB/Common.cpp +++ b/Source/Core/Core/IOS/USB/Common.cpp @@ -2,15 +2,16 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/Common.h" + #include #include "Common/Align.h" #include "Common/Assert.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" -#include "Core/IOS/USB/Common.h" namespace IOS { diff --git a/Source/Core/Core/IOS/USB/OH0/OH0.cpp b/Source/Core/Core/IOS/USB/OH0/OH0.cpp index 4a19e5cc21f..3a9ec8d97e1 100644 --- a/Source/Core/Core/IOS/USB/OH0/OH0.cpp +++ b/Source/Core/Core/IOS/USB/OH0/OH0.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/OH0/OH0.h" + #include #include #include @@ -9,15 +11,12 @@ #include #include -#include "Common/Assert.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/Logging/Log.h" #include "Core/Core.h" #include "Core/CoreTiming.h" #include "Core/HW/Memmap.h" #include "Core/IOS/USB/Common.h" -#include "Core/IOS/USB/OH0/OH0.h" #include "Core/IOS/USB/USBV0.h" namespace IOS diff --git a/Source/Core/Core/IOS/USB/USBV0.cpp b/Source/Core/Core/IOS/USB/USBV0.cpp index fb844f0f091..3f9e276e4f0 100644 --- a/Source/Core/Core/IOS/USB/USBV0.cpp +++ b/Source/Core/Core/IOS/USB/USBV0.cpp @@ -2,13 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/USBV0.h" + #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/IOS/Device.h" -#include "Core/IOS/USB/USBV0.h" namespace IOS { diff --git a/Source/Core/Core/IOS/USB/USBV4.cpp b/Source/Core/Core/IOS/USB/USBV4.cpp index fae4e2011a0..b28142f1e11 100644 --- a/Source/Core/Core/IOS/USB/USBV4.cpp +++ b/Source/Core/Core/IOS/USB/USBV4.cpp @@ -2,15 +2,16 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/USBV4.h" + #include #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/IOS/Device.h" -#include "Core/IOS/USB/USBV4.h" namespace IOS { diff --git a/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp b/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp index 4734490f1c3..e7c87a1c269 100644 --- a/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp +++ b/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp @@ -2,19 +2,20 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/USB_HID/HIDv4.h" + #include #include #include "Common/Align.h" #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" #include "Core/CoreTiming.h" #include "Core/HW/Memmap.h" #include "Core/IOS/Device.h" #include "Core/IOS/USB/Common.h" #include "Core/IOS/USB/USBV4.h" -#include "Core/IOS/USB/USB_HID/HIDv4.h" namespace IOS { diff --git a/Source/Core/Core/IOS/USB/USB_KBD.cpp b/Source/Core/Core/IOS/USB/USB_KBD.cpp index 5baa6717e46..9fe4443f346 100644 --- a/Source/Core/Core/IOS/USB/USB_KBD.cpp +++ b/Source/Core/Core/IOS/USB/USB_KBD.cpp @@ -2,16 +2,17 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/USB_KBD.h" + #include -#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" #include "Core/Core.h" // Local core functions #include "Core/HW/Memmap.h" -#include "Core/IOS/USB/USB_KBD.h" #ifdef _WIN32 #include diff --git a/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp b/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp index a8171fcedb6..303915f92a3 100644 --- a/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp +++ b/Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp @@ -2,17 +2,19 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/IOS/USB/USB_VEN/VEN.h" + #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" + #include "Core/CoreTiming.h" #include "Core/HW/Memmap.h" #include "Core/IOS/Device.h" #include "Core/IOS/USB/Common.h" #include "Core/IOS/USB/USBV5.h" -#include "Core/IOS/USB/USB_VEN/VEN.h" namespace IOS { diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 7fea082b630..b73e6cbffa6 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -21,7 +21,6 @@ #include #include "Common/Assert.h" -#include "Common/CommonPaths.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Common/StringUtil.h" @@ -33,8 +32,6 @@ #include "Core/PatchEngine.h" #include "Core/PowerPC/PowerPC.h" -using namespace Common; - namespace PatchEngine { const char* PatchTypeStrings[] = { diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp index bb5e0e3a41d..f49ced547e0 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "Core/PowerPC/Interpreter/Interpreter.h" + #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp index 39b1a0db361..5313d2eda27 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp @@ -6,6 +6,7 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "Core/ConfigManager.h" #include "Core/PowerPC/Interpreter/Interpreter.h" diff --git a/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.cpp b/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.cpp index 3aebf23e582..334fe8f7e11 100644 --- a/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.cpp +++ b/Source/Core/Core/PowerPC/Jit64Common/Jit64Base.cpp @@ -9,12 +9,12 @@ #include #include "Common/Assert.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/GekkoDisassembler.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Common/x64Reg.h" #include "Core/HW/Memmap.h" #include "Core/MachineContext.h" diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp index 209d3cffe4d..2606df96828 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp @@ -9,6 +9,7 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/PowerPC/JitArm64/Jit.h" diff --git a/Source/Core/Core/PowerPC/PPCCache.cpp b/Source/Core/Core/PowerPC/PPCCache.cpp index 6b539e50e62..1b8e41b5b18 100644 --- a/Source/Core/Core/PowerPC/PPCCache.cpp +++ b/Source/Core/Core/PowerPC/PPCCache.cpp @@ -7,7 +7,7 @@ #include #include "Common/ChunkFile.h" -#include "Common/CommonFuncs.h" +#include "Common/Swap.h" #include "Core/HW/Memmap.h" #include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/PowerPC.h" diff --git a/Source/Core/Core/ec_wii.cpp b/Source/Core/Core/ec_wii.cpp index 89a68ee3969..fc3b031e49a 100644 --- a/Source/Core/Core/ec_wii.cpp +++ b/Source/Core/Core/ec_wii.cpp @@ -10,14 +10,15 @@ #include "Core/ec_wii.h" #include -#include +#include #include -#include "Common/CommonFuncs.h" +#include "Common/CommonTypes.h" #include "Common/Crypto/ec.h" #include "Common/FileUtil.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" constexpr u32 default_NG_id = 0x0403AC68; constexpr u32 default_NG_key_id = 0x6AAB8C59; diff --git a/Source/Core/DiscIO/Blob.h b/Source/Core/DiscIO/Blob.h index 7f954cd65b0..cf04789b01d 100644 --- a/Source/Core/DiscIO/Blob.h +++ b/Source/Core/DiscIO/Blob.h @@ -17,8 +17,9 @@ #include #include #include -#include "Common/CommonFuncs.h" + #include "Common/CommonTypes.h" +#include "Common/Swap.h" namespace DiscIO { diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp index 914e23191e8..398e085626f 100644 --- a/Source/Core/DiscIO/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/NANDContentLoader.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DiscIO/NANDContentLoader.h" + #include #include #include @@ -15,7 +17,6 @@ #include #include "Common/Align.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Crypto/AES.h" #include "Common/FileUtil.h" @@ -23,9 +24,8 @@ #include "Common/MsgHandler.h" #include "Common/NandPaths.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" -#include "DiscIO/Enums.h" -#include "DiscIO/NANDContentLoader.h" #include "DiscIO/WiiWad.h" namespace DiscIO diff --git a/Source/Core/DiscIO/TGCBlob.cpp b/Source/Core/DiscIO/TGCBlob.cpp index 886bbb6a78c..a3db3681335 100644 --- a/Source/Core/DiscIO/TGCBlob.cpp +++ b/Source/Core/DiscIO/TGCBlob.cpp @@ -2,13 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DiscIO/TGCBlob.h" + #include #include #include -#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" -#include "DiscIO/TGCBlob.h" +#include "Common/Swap.h" namespace { diff --git a/Source/Core/DiscIO/Volume.cpp b/Source/Core/DiscIO/Volume.cpp index 0209bc0f570..640b709ffeb 100644 --- a/Source/Core/DiscIO/Volume.cpp +++ b/Source/Core/DiscIO/Volume.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DiscIO/Volume.h" + #include #include #include @@ -9,12 +11,12 @@ #include #include "Common/ColorUtil.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" + #include "DiscIO/Enums.h" -#include "DiscIO/Volume.h" namespace DiscIO { diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index f3f530e5e43..cd48249ccb8 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -9,9 +9,9 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Core/IOS/ES/Formats.h" #include "DiscIO/Enums.h" diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 71e50252dbb..ad9cd917d5e 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DiscIO/VolumeWiiCrypted.h" + #include #include #include @@ -12,18 +14,17 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" + #include "DiscIO/Blob.h" #include "DiscIO/Enums.h" #include "DiscIO/FileMonitor.h" #include "DiscIO/Filesystem.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeCreator.h" -#include "DiscIO/VolumeGC.h" -#include "DiscIO/VolumeWiiCrypted.h" namespace DiscIO { diff --git a/Source/Core/DiscIO/WbfsBlob.cpp b/Source/Core/DiscIO/WbfsBlob.cpp index 0d249d72ebe..7234978df07 100644 --- a/Source/Core/DiscIO/WbfsBlob.cpp +++ b/Source/Core/DiscIO/WbfsBlob.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DiscIO/WbfsBlob.h" + #include #include #include @@ -12,12 +14,10 @@ #include "Common/Align.h" #include "Common/Assert.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" -#include "Common/Logging/Log.h" #include "Common/MsgHandler.h" -#include "DiscIO/WbfsBlob.h" +#include "Common/Swap.h" namespace DiscIO { diff --git a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp index 11a2f43dd5e..6b106c248d9 100644 --- a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp +++ b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DolphinWX/Cheats/CheatSearchTab.h" + #include #include #include @@ -17,13 +19,13 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/StringUtil.h" -#include "Core/ActionReplay.h" +#include "Common/Swap.h" + #include "Core/Core.h" #include "Core/HW/Memmap.h" -#include "DolphinWX/Cheats/CheatSearchTab.h" + #include "DolphinWX/Cheats/CreateCodeDialog.h" #include "DolphinWX/WxUtils.h" diff --git a/Source/Core/DolphinWX/Cheats/CheatSearchTab.h b/Source/Core/DolphinWX/Cheats/CheatSearchTab.h index 6d53169d685..d62a86659c2 100644 --- a/Source/Core/DolphinWX/Cheats/CheatSearchTab.h +++ b/Source/Core/DolphinWX/Cheats/CheatSearchTab.h @@ -8,6 +8,8 @@ #include #include +#include "Common/CommonTypes.h" + class wxButton; class wxChoice; class wxFocusEvent; diff --git a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp index aaed813d4da..d2080743da6 100644 --- a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp @@ -17,14 +17,14 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/FileSearch.h" #include "Common/FileUtil.h" #include "Common/MsgHandler.h" #include "Common/StringUtil.h" + #include "Core/ConfigManager.h" -#include "Core/HotkeyManager.h" + #include "DolphinWX/Frame.h" #include "DolphinWX/Input/InputConfigDiag.h" #include "DolphinWX/WxUtils.h" diff --git a/Source/Core/DolphinWX/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/FifoPlayerDlg.cpp index 83fa6fd8aea..18ced62d580 100644 --- a/Source/Core/DolphinWX/FifoPlayerDlg.cpp +++ b/Source/Core/DolphinWX/FifoPlayerDlg.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DolphinWX/FifoPlayerDlg.h" + #include #include #include @@ -27,11 +29,11 @@ #include "Common/Assert.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" #include "Core/FifoPlayer/FifoDataFile.h" #include "Core/FifoPlayer/FifoPlaybackAnalyzer.h" #include "Core/FifoPlayer/FifoPlayer.h" #include "Core/FifoPlayer/FifoRecorder.h" -#include "DolphinWX/FifoPlayerDlg.h" #include "DolphinWX/WxUtils.h" #include "VideoCommon/BPMemory.h" #include "VideoCommon/OpcodeDecoding.h" diff --git a/Source/Core/VideoBackends/OGL/SamplerCache.cpp b/Source/Core/VideoBackends/OGL/SamplerCache.cpp index 82cc74daa80..cbde39be6c6 100644 --- a/Source/Core/VideoBackends/OGL/SamplerCache.cpp +++ b/Source/Core/VideoBackends/OGL/SamplerCache.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoBackends/OGL/SamplerCache.h" + #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/GL/GLInterfaceBase.h" -#include "VideoBackends/OGL/SamplerCache.h" #include "VideoCommon/SamplerCommon.h" #include "VideoCommon/VideoConfig.h" diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index 481c66cf713..ecd82f6dbd9 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -6,17 +6,16 @@ #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "VideoBackends/Software/EfbInterface.h" #include "VideoBackends/Software/SWRenderer.h" #include "VideoBackends/Software/TextureSampler.h" #include "VideoCommon/BPMemory.h" -#include "VideoCommon/Fifo.h" #include "VideoCommon/ImageWrite.h" #include "VideoCommon/Statistics.h" #include "VideoCommon/VideoConfig.h" diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index 1392969223c..31248455c59 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -8,9 +8,10 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" + #include "VideoCommon/BPMemory.h" #include "VideoCommon/LookUpTables.h" #include "VideoCommon/PerfQueryBase.h" diff --git a/Source/Core/VideoBackends/Software/TextureEncoder.cpp b/Source/Core/VideoBackends/Software/TextureEncoder.cpp index ae6905f1c2b..92dffe1b4b3 100644 --- a/Source/Core/VideoBackends/Software/TextureEncoder.cpp +++ b/Source/Core/VideoBackends/Software/TextureEncoder.cpp @@ -2,13 +2,15 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoBackends/Software/TextureEncoder.h" + #include "Common/Align.h" #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "VideoBackends/Software/EfbInterface.h" -#include "VideoBackends/Software/TextureEncoder.h" #include "VideoCommon/BPMemory.h" #include "VideoCommon/LookUpTables.h" diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 0a2138f1936..3babc89fc41 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -8,11 +8,11 @@ #include #include "Common/Assert.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MathUtil.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "VideoBackends/Software/NativeVertexFormat.h" #include "VideoBackends/Software/Vec3.h" diff --git a/Source/Core/VideoCommon/DataReader.h b/Source/Core/VideoCommon/DataReader.h index 08c02d64bad..51430d508d1 100644 --- a/Source/Core/VideoCommon/DataReader.h +++ b/Source/Core/VideoCommon/DataReader.h @@ -5,9 +5,10 @@ #pragma once #include + #include "Common/Common.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" class DataReader { diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index e9589f72186..e18931db9c7 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoCommon/HiresTextures.h" + #include #include #include @@ -22,10 +24,10 @@ #include "Common/Logging/Log.h" #include "Common/MemoryUtil.h" #include "Common/StringUtil.h" +#include "Common/Swap.h" #include "Common/Thread.h" #include "Common/Timer.h" #include "Core/ConfigManager.h" -#include "VideoCommon/HiresTextures.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/VideoConfig.h" diff --git a/Source/Core/VideoCommon/TextureDecoder_Common.cpp b/Source/Core/VideoCommon/TextureDecoder_Common.cpp index 7f151b24060..cad1a918e32 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Common.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Common.cpp @@ -5,9 +5,10 @@ #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" + #include "VideoCommon/LookUpTables.h" #include "VideoCommon/TextureDecoder.h" #include "VideoCommon/TextureDecoder_Util.h" diff --git a/Source/Core/VideoCommon/TextureDecoder_Generic.cpp b/Source/Core/VideoCommon/TextureDecoder_Generic.cpp index eb7ed141ef9..cf89cf2632a 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Generic.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Generic.cpp @@ -6,8 +6,9 @@ #include #include "Common/CPUDetect.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" + #include "VideoCommon/LookUpTables.h" #include "VideoCommon/TextureDecoder.h" #include "VideoCommon/TextureDecoder_Util.h" diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index 4697e8ba1b8..3d5da590f5a 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -7,10 +7,10 @@ #include #include "Common/CPUDetect.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Intrinsics.h" #include "Common/MsgHandler.h" +#include "Common/Swap.h" #include "VideoCommon/LookUpTables.h" #include "VideoCommon/TextureDecoder.h" diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp index 8ae672f6e0d..7a87519bd34 100644 --- a/Source/Core/VideoCommon/VertexLoader_Color.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp @@ -4,8 +4,9 @@ #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" + #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexLoaderUtils.h" diff --git a/Source/Core/VideoCommon/VertexLoader_Normal.cpp b/Source/Core/VideoCommon/VertexLoader_Normal.cpp index c780d88cf70..305fd85a6e6 100644 --- a/Source/Core/VideoCommon/VertexLoader_Normal.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Normal.cpp @@ -2,17 +2,18 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoCommon/VertexLoader_Normal.h" + #include #include #include "Common/Common.h" -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" + #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexLoaderUtils.h" -#include "VideoCommon/VertexLoader_Normal.h" // warning: mapping buffer should be disabled to use this #define LOG_NORM() // PRIM_LOG("norm: %f %f %f, ", ((float*)g_vertex_manager_write_ptr)[-3], diff --git a/Source/Core/VideoCommon/VertexLoader_Normal.h b/Source/Core/VideoCommon/VertexLoader_Normal.h index 811d2d05a70..5b91615761c 100644 --- a/Source/Core/VideoCommon/VertexLoader_Normal.h +++ b/Source/Core/VideoCommon/VertexLoader_Normal.h @@ -5,6 +5,7 @@ #pragma once #include "Common/CommonTypes.h" +#include "VideoCommon/VertexLoader.h" class VertexLoader_Normal { diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index 4b528611221..86f1e76e36d 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -2,16 +2,18 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoCommon/VertexLoader_Position.h" + #include #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" + #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexLoaderUtils.h" -#include "VideoCommon/VertexLoader_Position.h" #include "VideoCommon/VideoCommon.h" template diff --git a/Source/Core/VideoCommon/VertexLoader_Position.h b/Source/Core/VideoCommon/VertexLoader_Position.h index b34542128f7..1a8a2855e3c 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.h +++ b/Source/Core/VideoCommon/VertexLoader_Position.h @@ -5,6 +5,7 @@ #pragma once #include "Common/CommonTypes.h" +#include "VideoCommon/VertexLoader.h" class VertexLoader_Position { diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp index aa4e87415c5..99d3a797ece 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.cpp @@ -2,15 +2,17 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoCommon/VertexLoader_TextCoord.h" + #include -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" + #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexLoaderUtils.h" -#include "VideoCommon/VertexLoader_TextCoord.h" template void LOG_TEX(); diff --git a/Source/Core/VideoCommon/VertexLoader_TextCoord.h b/Source/Core/VideoCommon/VertexLoader_TextCoord.h index fe04e5670f7..1b135e46d3e 100644 --- a/Source/Core/VideoCommon/VertexLoader_TextCoord.h +++ b/Source/Core/VideoCommon/VertexLoader_TextCoord.h @@ -5,6 +5,7 @@ #pragma once #include "Common/CommonTypes.h" +#include "VideoCommon/VertexLoader.h" class VertexLoader_TextCoord { diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index abe35ed4229..9a2db744596 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -2,10 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" +#include "Common/Swap.h" + #include "Core/HW/Memmap.h" + #include "VideoCommon/CPMemory.h" #include "VideoCommon/DataReader.h" #include "VideoCommon/Fifo.h" diff --git a/Source/UnitTests/Common/CMakeLists.txt b/Source/UnitTests/Common/CMakeLists.txt index 8a88efe60cc..8b0eed1abff 100644 --- a/Source/UnitTests/Common/CMakeLists.txt +++ b/Source/UnitTests/Common/CMakeLists.txt @@ -11,4 +11,5 @@ add_dolphin_test(FlagTest FlagTest.cpp) add_dolphin_test(MathUtilTest MathUtilTest.cpp) add_dolphin_test(NandPathsTest NandPathsTest.cpp) add_dolphin_test(StringUtilTest StringUtilTest.cpp) +add_dolphin_test(SwapTest SwapTest.cpp) add_dolphin_test(x64EmitterTest x64EmitterTest.cpp) diff --git a/Source/UnitTests/Common/CommonFuncsTest.cpp b/Source/UnitTests/Common/CommonFuncsTest.cpp index c33dbda8c66..88082907715 100644 --- a/Source/UnitTests/Common/CommonFuncsTest.cpp +++ b/Source/UnitTests/Common/CommonFuncsTest.cpp @@ -30,11 +30,3 @@ TEST(CommonFuncs, CrashMacro) { EXPECT_DEATH({ Crash(); }, ""); } - -TEST(CommonFuncs, Swap) -{ - EXPECT_EQ(0xf0, Common::swap8(0xf0)); - EXPECT_EQ(0x1234, Common::swap16(0x3412)); - EXPECT_EQ(0x12345678u, Common::swap32(0x78563412)); - EXPECT_EQ(0x123456789abcdef0ull, Common::swap64(0xf0debc9a78563412ull)); -} diff --git a/Source/UnitTests/Common/SwapTest.cpp b/Source/UnitTests/Common/SwapTest.cpp new file mode 100644 index 00000000000..b44a6efa502 --- /dev/null +++ b/Source/UnitTests/Common/SwapTest.cpp @@ -0,0 +1,15 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include + +#include "Common/Swap.h" + +TEST(Swap, SwapByValue) +{ + EXPECT_EQ(0xf0, Common::swap8(0xf0)); + EXPECT_EQ(0x1234, Common::swap16(0x3412)); + EXPECT_EQ(0x12345678u, Common::swap32(0x78563412)); + EXPECT_EQ(0x123456789abcdef0ull, Common::swap64(0xf0debc9a78563412ull)); +}