From 1fee769aa0429a620dc93b351168396a9ead45c9 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 01:56:39 -0300 Subject: Common: Remove unused enums --- src/common/common.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index f7d0f55c5..d11e57b1e 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -100,21 +100,4 @@ private: # define _M_SSE 0x402 #endif -// Host communication. -enum HOST_COMM -{ - // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on - WM_USER_STOP = 10, - WM_USER_CREATE, - WM_USER_SETCURSOR, -}; - -// Used for notification on emulation state -enum EMUSTATE_CHANGE -{ - EMUSTATE_CHANGE_PLAY = 1, - EMUSTATE_CHANGE_PAUSE, - EMUSTATE_CHANGE_STOP -}; - #include "swap.h" -- cgit v1.2.3 From 7a4b717772daf91819170caf32a71baa845c46ea Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 01:56:18 -0300 Subject: Common: Use C++11 deleted functions for NonCopyable --- src/common/common.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index d11e57b1e..d64635620 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -14,15 +14,13 @@ #define STACKALIGN // An inheritable class to disallow the copy constructor and operator= functions -class NonCopyable -{ +class NonCopyable { protected: - NonCopyable() {} - NonCopyable(const NonCopyable&&) {} - void operator=(const NonCopyable&&) {} -private: - NonCopyable(NonCopyable&); - NonCopyable& operator=(NonCopyable& other); + NonCopyable() = default; + ~NonCopyable() = default; + + NonCopyable(NonCopyable&) = delete; + NonCopyable& operator=(NonCopyable&) = delete; }; #include "common/assert.h" -- cgit v1.2.3 From 6ad71c216b2d1112c96d621140c60b4e1b359811 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 04:05:02 -0300 Subject: Common: Move NonCopyable to common_types.h --- src/common/common.h | 10 ---------- src/common/common_types.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index d64635620..a4a403fb9 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -13,16 +13,6 @@ #define STACKALIGN -// An inheritable class to disallow the copy constructor and operator= functions -class NonCopyable { -protected: - NonCopyable() = default; - ~NonCopyable() = default; - - NonCopyable(NonCopyable&) = delete; - NonCopyable& operator=(NonCopyable&) = delete; -}; - #include "common/assert.h" #include "common/logging/log.h" #include "common/common_types.h" diff --git a/src/common/common_types.h b/src/common/common_types.h index 1b453e7f5..5c004c5fa 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -73,6 +73,16 @@ union t64 { u8 _u8[8]; ///< 8-bit unsigned char(s) }; +// An inheritable class to disallow the copy constructor and operator= functions +class NonCopyable { +protected: + NonCopyable() = default; + ~NonCopyable() = default; + + NonCopyable(NonCopyable&) = delete; + NonCopyable& operator=(NonCopyable&) = delete; +}; + namespace Common { /// Rectangle data structure class Rect { -- cgit v1.2.3 From c916bcf7b53bb7d0e909e7ec45b0740a09a661b6 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 01:57:23 -0300 Subject: Move typedefs from kernel.h to more appropriate places --- src/common/common_types.h | 5 +++++ src/core/hle/hle.h | 7 +++++++ src/core/hle/kernel/kernel.h | 11 +---------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/common/common_types.h b/src/common/common_types.h index 5c004c5fa..644709ba6 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -47,6 +47,11 @@ typedef std::int64_t s64; ///< 64-bit signed int typedef float f32; ///< 32-bit floating point typedef double f64; ///< 64-bit floating point +// TODO: It would be nice to eventually replace these with strong types that prevent accidental +// conversion between each other. +typedef u32 VAddr; ///< Represents a pointer in the userspace virtual address space. +typedef u32 PAddr; ///< Represents a pointer in the ARM11 physical address space. + /// Union for fast 16-bit type casting union t16 { u8 _u8[2]; ///< 8-bit unsigned char(s) diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index 23de1aab7..e0b97797c 100644 --- a/src/core/hle/hle.h +++ b/src/core/hle/hle.h @@ -4,6 +4,13 @@ #pragma once +#include "common/common_types.h" + +typedef u32 Handle; +typedef s32 Result; + +const Handle INVALID_HANDLE = 0; + namespace HLE { extern bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index ab06fa025..80a09cadc 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -11,18 +11,9 @@ #include #include "common/common.h" +#include "core/hle/hle.h" #include "core/hle/result.h" -typedef u32 Handle; -typedef s32 Result; - -// TODO: It would be nice to eventually replace these with strong types that prevent accidental -// conversion between each other. -typedef u32 VAddr; ///< Represents a pointer in the userspace virtual address space. -typedef u32 PAddr; ///< Represents a pointer in the ARM11 physical address space. - -const Handle INVALID_HANDLE = 0; - namespace Kernel { class Thread; -- cgit v1.2.3 From 6f89d25f908e6c08e1cf20546b43dc269a93409b Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 02:15:46 -0300 Subject: FileSys: Clean-up includes, de-inline destructors --- src/core/file_sys/archive_backend.h | 17 ++++++++++------- src/core/file_sys/disk_archive.h | 2 ++ src/core/file_sys/ivfc_archive.h | 2 ++ src/core/hle/service/cfg/cfg.cpp | 5 +++-- src/core/hle/service/fs/archive.cpp | 10 ++++++++++ src/core/hle/service/fs/archive.h | 16 ++++++---------- src/core/hle/service/ptm/ptm.cpp | 3 ++- 7 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 43a106549..1956d76cb 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -5,22 +5,25 @@ #pragma once #include +#include +#include +#include +#include +#include "common/bit_field.h" #include "common/common_types.h" +#include "common/logging/log.h" #include "common/string_util.h" -#include "common/bit_field.h" - -#include "core/file_sys/file_backend.h" -#include "core/file_sys/directory_backend.h" +#include "core/hle/result.h" #include "core/mem_map.h" -#include "core/hle/kernel/kernel.h" -//////////////////////////////////////////////////////////////////////////////////////////////////// -// FileSys namespace namespace FileSys { +class FileBackend; +class DirectoryBackend; + // Path string type enum LowPathType : u32 { Invalid = 0, diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 770bd715e..a22d3837a 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -8,6 +8,8 @@ #include "common/file_util.h" #include "core/file_sys/archive_backend.h" +#include "core/file_sys/directory_backend.h" +#include "core/file_sys/file_backend.h" #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 1aff9e0a4..10415798d 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -10,6 +10,8 @@ #include "common/common_types.h" #include "core/file_sys/archive_backend.h" +#include "core/file_sys/directory_backend.h" +#include "core/file_sys/file_backend.h" #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 5eccdecf7..94bac5498 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -4,12 +4,13 @@ #include -#include "core/hle/service/fs/archive.h" -#include "core/hle/service/service.h" +#include "core/file_sys/file_backend.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" #include "core/hle/service/cfg/cfg_s.h" #include "core/hle/service/cfg/cfg_u.h" +#include "core/hle/service/fs/archive.h" +#include "core/hle/service/service.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index b0fd834c7..a6ed08929 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -78,6 +78,11 @@ enum class DirectoryCommand : u32 { Close = 0x08020000, }; +File::File(std::unique_ptr&& backend, const FileSys::Path & path) + : path(path), priority(0), backend(std::move(backend)) {} + +File::~File() {} + ResultVal File::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); FileCommand cmd = static_cast(cmd_buff[0]); @@ -172,6 +177,11 @@ ResultVal File::SyncRequest() { return MakeResult(false); } +Directory::Directory(std::unique_ptr&& backend, const FileSys::Path & path) + : path(path), backend(std::move(backend)) {} + +Directory::~Directory() {} + ResultVal Directory::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); DirectoryCommand cmd = static_cast(cmd_buff[0]); diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index b00f0fd60..faab0cb79 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -45,31 +45,27 @@ typedef u64 ArchiveHandle; class File : public Kernel::Session { public: - File(std::unique_ptr&& backend, const FileSys::Path& path) - : path(path), priority(0), backend(std::move(backend)) { - } + File(std::unique_ptr&& backend, const FileSys::Path& path); + ~File(); std::string GetName() const override { return "Path: " + path.DebugStr(); } + ResultVal SyncRequest() override; FileSys::Path path; ///< Path of the file u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means std::unique_ptr backend; ///< File backend interface - - ResultVal SyncRequest() override; }; class Directory : public Kernel::Session { public: - Directory(std::unique_ptr&& backend, const FileSys::Path& path) - : path(path), backend(std::move(backend)) { - } + Directory(std::unique_ptr&& backend, const FileSys::Path& path); + ~Directory(); std::string GetName() const override { return "Directory: " + path.DebugStr(); } + ResultVal SyncRequest() override; FileSys::Path path; ///< Path of the directory std::unique_ptr backend; ///< File backend interface - - ResultVal SyncRequest() override; }; /** diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index d44510c1b..6480a323d 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -2,12 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/service.h" +#include "core/file_sys/file_backend.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ptm_play.h" #include "core/hle/service/ptm/ptm_sysm.h" #include "core/hle/service/ptm/ptm_u.h" +#include "core/hle/service/service.h" namespace Service { namespace PTM { -- cgit v1.2.3 From b89f644cfef7592a501f1c0b9aae0c4ae757d854 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 02:29:11 -0300 Subject: FileSys: De-inline Path members --- src/core/CMakeLists.txt | 1 + src/core/file_sys/archive_backend.cpp | 127 ++++++++++++++++++++++++++++++++ src/core/file_sys/archive_backend.h | 134 +++------------------------------- src/core/hle/service/cfg/cfg.cpp | 2 + 4 files changed, 139 insertions(+), 125 deletions(-) create mode 100644 src/core/file_sys/archive_backend.cpp diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 42733b95e..fa6b4215a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -12,6 +12,7 @@ set(SRCS arm/skyeye_common/vfp/vfpdouble.cpp arm/skyeye_common/vfp/vfpinstr.cpp arm/skyeye_common/vfp/vfpsingle.cpp + file_sys/archive_backend.cpp file_sys/archive_extsavedata.cpp file_sys/archive_romfs.cpp file_sys/archive_savedata.cpp diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp new file mode 100644 index 000000000..0439868ab --- /dev/null +++ b/src/core/file_sys/archive_backend.cpp @@ -0,0 +1,127 @@ +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include + +#include "common/logging/log.h" +#include "common/string_util.h" + +#include "core/file_sys/archive_backend.h" +#include "core/mem_map.h" + + +namespace FileSys { + +Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) { + switch (type) { + case Binary: + { + u8* data = Memory::GetPointer(pointer); + binary = std::vector(data, data + size); + break; + } + + case Char: + { + const char* data = reinterpret_cast(Memory::GetPointer(pointer)); + string = std::string(data, size - 1); // Data is always null-terminated. + break; + } + + case Wchar: + { + const char16_t* data = reinterpret_cast(Memory::GetPointer(pointer)); + u16str = std::u16string(data, size/2 - 1); // Data is always null-terminated. + break; + } + + default: + break; + } +} + +const std::string Path::DebugStr() const { + switch (GetType()) { + case Invalid: + default: + return "[Invalid]"; + case Empty: + return "[Empty]"; + case Binary: + { + std::stringstream res; + res << "[Binary: "; + for (unsigned byte : binary) + res << std::hex << std::setw(2) << std::setfill('0') << byte; + res << ']'; + return res.str(); + } + case Char: + return "[Char: " + AsString() + ']'; + case Wchar: + return "[Wchar: " + AsString() + ']'; + } +} + +const std::string Path::AsString() const { + switch (GetType()) { + case Char: + return string; + case Wchar: + return Common::UTF16ToUTF8(u16str); + case Empty: + return{}; + case Invalid: + case Binary: + default: + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); + return{}; + } +} + +const std::u16string Path::AsU16Str() const { + switch (GetType()) { + case Char: + return Common::UTF8ToUTF16(string); + case Wchar: + return u16str; + case Empty: + return{}; + case Invalid: + case Binary: + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); + return{}; + } +} + +const std::vector Path::AsBinary() const { + switch (GetType()) { + case Binary: + return binary; + case Char: + return std::vector(string.begin(), string.end()); + case Wchar: + { + // use two u8 for each character of u16str + std::vector to_return(u16str.size() * 2); + for (size_t i = 0; i < u16str.size(); ++i) { + u16 tmp_char = u16str.at(i); + to_return[i*2] = (tmp_char & 0xFF00) >> 8; + to_return[i*2 + 1] = (tmp_char & 0x00FF); + } + return to_return; + } + case Empty: + return{}; + case Invalid: + default: + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); + return{}; + } +} + +} diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 1956d76cb..c6a1be79d 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -5,18 +5,14 @@ #pragma once #include -#include #include #include #include #include "common/bit_field.h" #include "common/common_types.h" -#include "common/logging/log.h" -#include "common/string_util.h" #include "core/hle/result.h" -#include "core/mem_map.h" namespace FileSys { @@ -42,134 +38,22 @@ union Mode { class Path { public: + Path() : type(Invalid) {} + Path(const char* path) : type(Char), string(path) {} + Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) {} + Path(LowPathType type, u32 size, u32 pointer); - Path() : type(Invalid) { - } - - Path(const char* path) : type(Char), string(path) { - } - - Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) { - } - - Path(LowPathType type, u32 size, u32 pointer) : type(type) { - switch (type) { - case Binary: - { - u8* data = Memory::GetPointer(pointer); - binary = std::vector(data, data + size); - break; - } - - case Char: - { - const char* data = reinterpret_cast(Memory::GetPointer(pointer)); - string = std::string(data, size - 1); // Data is always null-terminated. - break; - } - - case Wchar: - { - const char16_t* data = reinterpret_cast(Memory::GetPointer(pointer)); - u16str = std::u16string(data, size/2 - 1); // Data is always null-terminated. - break; - } - - default: - break; - } - } - - LowPathType GetType() const { - return type; - } + LowPathType GetType() const { return type; } /** * Gets the string representation of the path for debugging * @return String representation of the path for debugging */ - const std::string DebugStr() const { - switch (GetType()) { - case Invalid: - default: - return "[Invalid]"; - case Empty: - return "[Empty]"; - case Binary: - { - std::stringstream res; - res << "[Binary: "; - for (unsigned byte : binary) - res << std::hex << std::setw(2) << std::setfill('0') << byte; - res << ']'; - return res.str(); - } - case Char: - return "[Char: " + AsString() + ']'; - case Wchar: - return "[Wchar: " + AsString() + ']'; - } - } + const std::string DebugStr() const; - const std::string AsString() const { - switch (GetType()) { - case Char: - return string; - case Wchar: - return Common::UTF16ToUTF8(u16str); - case Empty: - return {}; - case Invalid: - case Binary: - default: - // TODO(yuriks): Add assert - LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); - return {}; - } - } - - const std::u16string AsU16Str() const { - switch (GetType()) { - case Char: - return Common::UTF8ToUTF16(string); - case Wchar: - return u16str; - case Empty: - return {}; - case Invalid: - case Binary: - // TODO(yuriks): Add assert - LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); - return {}; - } - } - - const std::vector AsBinary() const { - switch (GetType()) { - case Binary: - return binary; - case Char: - return std::vector(string.begin(), string.end()); - case Wchar: - { - // use two u8 for each character of u16str - std::vector to_return(u16str.size() * 2); - for (size_t i = 0; i < u16str.size(); ++i) { - u16 tmp_char = u16str.at(i); - to_return[i*2] = (tmp_char & 0xFF00) >> 8; - to_return[i*2 + 1] = (tmp_char & 0x00FF); - } - return to_return; - } - case Empty: - return {}; - case Invalid: - default: - // TODO(yuriks): Add assert - LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); - return {}; - } - } + const std::string AsString() const; + const std::u16string AsU16Str() const; + const std::vector AsBinary() const; private: LowPathType type; diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 94bac5498..207f660e6 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -4,6 +4,8 @@ #include +#include "common/string_util.h" + #include "core/file_sys/file_backend.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" -- cgit v1.2.3 From c0eaa662d47daa7a148fd63b2634ea59a559296c Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 02:42:43 -0300 Subject: Clean-up includes --- src/common/assert.h | 1 + src/core/arm/interpreter/armsupp.cpp | 2 ++ src/core/arm/skyeye_common/armmmu.h | 2 ++ src/core/file_sys/directory_backend.h | 3 +-- src/core/file_sys/file_backend.h | 3 +-- src/core/hle/config_mem.cpp | 5 ++++- src/core/hle/shared_page.cpp | 4 +++- src/core/mem_map.h | 3 --- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/common/assert.h b/src/common/assert.h index 9ca7adb15..4f26c63e9 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include "common/common_funcs.h" diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp index a68d53695..15c6f595b 100644 --- a/src/core/arm/interpreter/armsupp.cpp +++ b/src/core/arm/interpreter/armsupp.cpp @@ -15,6 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "common/logging/log.h" + #include "core/mem_map.h" #include "core/arm/skyeye_common/armdefs.h" #include "core/arm/skyeye_common/arm_regformat.h" diff --git a/src/core/arm/skyeye_common/armmmu.h b/src/core/arm/skyeye_common/armmmu.h index 22e564c3d..0463d83c8 100644 --- a/src/core/arm/skyeye_common/armmmu.h +++ b/src/core/arm/skyeye_common/armmmu.h @@ -20,6 +20,8 @@ #pragma once +#include "common/swap.h" + #include "core/mem_map.h" #include "core/arm/skyeye_common/armdefs.h" diff --git a/src/core/file_sys/directory_backend.h b/src/core/file_sys/directory_backend.h index 7f327dc42..a25dc0cfa 100644 --- a/src/core/file_sys/directory_backend.h +++ b/src/core/file_sys/directory_backend.h @@ -4,12 +4,11 @@ #pragma once +#include #include #include "common/common_types.h" -#include "core/hle/kernel/kernel.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index 35890af1f..0b0f8a42a 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -4,10 +4,9 @@ #pragma once +#include "common/common.h" #include "common/common_types.h" -#include "core/hle/kernel/kernel.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp index 9fcfcc285..35dc9cf58 100644 --- a/src/core/hle/config_mem.cpp +++ b/src/core/hle/config_mem.cpp @@ -2,6 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + +#include "common/assert.h" #include "common/common_types.h" #include "common/common_funcs.h" @@ -61,7 +64,7 @@ template void Read(u16 &var, const u32 addr); template void Read(u8 &var, const u32 addr); void Init() { - memset(&config_mem, 0, sizeof(config_mem)); + std::memset(&config_mem, 0, sizeof(config_mem)); config_mem.update_flag = 0; // No update config_mem.sys_core_ver = 0x2; diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp index 94fae2551..4f227a370 100644 --- a/src/core/hle/shared_page.cpp +++ b/src/core/hle/shared_page.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/common_types.h" #include "common/common_funcs.h" @@ -62,7 +64,7 @@ template void Read(u16 &var, const u32 addr); template void Read(u8 &var, const u32 addr); void Set3DSlider(float amount) { - memset(&shared_page, 0, sizeof(shared_page)); + std::memset(&shared_page, 0, sizeof(shared_page)); shared_page.sliderstate_3d = amount; shared_page.ledstate_3d = (amount == 0.0f); // off when non-zero diff --git a/src/core/mem_map.h b/src/core/mem_map.h index 1af02973b..b11f2ea68 100644 --- a/src/core/mem_map.h +++ b/src/core/mem_map.h @@ -4,11 +4,8 @@ #pragma once -#include "common/common.h" #include "common/common_types.h" -#include "core/hle/kernel/kernel.h" - namespace Memory { //////////////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From bf12f270b3c74f694c789a57cc69f414753ca080 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 22:59:59 -0300 Subject: Common: Remove many unnecessary cross-platform compatibility macros --- CMakeLists.txt | 7 +++++-- src/citra/citra.cpp | 2 +- src/citra_qt/main.cpp | 2 +- src/common/common.h | 43 +++++-------------------------------------- src/common/common_funcs.h | 10 +++------- src/common/file_util.cpp | 4 ++-- src/common/platform.h | 40 ---------------------------------------- src/common/profiler.cpp | 1 - 8 files changed, 17 insertions(+), 92 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 516aba554..b0fe285db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,11 @@ if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") else() - # Silence deprecation warnings - add_definitions(/D_CRT_SECURE_NO_WARNINGS) + # Silence "deprecation" warnings + add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE) + # Avoid windows.h junk + add_definitions(/DNOMINMAX) + # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 2c6ced920..634faf76b 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -19,7 +19,7 @@ #include "citra/emu_window/emu_window_glfw.h" /// Application entry point -int __cdecl main(int argc, char **argv) { +int main(int argc, char **argv) { std::shared_ptr logger = Log::InitGlobalLogger(); Log::Filter log_filter(Log::Level::Debug); Log::SetFilter(&log_filter); diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index dd0e4de8f..b78594fb6 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -349,7 +349,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) #undef main #endif -int __cdecl main(int argc, char* argv[]) +int main(int argc, char* argv[]) { std::shared_ptr logger = Log::InitGlobalLogger(); Log::Filter log_filter(Log::Level::Info); diff --git a/src/common/common.h b/src/common/common.h index a4a403fb9..00d1d14f9 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -11,8 +11,6 @@ #include #include -#define STACKALIGN - #include "common/assert.h" #include "common/logging/log.h" #include "common/common_types.h" @@ -20,56 +18,25 @@ #include "common/common_paths.h" #include "common/platform.h" -#ifdef __APPLE__ -// The Darwin ABI requires that stack frames be aligned to 16-byte boundaries. -// This is only needed on i386 gcc - x86_64 already aligns to 16 bytes. - #if defined __i386__ && defined __GNUC__ - #undef STACKALIGN - #define STACKALIGN __attribute__((__force_align_arg_pointer__)) - #endif -#elif defined _WIN32 -// Check MSC ver - #if defined _MSC_VER && _MSC_VER <= 1000 - #error needs at least version 1000 of MSC - #endif - - #ifndef NOMINMAX - #define NOMINMAX - #endif - -// Alignment +#ifdef _WIN32 + // Alignment #define MEMORY_ALIGNED16(x) __declspec(align(16)) x #define MEMORY_ALIGNED32(x) __declspec(align(32)) x #define MEMORY_ALIGNED64(x) __declspec(align(64)) x #define MEMORY_ALIGNED128(x) __declspec(align(128)) x - #define MEMORY_ALIGNED16_DECL(x) __declspec(align(16)) x - #define MEMORY_ALIGNED64_DECL(x) __declspec(align(64)) x -#endif - -// Windows compatibility -#ifndef _WIN32 +#else + // Windows compatibility #ifdef _LP64 #define _M_X64 1 #else #define _M_IX86 1 #endif + #define __forceinline inline __attribute__((always_inline)) #define MEMORY_ALIGNED16(x) __attribute__((aligned(16))) x #define MEMORY_ALIGNED32(x) __attribute__((aligned(32))) x #define MEMORY_ALIGNED64(x) __attribute__((aligned(64))) x #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x - #define MEMORY_ALIGNED16_DECL(x) __attribute__((aligned(16))) x - #define MEMORY_ALIGNED64_DECL(x) __attribute__((aligned(64))) x -#endif - -#ifdef _MSC_VER - #define __strdup _strdup - #define __getcwd _getcwd - #define __chdir _chdir -#else - #define __strdup strdup - #define __getcwd getcwd - #define __chdir chdir #endif #if defined _M_GENERIC diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index e76cb7d68..9e666d77e 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -73,16 +73,12 @@ inline u64 _rotr64(u64 x, unsigned int shift){ } #else // _MSC_VER -#include + #include -// Function Cross-Compatibility - #define strcasecmp _stricmp - #define strncasecmp _strnicmp - #define unlink _unlink + // Function Cross-Compatibility #define snprintf _snprintf - #define vscprintf _vscprintf -// Locale Cross-Compatibility + // Locale Cross-Compatibility #define locale_t _locale_t #define freelocale _free_locale #define newlocale(mask, locale, base) _create_locale(mask, locale) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 4ef4918d7..25d7d4b9f 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -589,7 +589,7 @@ std::string GetCurrentDir() { char *dir; // Get the current working directory (getcwd uses malloc) - if (!(dir = __getcwd(nullptr, 0))) { + if (!(dir = getcwd(nullptr, 0))) { LOG_ERROR(Common_Filesystem, "GetCurrentDirectory failed: %s", GetLastErrorMsg()); @@ -603,7 +603,7 @@ std::string GetCurrentDir() // Sets the current directory to the given directory bool SetCurrentDir(const std::string &directory) { - return __chdir(directory.c_str()) == 0; + return chdir(directory.c_str()) == 0; } #if defined(__APPLE__) diff --git a/src/common/platform.h b/src/common/platform.h index e27d6e31f..fc680d549 100644 --- a/src/common/platform.h +++ b/src/common/platform.h @@ -66,45 +66,5 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // Compiler-Specific Definitions -#if EMU_PLATFORM == PLATFORM_WINDOWS - -#include - -#ifndef NOMINMAX -#define NOMINMAX -#endif -#define EMU_FASTCALL __fastcall - -#ifdef _MSC_VER -inline struct tm* localtime_r(const time_t *clock, struct tm *result) { - if (localtime_s(result, clock) == 0) - return result; - return nullptr; -} -#endif - -#else // EMU_PLATFORM != PLATFORM_WINDOWS - -#define EMU_FASTCALL __attribute__((fastcall)) -#define __stdcall -#define __cdecl - -#define BOOL bool -#define DWORD u32 - -// TODO: Hacks.. -#include - -#include -#define stricmp(str1, str2) strcasecmp(str1, str2) -#define _stricmp(str1, str2) strcasecmp(str1, str2) -#define _snprintf snprintf -#define _getcwd getcwd -#define _tzset tzset - -typedef void EXCEPTION_POINTERS; - -#endif - #define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \ (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp index 65c3df167..b8cde1785 100644 --- a/src/common/profiler.cpp +++ b/src/common/profiler.cpp @@ -7,7 +7,6 @@ #include "common/assert.h" #if defined(_MSC_VER) && _MSC_VER <= 1800 // MSVC 2013. -#define NOMINMAX #define WIN32_LEAN_AND_MEAN #include // For QueryPerformanceCounter/Frequency #endif -- cgit v1.2.3 From f3c096951be57a02467bfda74ab539e69b2eff5e Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 23:06:01 -0300 Subject: Common: Move IO-specific compatibility macros to file_util.cpp --- src/common/common_funcs.h | 8 -------- src/common/file_util.cpp | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 9e666d77e..56ae791d4 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -117,14 +117,6 @@ inline u64 _rotr64(u64 x, unsigned int shift){ return old_locale; } -// 64 bit offsets for windows - #define fseeko _fseeki64 - #define ftello _ftelli64 - #define atoll _atoi64 - #define stat64 _stat64 - #define fstat64 _fstat64 - #define fileno _fileno - extern "C" { __declspec(dllimport) void __stdcall DebugBreak(void); } diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 25d7d4b9f..946c4261a 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -7,37 +7,45 @@ #include "common/file_util.h" #ifdef _WIN32 -#include -#include // for SHGetFolderPath -#include -#include // for GetSaveFileName -#include -#include // getcwd -#include + #include + #include // for SHGetFolderPath + #include + #include // for GetSaveFileName + #include + #include // getcwd + #include + + // 64 bit offsets for windows + #define fseeko _fseeki64 + #define ftello _ftelli64 + #define atoll _atoi64 + #define stat64 _stat64 + #define fstat64 _fstat64 + #define fileno _fileno #else -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include #endif #if defined(__APPLE__) -#include -#include -#include + #include + #include + #include #endif #include #include #ifndef S_ISDIR -#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) + #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) #endif #ifdef BSD4_4 -#define stat64 stat -#define fstat64 fstat + #define stat64 stat + #define fstat64 fstat #endif // This namespace has various generic functions related to files and paths. -- cgit v1.2.3 From a594fdb66e70f6dd45ed8ed1a0969262b0529395 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 23:13:27 -0300 Subject: Common: Remove more unused compatibility defines --- src/common/common_funcs.h | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 56ae791d4..973d83544 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -7,13 +7,6 @@ #include "common_types.h" #include -#ifdef _WIN32 -#define SLEEP(x) Sleep(x) -#else -#include -#define SLEEP(x) usleep(x*1000) -#endif - #define b2(x) ( (x) | ( (x) >> 1) ) #define b4(x) ( b2(x) | ( b2(x) >> 2) ) @@ -73,49 +66,11 @@ inline u64 _rotr64(u64 x, unsigned int shift){ } #else // _MSC_VER - #include - // Function Cross-Compatibility #define snprintf _snprintf // Locale Cross-Compatibility #define locale_t _locale_t - #define freelocale _free_locale - #define newlocale(mask, locale, base) _create_locale(mask, locale) - - #define LC_GLOBAL_LOCALE ((locale_t)-1) - #define LC_ALL_MASK LC_ALL - #define LC_COLLATE_MASK LC_COLLATE - #define LC_CTYPE_MASK LC_CTYPE - #define LC_MONETARY_MASK LC_MONETARY - #define LC_NUMERIC_MASK LC_NUMERIC - #define LC_TIME_MASK LC_TIME - - inline locale_t uselocale(locale_t new_locale) - { - // Retrieve the current per thread locale setting - bool bIsPerThread = (_configthreadlocale(0) == _ENABLE_PER_THREAD_LOCALE); - - // Retrieve the current thread-specific locale - locale_t old_locale = bIsPerThread ? _get_current_locale() : LC_GLOBAL_LOCALE; - - if(new_locale == LC_GLOBAL_LOCALE) - { - // Restore the global locale - _configthreadlocale(_DISABLE_PER_THREAD_LOCALE); - } - else if(new_locale != nullptr) - { - // Configure the thread to set the locale only for this thread - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); - - // Set all locale categories - for(int i = LC_MIN; i <= LC_MAX; i++) - setlocale(i, new_locale->locinfo->lc_category[i].locale); - } - - return old_locale; - } extern "C" { __declspec(dllimport) void __stdcall DebugBreak(void); -- cgit v1.2.3 From ae963d75f8ac37dd870054c20ff14f4e5418f661 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 23:18:04 -0300 Subject: Common: Move SSE detection ifdefs to platform.h --- src/common/common.h | 16 ---------------- src/common/hash.cpp | 2 ++ src/common/platform.h | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index 00d1d14f9..e8d32bc93 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -39,20 +39,4 @@ #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x #endif -#if defined _M_GENERIC -# define _M_SSE 0x0 -#elif defined __GNUC__ -# if defined __SSE4_2__ -# define _M_SSE 0x402 -# elif defined __SSE4_1__ -# define _M_SSE 0x401 -# elif defined __SSSE3__ -# define _M_SSE 0x301 -# elif defined __SSE3__ -# define _M_SSE 0x300 -# endif -#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008 -# define _M_SSE 0x402 -#endif - #include "swap.h" diff --git a/src/common/hash.cpp b/src/common/hash.cpp index 0624dab8d..3e62beff4 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -5,6 +5,8 @@ #include #include "common/hash.h" +#include "common/platform.h" + #if _M_SSE >= 0x402 #include "common/cpu_detect.h" #include diff --git a/src/common/platform.h b/src/common/platform.h index fc680d549..1516dc88a 100644 --- a/src/common/platform.h +++ b/src/common/platform.h @@ -63,6 +63,25 @@ #define EMU_ARCHITECTURE_X86 #endif +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Feature detection + +#if defined _M_GENERIC +# define _M_SSE 0x0 +#elif defined __GNUC__ +# if defined __SSE4_2__ +# define _M_SSE 0x402 +# elif defined __SSE4_1__ +# define _M_SSE 0x401 +# elif defined __SSSE3__ +# define _M_SSE 0x301 +# elif defined __SSE3__ +# define _M_SSE 0x300 +# endif +#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008 +# define _M_SSE 0x402 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////// // Compiler-Specific Definitions -- cgit v1.2.3 From 1bd1a13a02e317a50252b0b5d5077b6ab2dbef53 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 23:26:19 -0300 Subject: Common: Move alignment macros to common_funcs.h --- src/common/common.h | 21 --------------------- src/common/common_funcs.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index e8d32bc93..a9d3a6e6a 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -18,25 +18,4 @@ #include "common/common_paths.h" #include "common/platform.h" -#ifdef _WIN32 - // Alignment - #define MEMORY_ALIGNED16(x) __declspec(align(16)) x - #define MEMORY_ALIGNED32(x) __declspec(align(32)) x - #define MEMORY_ALIGNED64(x) __declspec(align(64)) x - #define MEMORY_ALIGNED128(x) __declspec(align(128)) x -#else - // Windows compatibility - #ifdef _LP64 - #define _M_X64 1 - #else - #define _M_IX86 1 - #endif - - #define __forceinline inline __attribute__((always_inline)) - #define MEMORY_ALIGNED16(x) __attribute__((aligned(16))) x - #define MEMORY_ALIGNED32(x) __attribute__((aligned(32))) x - #define MEMORY_ALIGNED64(x) __attribute__((aligned(64))) x - #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x -#endif - #include "swap.h" diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 973d83544..4f9e514c9 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -27,6 +27,27 @@ #define INSERT_PADDING_BYTES(num_bytes) u8 CONCAT2(pad, __LINE__)[(num_bytes)] #define INSERT_PADDING_WORDS(num_words) u32 CONCAT2(pad, __LINE__)[(num_words)] +#ifdef _WIN32 + // Alignment + #define MEMORY_ALIGNED16(x) __declspec(align(16)) x + #define MEMORY_ALIGNED32(x) __declspec(align(32)) x + #define MEMORY_ALIGNED64(x) __declspec(align(64)) x + #define MEMORY_ALIGNED128(x) __declspec(align(128)) x +#else + // Windows compatibility + #ifdef _LP64 + #define _M_X64 1 + #else + #define _M_IX86 1 + #endif + + #define __forceinline inline __attribute__((always_inline)) + #define MEMORY_ALIGNED16(x) __attribute__((aligned(16))) x + #define MEMORY_ALIGNED32(x) __attribute__((aligned(32))) x + #define MEMORY_ALIGNED64(x) __attribute__((aligned(64))) x + #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x +#endif + #ifndef _MSC_VER #include -- cgit v1.2.3 From e1fbac3ca13d37d2625c11d30cfdece4327b446b Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 04:06:12 -0300 Subject: Common: Remove common.h --- src/citra/citra.cpp | 2 +- src/citra/config.cpp | 3 +++ src/citra/emu_window/emu_window_glfw.cpp | 2 +- src/citra_qt/bootmanager.cpp | 1 - src/citra_qt/bootmanager.h | 1 - src/citra_qt/debugger/disassembler.cpp | 1 - src/citra_qt/debugger/disassembler.h | 2 +- src/citra_qt/debugger/graphics_breakpoints.cpp | 2 ++ src/citra_qt/debugger/ramview.cpp | 3 ++- src/citra_qt/main.cpp | 1 - src/common/CMakeLists.txt | 1 - src/common/bit_field.h | 2 +- src/common/break_points.cpp | 1 - src/common/break_points.h | 2 +- src/common/chunk_file.h | 3 ++- src/common/common.h | 21 --------------------- src/common/common_paths.h | 3 --- src/common/concurrent_ring_buffer.h | 2 +- src/common/emu_window.h | 6 +++--- src/common/file_util.cpp | 6 ++++-- src/common/file_util.h | 2 +- src/common/hash.cpp | 1 + src/common/hash.h | 2 +- src/common/linear_disk_cache.h | 2 +- src/common/logging/text_formatter.cpp | 1 + src/common/math_util.cpp | 6 +++--- src/common/math_util.h | 2 +- src/common/mem_arena.cpp | 6 +++++- src/common/mem_arena.h | 2 +- src/common/memory_util.cpp | 3 ++- src/common/misc.cpp | 4 +++- src/common/string_util.cpp | 4 +++- src/common/string_util.h | 2 +- src/common/symbols.h | 4 +++- src/common/thread.h | 1 - src/common/thread_queue_list.h | 2 -- src/common/thunk.h | 2 +- src/common/timer.cpp | 4 ++-- src/common/timer.h | 2 +- src/core/arm/arm_interface.h | 1 - src/core/arm/dyncom/arm_dyncom.cpp | 2 ++ src/core/arm/skyeye_common/vfp/vfp.cpp | 1 - src/core/core.cpp | 1 + src/core/core_timing.h | 2 +- src/core/file_sys/archive_extsavedata.cpp | 1 + src/core/file_sys/archive_romfs.cpp | 1 + src/core/file_sys/archive_savedata.cpp | 1 + src/core/file_sys/archive_savedatacheck.cpp | 1 + src/core/file_sys/archive_sdmc.cpp | 1 + src/core/file_sys/disk_archive.cpp | 1 + src/core/file_sys/file_backend.h | 1 - src/core/file_sys/ivfc_archive.cpp | 1 + src/core/hle/kernel/address_arbiter.cpp | 1 + src/core/hle/kernel/event.cpp | 2 +- src/core/hle/kernel/kernel.cpp | 3 ++- src/core/hle/kernel/kernel.h | 3 ++- src/core/hle/kernel/mutex.cpp | 2 +- src/core/hle/kernel/semaphore.cpp | 2 +- src/core/hle/kernel/shared_memory.cpp | 2 +- src/core/hle/kernel/thread.cpp | 4 +++- src/core/hle/kernel/timer.cpp | 3 ++- src/core/hle/result.h | 1 + src/core/hle/service/am_sys.cpp | 2 ++ src/core/hle/service/apt/apt.cpp | 2 ++ src/core/hle/service/apt/apt_s.cpp | 3 --- src/core/hle/service/apt/apt_u.cpp | 1 - src/core/hle/service/cfg/cfg.cpp | 1 + src/core/hle/service/cfg/cfg_u.cpp | 2 ++ src/core/hle/service/dsp_dsp.cpp | 2 ++ src/core/hle/service/err_f.cpp | 2 ++ src/core/hle/service/fs/archive.cpp | 1 + src/core/hle/service/fs/fs_user.cpp | 5 ++++- src/core/hle/service/hid/hid.cpp | 2 ++ src/core/hle/service/ldr_ro.cpp | 2 ++ src/core/hle/service/nim_u.cpp | 2 ++ src/core/hle/service/ns_s.cpp | 2 -- src/core/hle/service/nwm_uds.cpp | 2 ++ src/core/hle/service/ptm/ptm_u.cpp | 2 +- src/core/hle/service/service.cpp | 2 +- src/core/hle/service/service.h | 2 +- src/core/hle/service/soc_u.cpp | 1 + src/core/hle/service/srv.cpp | 2 ++ src/core/hle/service/y2r_u.cpp | 2 ++ src/core/hle/svc.cpp | 1 + src/core/hw/gpu.h | 4 +++- src/core/hw/hw.cpp | 1 + src/core/hw/lcd.cpp | 3 +++ src/core/hw/lcd.h | 3 ++- src/core/loader/3dsx.cpp | 2 ++ src/core/loader/elf.cpp | 3 ++- src/core/loader/loader.cpp | 1 + src/core/loader/loader.h | 2 +- src/core/loader/ncch.cpp | 2 ++ src/core/loader/ncch.h | 4 +++- src/core/mem_map.cpp | 4 +++- src/core/mem_map_funcs.cpp | 4 +++- src/video_core/color.h | 2 ++ src/video_core/pica.h | 3 +++ src/video_core/renderer_base.h | 2 +- src/video_core/renderer_opengl/renderer_opengl.cpp | 1 + src/video_core/video_core.cpp | 2 +- src/video_core/video_core.h | 1 - 102 files changed, 146 insertions(+), 96 deletions(-) delete mode 100644 src/common/common.h diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 634faf76b..1d7e7f270 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -4,7 +4,7 @@ #include -#include "common/common.h" +#include "common/logging/log.h" #include "common/logging/text_formatter.h" #include "common/logging/backend.h" #include "common/logging/filter.h" diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 43175d6cb..ab564559d 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -5,7 +5,10 @@ #include #include "citra/default_ini.h" + #include "common/file_util.h" +#include "common/logging/log.h" + #include "core/settings.h" #include "core/core.h" diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index f879ee7ca..341b48d2a 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -4,7 +4,7 @@ #include -#include "common/common.h" +#include "common/logging/log.h" #include "video_core/video_core.h" diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index a7f949411..d3df289f8 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -8,7 +8,6 @@ #include #endif -#include "common/common.h" #include "bootmanager.h" #include "main.h" diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 715faf2d7..d5d74c949 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -7,7 +7,6 @@ #include #include -#include "common/common.h" #include "common/emu_window.h" #include "common/thread.h" diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 08c6b49bd..780607e82 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -7,7 +7,6 @@ #include "../bootmanager.h" #include "../hotkeys.h" -#include "common/common.h" #include "core/mem_map.h" #include "core/core.h" diff --git a/src/citra_qt/debugger/disassembler.h b/src/citra_qt/debugger/disassembler.h index 45b0a7e08..340fb9936 100644 --- a/src/citra_qt/debugger/disassembler.h +++ b/src/citra_qt/debugger/disassembler.h @@ -9,8 +9,8 @@ #include "ui_disassembler.h" -#include "common/common.h" #include "common/break_points.h" +#include "common/common_types.h" class QAction; class EmuThread; diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index 92348be34..1da64f616 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp @@ -8,6 +8,8 @@ #include #include +#include "common/assert.h" + #include "graphics_breakpoints.h" #include "graphics_breakpoints_p.h" diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp index 88570f2cd..7149a0485 100644 --- a/src/citra_qt/debugger/ramview.cpp +++ b/src/citra_qt/debugger/ramview.cpp @@ -4,8 +4,9 @@ #include "ramview.h" -#include "common/common.h" #include "core/mem_map.h" + + GRamView::GRamView(QWidget* parent) : QHexEdit(parent) { } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b78594fb6..d15338f0d 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -10,7 +10,6 @@ #include "qhexedit.h" #include "main.h" -#include "common/common.h" #include "common/logging/text_formatter.h" #include "common/logging/log.h" #include "common/logging/backend.h" diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index daa2d59de..9a9f1a46b 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -27,7 +27,6 @@ set(HEADERS bit_field.h break_points.h chunk_file.h - common.h common_funcs.h common_paths.h common_types.h diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 8eab054b8..1f3ecf844 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -35,7 +35,7 @@ #include #include -#include "common/common.h" +#include "common/common_funcs.h" /* * Abstract bitfield class diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp index 15055bd4e..023a485a4 100644 --- a/src/common/break_points.cpp +++ b/src/common/break_points.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" #include "common/debug_interface.h" #include "common/break_points.h" #include "common/logging/log.h" diff --git a/src/common/break_points.h b/src/common/break_points.h index 4b26cf90d..f0a55e7b1 100644 --- a/src/common/break_points.h +++ b/src/common/break_points.h @@ -7,7 +7,7 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" class DebugInterface; diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 3f97d56bf..dcd80525e 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -34,8 +34,9 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" template struct LinkedListItem : public T diff --git a/src/common/common.h b/src/common/common.h deleted file mode 100644 index a9d3a6e6a..000000000 --- a/src/common/common.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -// DO NOT EVER INCLUDE directly _or indirectly_ from this file -// since it slows down the build a lot. - -#include -#include -#include - -#include "common/assert.h" -#include "common/logging/log.h" -#include "common/common_types.h" -#include "common/common_funcs.h" -#include "common/common_paths.h" -#include "common/platform.h" - -#include "swap.h" diff --git a/src/common/common_paths.h b/src/common/common_paths.h index 440b06060..2903f2cf2 100644 --- a/src/common/common_paths.h +++ b/src/common/common_paths.h @@ -4,9 +4,6 @@ #pragma once -// Make sure we pick up USER_DIR if set in config.h -#include "common/common.h" - // Directory separators, do we need this? #define DIR_SEP "/" #define DIR_SEP_CHR '/' diff --git a/src/common/concurrent_ring_buffer.h b/src/common/concurrent_ring_buffer.h index fc18e6c86..c5889513a 100644 --- a/src/common/concurrent_ring_buffer.h +++ b/src/common/concurrent_ring_buffer.h @@ -10,7 +10,7 @@ #include #include -#include "common/common.h" // for NonCopyable +#include "common/common_types.h" // for NonCopyable namespace Common { diff --git a/src/common/emu_window.h b/src/common/emu_window.h index e0fc12a48..8eca6b5d5 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h @@ -4,11 +4,11 @@ #pragma once -#include "common/common.h" -#include "common/scm_rev.h" -#include "common/string_util.h" +#include "common/common_types.h" #include "common/key_map.h" #include "common/math_util.h" +#include "common/scm_rev.h" +#include "common/string_util.h" /** * Abstraction class used to provide an interface between emulation code and the frontend diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 946c4261a..7cdd1484f 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -2,9 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. - -#include "common/common.h" +#include "common/assert.h" +#include "common/common_funcs.h" +#include "common/common_paths.h" #include "common/file_util.h" +#include "common/logging/log.h" #ifdef _WIN32 #include diff --git a/src/common/file_util.h b/src/common/file_util.h index 86aab2e3d..b65829291 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -11,7 +11,7 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" #include "common/string_util.h" // User directory indices for GetUserPath diff --git a/src/common/hash.cpp b/src/common/hash.cpp index 3e62beff4..b0b3613f6 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -4,6 +4,7 @@ #include +#include "common/common_funcs.h" // For rotl #include "common/hash.h" #include "common/platform.h" diff --git a/src/common/hash.h b/src/common/hash.h index 3ac42bc44..0afaf0e37 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -4,7 +4,7 @@ #pragma once -#include "common/common.h" +#include "common/common_types.h" u32 HashFletcher(const u8* data_u8, size_t length); // FAST. Length & 1 == 0. u32 HashAdler32(const u8* data, size_t len); // Fairly accurate, slightly slower diff --git a/src/common/linear_disk_cache.h b/src/common/linear_disk_cache.h index 74ce74aba..48529cf42 100644 --- a/src/common/linear_disk_cache.h +++ b/src/common/linear_disk_cache.h @@ -4,7 +4,7 @@ #pragma once -#include "common/common.h" +#include "common/common_types.h" #include // defined in Version.cpp diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 36c91c4f6..45be6d0a1 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -14,6 +14,7 @@ #include "common/logging/log.h" #include "common/logging/text_formatter.h" +#include "common/common_funcs.h" #include "common/string_util.h" namespace Log { diff --git a/src/common/math_util.cpp b/src/common/math_util.cpp index a83592dd2..bcb70cae5 100644 --- a/src/common/math_util.cpp +++ b/src/common/math_util.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include // Necessary on OS X, but not Linux -#include "common/common.h" +#include "common/common_types.h" #include "common/math_util.h" -#include // Necessary on OS X, but not Linux - namespace MathUtil { diff --git a/src/common/math_util.h b/src/common/math_util.h index 43b0e0dc3..52f579cf7 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -4,7 +4,7 @@ #pragma once -#include "common/common.h" +#include "common/common_types.h" #include #include diff --git a/src/common/mem_arena.cpp b/src/common/mem_arena.cpp index 76c70701d..f233d4a3a 100644 --- a/src/common/mem_arena.cpp +++ b/src/common/mem_arena.cpp @@ -17,12 +17,16 @@ #include -#include "common/memory_util.h" +#include "common/logging/log.h" #include "common/mem_arena.h" +#include "common/memory_util.h" #include "common/string_util.h" #ifndef _WIN32 #include +#include +#include + #ifdef ANDROID #include #include diff --git a/src/common/mem_arena.h b/src/common/mem_arena.h index 3379d2529..d514fe58c 100644 --- a/src/common/mem_arena.h +++ b/src/common/mem_arena.h @@ -21,7 +21,7 @@ #include #endif -#include "common/common.h" +#include "common/common_types.h" // This class lets you create a block of anonymous RAM, and then arbitrarily map views into it. // Multiple views can mirror the same section of the block, which makes it very convient for emulating diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 7e69d31cb..2087a1184 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -3,7 +3,8 @@ // Refer to the license.txt file included. -#include "common/common.h" +#include "common/common_funcs.h" +#include "common/logging/log.h" #include "common/memory_util.h" #include "common/string_util.h" diff --git a/src/common/misc.cpp b/src/common/misc.cpp index e33055d10..53cacf37c 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -2,10 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/common_funcs.h" #ifdef _WIN32 #include +#else +#include #endif // Neither Android nor OS X support TLS diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 3264dd51a..6563611fd 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -4,7 +4,9 @@ #include -#include "common/common.h" +#include "common/common_funcs.h" +#include "common/common_paths.h" +#include "common/logging/log.h" #include "common/string_util.h" #ifdef _MSC_VER diff --git a/src/common/string_util.h b/src/common/string_util.h index 74974263f..a60a84696 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -10,7 +10,7 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" namespace Common { diff --git a/src/common/symbols.h b/src/common/symbols.h index f76cb6b1e..6b62b011e 100644 --- a/src/common/symbols.h +++ b/src/common/symbols.h @@ -5,8 +5,10 @@ #pragma once #include +#include +#include -#include "common/common.h" +#include "common/common_types.h" struct TSymbol { diff --git a/src/common/thread.h b/src/common/thread.h index 5fdb6baeb..7bc419497 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -4,7 +4,6 @@ #pragma once -// Don't include common.h here as it will break LogManager #include "common/common_types.h" #include #include diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index 4f27fc899..12455d7c4 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h @@ -9,8 +9,6 @@ #include -#include "common/common.h" - namespace Common { template diff --git a/src/common/thunk.h b/src/common/thunk.h index 4fb7c98e1..533480056 100644 --- a/src/common/thunk.h +++ b/src/common/thunk.h @@ -6,7 +6,7 @@ #include -#include "common/common.h" +#include "common/common_types.h" // This simple class creates a wrapper around a C/C++ function that saves all fp state // before entering it, and restores it upon exit. This is required to be able to selectively diff --git a/src/common/timer.cpp b/src/common/timer.cpp index a6682ea19..b99835ac7 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -12,9 +12,9 @@ #include #endif -#include "common/common.h" -#include "common/timer.h" +#include "common/common_types.h" #include "common/string_util.h" +#include "common/timer.h" namespace Common { diff --git a/src/common/timer.h b/src/common/timer.h index 4b44c33a0..b5f0f2585 100644 --- a/src/common/timer.h +++ b/src/common/timer.h @@ -4,7 +4,7 @@ #pragma once -#include "common/common.h" +#include "common/common_types.h" #include namespace Common diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 310663774..85ed2c698 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -4,7 +4,6 @@ #pragma once -#include "common/common.h" #include "common/common_types.h" #include "core/arm/skyeye_common/arm_regformat.h" diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index 128413262..42a63e46f 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/make_unique.h" #include "core/arm/skyeye_common/armemu.h" diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp index d0fa157a2..b88d47750 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.cpp +++ b/src/core/arm/skyeye_common/vfp/vfp.cpp @@ -20,7 +20,6 @@ /* Note: this file handles interface with arm core and vfp registers */ -#include "common/common.h" #include "common/logging/log.h" #include "core/arm/skyeye_common/armdefs.h" diff --git a/src/core/core.cpp b/src/core/core.cpp index 81e642318..1c9680d41 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/common_types.h" +#include "common/logging/log.h" #include "core/core.h" #include "core/core_timing.h" diff --git a/src/core/core_timing.h b/src/core/core_timing.h index d62ff3604..01519608d 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -21,7 +21,7 @@ #include -#include "common/common.h" +#include "common/common_types.h" extern int g_clock_rate_arm11; diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 3076fa263..38d498d0e 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_extsavedata.h" diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp index bf54a3866..d4a12ed10 100644 --- a/src/core/file_sys/archive_romfs.cpp +++ b/src/core/file_sys/archive_romfs.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_romfs.h" diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index 8496e06f3..12624fa31 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_savedata.h" diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index 47d8a9d25..e7e4fbf1d 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_savedatacheck.h" diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 92b20c7f6..c1234a186 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_sdmc.h" diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index f53fd57db..9980cced1 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/disk_archive.h" diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index 0b0f8a42a..0fcff1845 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -4,7 +4,6 @@ #pragma once -#include "common/common.h" #include "common/common_types.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 35aca54fa..2d2509d16 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/ivfc_archive.h" diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 19135266c..9d7f6b280 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/common_types.h" +#include "common/logging/log.h" #include "core/mem_map.h" diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 420906ec0..f338f3266 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -6,7 +6,7 @@ #include #include -#include "common/common.h" +#include "common/assert.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/event.h" diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index fca582bbe..533fe65fd 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -4,7 +4,8 @@ #include -#include "common/common.h" +#include "common/assert.h" +#include "common/logging/log.h" #include "core/arm/arm_interface.h" #include "core/core.h" diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 80a09cadc..a7bc6b71a 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -10,7 +10,8 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" + #include "core/hle/hle.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index ebc9e79d7..f530217fd 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -7,7 +7,7 @@ #include -#include "common/common.h" +#include "common/assert.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/mutex.h" diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 6aecc24aa..5d6543ef4 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/assert.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/semaphore.h" diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 9b2511b53..cb5c16696 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/logging/log.h" #include "core/mem_map.h" #include "core/hle/kernel/shared_memory.h" diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index d678f5f6f..9577b889a 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -6,7 +6,9 @@ #include #include -#include "common/common.h" +#include "common/assert.h" +#include "common/common_types.h" +#include "common/logging/log.h" #include "common/math_util.h" #include "common/thread_queue_list.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 36979248d..e69fece65 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -2,7 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/assert.h" +#include "common/logging/log.h" #include "core/core_timing.h" #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 3648a168b..ce633d841 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -8,6 +8,7 @@ #include #include +#include "common/assert.h" #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/hle/service/am_sys.cpp b/src/core/hle/service/am_sys.cpp index b244190a2..f9e3fe4b7 100644 --- a/src/core/hle/service/am_sys.cpp +++ b/src/core/hle/service/am_sys.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/service/am_sys.h" diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 98ae80b3a..560c9dcf6 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -2,7 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/common_paths.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "core/hle/service/service.h" #include "core/hle/service/apt/apt.h" diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index 3fd348651..396d1f04a 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -3,9 +3,6 @@ // Refer to the license.txt file included. -#include "common/common.h" -#include "common/file_util.h" - #include "core/hle/hle.h" #include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_s.h" diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 5ab23801e..d006b5930 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. -#include "common/common.h" #include "common/file_util.h" #include "core/hle/service/apt/apt.h" diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 207f660e6..2d26c9330 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -4,6 +4,7 @@ #include +#include "common/logging/log.h" #include "common/string_util.h" #include "core/file_sys/file_backend.h" diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp index c8c1c5b17..221de9918 100644 --- a/src/core/hle/service/cfg/cfg_u.cpp +++ b/src/core/hle/service/cfg/cfg_u.cpp @@ -3,7 +3,9 @@ // Refer to the license.txt file included. #include "common/file_util.h" +#include "common/logging/log.h" #include "common/string_util.h" + #include "core/settings.h" #include "core/file_sys/archive_systemsavedata.h" #include "core/hle/hle.h" diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 2e759a3e3..20dc4d648 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/kernel/event.h" #include "core/hle/service/dsp_dsp.h" diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 58c5acd1e..e8c06c1cf 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/service/err_f.h" diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index a6ed08929..6d4a9c7c9 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -9,6 +9,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/make_unique.h" #include "common/math_util.h" diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 5bc94b1b1..0d2a426b0 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -2,10 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/assert.h" +#include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/scope_exit.h" #include "common/string_util.h" + #include "core/hle/result.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 0f30f743a..dd85848d0 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/service/service.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/hid_spvr.h" diff --git a/src/core/hle/service/ldr_ro.cpp b/src/core/hle/service/ldr_ro.cpp index c0c4a2344..155b97f69 100644 --- a/src/core/hle/service/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/service/ldr_ro.h" diff --git a/src/core/hle/service/nim_u.cpp b/src/core/hle/service/nim_u.cpp index a87d17ef0..5f13bd98e 100644 --- a/src/core/hle/service/nim_u.cpp +++ b/src/core/hle/service/nim_u.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/service/nim_u.h" diff --git a/src/core/hle/service/ns_s.cpp b/src/core/hle/service/ns_s.cpp index 5cf3e2039..6b3ef6ece 100644 --- a/src/core/hle/service/ns_s.cpp +++ b/src/core/hle/service/ns_s.cpp @@ -3,8 +3,6 @@ // Refer to the license.txt file included. -#include "common/common.h" - #include "core/hle/hle.h" #include "core/hle/service/ns_s.h" diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp index 4b06efc3a..25b01860e 100644 --- a/src/core/hle/service/nwm_uds.cpp +++ b/src/core/hle/service/nwm_uds.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/kernel/event.h" #include "core/hle/service/nwm_uds.h" diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 0af7c8bf6..9d6a5b0d7 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/make_unique.h" +#include "common/logging/log.h" #include "core/hle/hle.h" #include "core/hle/service/ptm/ptm.h" diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index d50327cb9..64185c62e 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/logging/log.h" #include "common/string_util.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 21ada67b5..77bfb9ff1 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -9,7 +9,7 @@ #include -#include "common/common.h" +#include "common/common_types.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/session.h" diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 231ead185..39b8d65fd 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" #include "common/platform.h" #if EMU_PLATFORM == PLATFORM_WINDOWS diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index cc59a03ce..6c49fa6cf 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/service/srv.h" #include "core/hle/kernel/event.h" diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 33ecf64a2..085192a07 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" + #include "core/hle/hle.h" #include "core/hle/kernel/event.h" #include "core/hle/service/y2r_u.h" diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 2da488d83..1372aa096 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -4,6 +4,7 @@ #include +#include "common/logging/log.h" #include "common/profiler.h" #include "common/string_util.h" #include "common/symbols.h" diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index c8f884494..699bcd2a5 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -6,8 +6,10 @@ #include -#include "common/common_types.h" +#include "common/assert.h" #include "common/bit_field.h" +#include "common/common_funcs.h" +#include "common/common_types.h" namespace GPU { diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index 236958139..f4906cc7e 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/common_types.h" +#include "common/logging/log.h" #include "core/hw/hw.h" #include "core/hw/gpu.h" diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index 8a09c3bc0..09134c95b 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -2,7 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/common_types.h" +#include "common/logging/log.h" #include "core/arm/arm_interface.h" #include "core/hle/hle.h" diff --git a/src/core/hw/lcd.h b/src/core/hw/lcd.h index 43893a625..fb14c3b21 100644 --- a/src/core/hw/lcd.h +++ b/src/core/hw/lcd.h @@ -6,8 +6,9 @@ #include -#include "common/common_types.h" #include "common/bit_field.h" +#include "common/common_funcs.h" +#include "common/common_types.h" #define LCD_REG_INDEX(field_name) (offsetof(LCD::Regs, field_name) / sizeof(u32)) diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 958dd03e8..5d806c5d0 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -5,6 +5,8 @@ #include #include +#include "common/logging/log.h" + #include "core/file_sys/archive_romfs.h" #include "core/loader/elf.h" #include "core/loader/ncch.h" diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 773eaf771..467e91924 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -5,8 +5,9 @@ #include #include -#include "common/common.h" +#include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/symbols.h" #include "core/mem_map.h" diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index aca09b374..de0ab540a 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -4,6 +4,7 @@ #include +#include "common/logging/log.h" #include "common/make_unique.h" #include "core/file_sys/archive_romfs.h" diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 3510c6b28..2b87239cf 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -6,7 +6,7 @@ #include -#include "common/common.h" +#include "common/common_types.h" #include "common/file_util.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 4efed78bf..9bce2b79d 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -4,6 +4,8 @@ #include +#include "common/logging/log.h" + #include "core/loader/ncch.h" #include "core/hle/kernel/kernel.h" #include "core/mem_map.h" diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 3dd151dbd..44c72a4e2 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -4,7 +4,9 @@ #pragma once -#include "common/common.h" +#include + +#include "common/common_types.h" #include "core/loader/loader.h" diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp index 22e359b3e..ae88cfb11 100644 --- a/src/core/mem_map.cpp +++ b/src/core/mem_map.cpp @@ -2,7 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/common_funcs.h" +#include "common/common_types.h" +#include "common/logging/log.h" #include "common/mem_arena.h" #include "core/mem_map.h" diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index 8759ebdfb..9a19c9bf8 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -4,7 +4,9 @@ #include -#include "common/common.h" +#include "common/common_types.h" +#include "common/logging/log.h" +#include "common/swap.h" #include "core/mem_map.h" #include "core/hw/hw.h" diff --git a/src/video_core/color.h b/src/video_core/color.h index 43d635e2c..4d2026eb0 100644 --- a/src/video_core/color.h +++ b/src/video_core/color.h @@ -5,6 +5,8 @@ #pragma once #include "common/common_types.h" +#include "common/swap.h" + #include "video_core/math.h" namespace Color { diff --git a/src/video_core/pica.h b/src/video_core/pica.h index fe20cd77d..20e5e2de0 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -10,8 +10,11 @@ #include #include +#include "common/assert.h" #include "common/bit_field.h" +#include "common/common_funcs.h" #include "common/common_types.h" +#include "common/logging/log.h" #include "core/mem_map.h" diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index b77f29c11..b62409538 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -4,7 +4,7 @@ #pragma once -#include "common/common.h" +#include "common/common_types.h" class RendererBase : NonCopyable { public: diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 5e864b75e..6b242a6ed 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -9,6 +9,7 @@ #include "core/settings.h" #include "common/emu_window.h" +#include "common/logging/log.h" #include "common/profiler_reporting.h" #include "video_core/video_core.h" diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index b9d4ede3a..42e3bdd5b 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/common.h" +#include "common/logging/log.h" #include "common/emu_window.h" #include "core/core.h" diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index 1b51d39bf..f885bec21 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h @@ -4,7 +4,6 @@ #pragma once -#include "common/common.h" #include "common/emu_window.h" #include "renderer_base.h" -- cgit v1.2.3 From c956e8a6869d0ee1edd68a6ab880efa6bf1fbe70 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Thu, 7 May 2015 00:09:24 -0300 Subject: Fix printf format warning --- src/core/hle/svc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 1372aa096..393cfbe79 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -312,7 +312,7 @@ static ResultCode GetResourceLimit(Handle* resource_limit, Handle process) { /// Get resource limit current values static ResultCode GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names, s32 name_count) { - LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d", + LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%p, name_count=%d", resource_limit, names, name_count); Memory::Write32(Core::g_app_core->GetReg(0), 0); // Normmatt: Set used memory to 0 for now return RESULT_SUCCESS; -- cgit v1.2.3