diff --git a/Common/Arm64Emitter.cpp b/Common/Arm64Emitter.cpp index 531c2ddb79..928ef5803f 100644 --- a/Common/Arm64Emitter.cpp +++ b/Common/Arm64Emitter.cpp @@ -5,15 +5,12 @@ #include "ppsspp_config.h" #include -#include #include #include #include -#include -#include - -#include "base/basictypes.h" +#include +#include #include "Arm64Emitter.h" #include "MathUtil.h" diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index ce3ad48a81..1acbb1c680 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -29,7 +29,6 @@ #include #include -#include "base/basictypes.h" #include "file/file_util.h" #include "Common/Common.h" diff --git a/Common/Common.h b/Common/Common.h index 471bef4bdf..42a7846746 100644 --- a/Common/Common.h +++ b/Common/Common.h @@ -23,7 +23,9 @@ #include #ifdef _MSC_VER -#pragma warning (disable:4100) +#pragma warning(disable:4100) +#pragma warning(disable:4244) +#pragma warning(disable:4996) #endif #include "Log.h" @@ -36,6 +38,24 @@ void operator =(const t &other) = delete; #endif +#ifndef ENUM_CLASS_BITOPS +#define ENUM_CLASS_BITOPS(T) \ + static inline T operator |(const T &lhs, const T &rhs) { \ + return T((int)lhs | (int)rhs); \ + } \ + static inline T &operator |= (T &lhs, const T &rhs) { \ + lhs = lhs | rhs; \ + return lhs; \ + } \ + static inline bool operator &(const T &lhs, const T &rhs) { \ + return ((int)lhs & (int)rhs) != 0; \ + } +#endif + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif + #if defined(_WIN32) // Memory leak checks diff --git a/Common/TimeUtil.cpp b/Common/TimeUtil.cpp index 5b8a0c2611..d0466353e8 100644 --- a/Common/TimeUtil.cpp +++ b/Common/TimeUtil.cpp @@ -1,6 +1,5 @@ #include -#include "base/basictypes.h" #include "Common/TimeUtil.h" #ifdef _WIN32 diff --git a/Common/Vulkan/VulkanContext.cpp b/Common/Vulkan/VulkanContext.cpp index b659681a73..17fe8bb496 100644 --- a/Common/Vulkan/VulkanContext.cpp +++ b/Common/Vulkan/VulkanContext.cpp @@ -5,7 +5,6 @@ #include #include -#include "base/basictypes.h" #include "base/display.h" #include "Common/Log.h" #include "Common/Vulkan/VulkanContext.h" diff --git a/Common/Vulkan/VulkanLoader.cpp b/Common/Vulkan/VulkanLoader.cpp index 4a6ef8a249..b70259c610 100644 --- a/Common/Vulkan/VulkanLoader.cpp +++ b/Common/Vulkan/VulkanLoader.cpp @@ -21,7 +21,6 @@ #include #include "Common/Log.h" -#include "base/basictypes.h" #include "base/NativeApp.h" #ifndef _WIN32 diff --git a/Core/CwCheat.h b/Core/CwCheat.h index 578ffe7b98..686694e769 100644 --- a/Core/CwCheat.h +++ b/Core/CwCheat.h @@ -8,7 +8,6 @@ #include #include -#include "base/basictypes.h" #include "Core/MemMap.h" class PointerWrap; diff --git a/Core/FileSystems/FileSystem.h b/Core/FileSystems/FileSystem.h index 6c069efe0d..46cd7a6dbc 100644 --- a/Core/FileSystems/FileSystem.h +++ b/Core/FileSystems/FileSystem.h @@ -20,8 +20,8 @@ #include #include #include -#include "base/basictypes.h" +#include "Common.h" #include "Core/HLE/sceKernel.h" enum FileAccess { diff --git a/Core/HDRemaster.cpp b/Core/HDRemaster.cpp index 33a9798279..d3d0ff16b9 100644 --- a/Core/HDRemaster.cpp +++ b/Core/HDRemaster.cpp @@ -15,7 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "base/basictypes.h" +#include "Common.h" #include "Core/HDRemaster.h" bool g_RemasterMode; diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 359b76e23c..16b8ca7fe8 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -19,7 +19,7 @@ #include #include -#include "base/basictypes.h" +#include "Common/Common.h" #include "Common/Log.h" #include "Core/Config.h" #include "Core/Debugger/Breakpoints.h" diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index a79e511ae7..285fee2b37 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -32,7 +32,6 @@ #include #include -#include "base/basictypes.h" #include "profiler/profiler.h" #include "thread/threadutil.h" #include "Common/Serialize/SerializeFuncs.h" diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index 913c6948cf..90f408b619 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -17,7 +17,6 @@ #include -#include "base/basictypes.h" #include "profiler/profiler.h" #include "Common/Serialize/SerializeFuncs.h" diff --git a/Core/HW/SasReverb.cpp b/Core/HW/SasReverb.cpp index 7dfb429f8b..14dbc06248 100644 --- a/Core/HW/SasReverb.cpp +++ b/Core/HW/SasReverb.cpp @@ -18,7 +18,6 @@ #include #include -#include "base/basictypes.h" #include "Core/HW/SasReverb.h" #include "Core/Util/AudioFormat.h" diff --git a/Core/HW/SimpleAudioDec.h b/Core/HW/SimpleAudioDec.h index 5a21bfe330..d7bcfc7b03 100644 --- a/Core/HW/SimpleAudioDec.h +++ b/Core/HW/SimpleAudioDec.h @@ -19,7 +19,6 @@ #include -#include "base/basictypes.h" #include "Core/HW/MediaEngine.h" #include "Core/HLE/sceAudio.h" diff --git a/Core/MIPS/IR/IRPassSimplify.cpp b/Core/MIPS/IR/IRPassSimplify.cpp index fa7481aeff..13b74ab8bf 100644 --- a/Core/MIPS/IR/IRPassSimplify.cpp +++ b/Core/MIPS/IR/IRPassSimplify.cpp @@ -2,6 +2,7 @@ #include #include +#include "base/basictypes.h" #include "Common/Log.h" #include "Core/MIPS/IR/IRInterpreter.h" #include "Core/MIPS/IR/IRPassSimplify.h" diff --git a/Core/MIPS/x86/CompALU.cpp b/Core/MIPS/x86/CompALU.cpp index 456695b575..e038bad6be 100644 --- a/Core/MIPS/x86/CompALU.cpp +++ b/Core/MIPS/x86/CompALU.cpp @@ -18,6 +18,9 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) +#include "base/basictypes.h" + +#include "Common/Common.h" #include "Core/MIPS/MIPSCodeUtils.h" #include "Core/MIPS/x86/Jit.h" #include "Core/MIPS/x86/RegCache.h" diff --git a/GPU/Common/PresentationCommon.h b/GPU/Common/PresentationCommon.h index 29f9517f53..7acce4083a 100644 --- a/GPU/Common/PresentationCommon.h +++ b/GPU/Common/PresentationCommon.h @@ -17,7 +17,6 @@ #pragma once -#include "base/basictypes.h" #include "GPU/Common/ShaderCommon.h" struct CardboardSettings { diff --git a/GPU/Common/ShaderId.h b/GPU/Common/ShaderId.h index f117341e7d..3adc7f4c2b 100644 --- a/GPU/Common/ShaderId.h +++ b/GPU/Common/ShaderId.h @@ -3,7 +3,8 @@ #include #include #include -#include "base/basictypes.h" + +#include "Common/Common.h" // TODO: There will be additional bits, indicating that groups of these will be // sent to the shader and processed there. This will cut down the number of shaders ("ubershader approach") diff --git a/GPU/Common/ShaderTranslation.cpp b/GPU/Common/ShaderTranslation.cpp index c38d2420b1..b93df766e5 100644 --- a/GPU/Common/ShaderTranslation.cpp +++ b/GPU/Common/ShaderTranslation.cpp @@ -34,7 +34,6 @@ #undef free #endif -#include "base/basictypes.h" #include "Common/Log.h" #include "Common/StringUtils.h" diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index c80e713819..3214b42306 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -15,11 +15,6 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#if _MSC_VER == 1700 -// Has to be included before TextureScaler.h, else we get those std::bind errors in VS2012.. -#include "../native/base/basictypes.h" -#endif - #include #include #include diff --git a/GPU/Common/TransformCommon.h b/GPU/Common/TransformCommon.h index d3b78dd663..0a97975d26 100644 --- a/GPU/Common/TransformCommon.h +++ b/GPU/Common/TransformCommon.h @@ -19,7 +19,6 @@ #include -#include "base/basictypes.h" #include "Common/CommonTypes.h" #include "Core/Reporting.h" #include "GPU/ge_constants.h" diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index 0491105465..d0cdbb5b29 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -19,11 +19,11 @@ #include #include "ppsspp_config.h" -#include "base/basictypes.h" #include "Common/Log.h" #include "Common/CPUDetect.h" #include "Common/ColorConv.h" +#include "Common/Common.h" #include "Core/Config.h" #include "Core/ConfigValues.h" #include "Core/MemMap.h" diff --git a/GPU/Common/VertexDecoderCommon.h b/GPU/Common/VertexDecoderCommon.h index 333f2b1c36..0d451465b8 100644 --- a/GPU/Common/VertexDecoderCommon.h +++ b/GPU/Common/VertexDecoderCommon.h @@ -20,10 +20,10 @@ #include #include "ppsspp_config.h" -#include "base/basictypes.h" + +#include "Common/Common.h" #include "Common/Hashmaps.h" #include "Common/Log.h" -#include "Common/CommonTypes.h" #include "Core/Reporting.h" #include "GPU/ge_constants.h" #include "GPU/Common/ShaderCommon.h" diff --git a/GPU/D3D11/DepalettizeShaderD3D11.cpp b/GPU/D3D11/DepalettizeShaderD3D11.cpp index c67ce845f0..faf6c22de2 100644 --- a/GPU/D3D11/DepalettizeShaderD3D11.cpp +++ b/GPU/D3D11/DepalettizeShaderD3D11.cpp @@ -18,7 +18,7 @@ #include #include -#include "base/basictypes.h" +#include "Common/Common.h" #include "Common/Log.h" #include "Common/ColorConv.h" #include "Common/StringUtils.h" diff --git a/GPU/D3D11/FramebufferManagerD3D11.cpp b/GPU/D3D11/FramebufferManagerD3D11.cpp index 4440ebf4b3..b48d67529b 100644 --- a/GPU/D3D11/FramebufferManagerD3D11.cpp +++ b/GPU/D3D11/FramebufferManagerD3D11.cpp @@ -22,8 +22,8 @@ #include "base/display.h" #include "math/lin/matrix4x4.h" #include "ext/native/thin3d/thin3d.h" -#include "base/basictypes.h" +#include "Common/Common.h" #include "Common/ColorConv.h" #include "Common/MathUtil.h" #include "Core/MemMap.h" diff --git a/GPU/D3D11/ShaderManagerD3D11.h b/GPU/D3D11/ShaderManagerD3D11.h index fd90d57d6b..abb867a613 100644 --- a/GPU/D3D11/ShaderManagerD3D11.h +++ b/GPU/D3D11/ShaderManagerD3D11.h @@ -21,7 +21,7 @@ #include -#include "base/basictypes.h" +#include "Common/Common.h" #include "GPU/Common/ShaderCommon.h" #include "GPU/Common/ShaderId.h" #include "GPU/Common/ShaderUniforms.h" diff --git a/GPU/Debugger/Breakpoints.cpp b/GPU/Debugger/Breakpoints.cpp index 9d1f7049f8..90bd76c524 100644 --- a/GPU/Debugger/Breakpoints.cpp +++ b/GPU/Debugger/Breakpoints.cpp @@ -19,7 +19,6 @@ #include #include -#include "base/basictypes.h" #include "GPU/Debugger/Breakpoints.h" #include "GPU/GPUState.h" diff --git a/GPU/Directx9/ShaderManagerDX9.h b/GPU/Directx9/ShaderManagerDX9.h index 7fa9818129..fac559e642 100644 --- a/GPU/Directx9/ShaderManagerDX9.h +++ b/GPU/Directx9/ShaderManagerDX9.h @@ -20,7 +20,7 @@ #include #include -#include "base/basictypes.h" +#include "Common/Common.h" #include "GPU/Directx9/VertexShaderGeneratorDX9.h" #include "GPU/Directx9/PixelShaderGeneratorDX9.h" #include "GPU/Common/ShaderCommon.h" diff --git a/GPU/Directx9/TextureScalerDX9.cpp b/GPU/Directx9/TextureScalerDX9.cpp index a31dbd3af4..bbf732a08d 100644 --- a/GPU/Directx9/TextureScalerDX9.cpp +++ b/GPU/Directx9/TextureScalerDX9.cpp @@ -15,15 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -// On Visual Studio 2012, include this before anything else so -// _VARIADIC_MAX gets set to 10, to avoid std::bind compile errors. -// See header file for reasons why. -#if defined(_WIN32) && _MSC_VER == 1700 -#include "../native/base/basictypes.h" -#endif - #include +#include "Common/Common.h" #include "Common/ColorConv.h" #include "Common/ThreadPools.h" #include "GPU/Common/TextureScalerCommon.h" diff --git a/GPU/GLES/ShaderManagerGLES.h b/GPU/GLES/ShaderManagerGLES.h index 3ee0e8e002..0c10d3ad73 100644 --- a/GPU/GLES/ShaderManagerGLES.h +++ b/GPU/GLES/ShaderManagerGLES.h @@ -19,7 +19,6 @@ #include -#include "base/basictypes.h" #include "Common/Hashmaps.h" #include "thin3d/GLRenderManager.h" #include "GPU/Common/ShaderCommon.h" diff --git a/GPU/GLES/TextureScalerGLES.cpp b/GPU/GLES/TextureScalerGLES.cpp index 73c1b849a7..d05e12c95b 100644 --- a/GPU/GLES/TextureScalerGLES.cpp +++ b/GPU/GLES/TextureScalerGLES.cpp @@ -15,11 +15,6 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#if _MSC_VER == 1700 -// Has to be included before TextureScaler.h, else we get those std::bind errors in VS2012.. -#include "../native/base/basictypes.h" -#endif - #include #include "gfx/gl_common.h" diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 545de958d1..519d5b2e7c 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -18,7 +18,6 @@ #include #include -#include "base/basictypes.h" #include "profiler/profiler.h" #include "Common/ThreadPools.h" diff --git a/GPU/Software/RasterizerRectangle.cpp b/GPU/Software/RasterizerRectangle.cpp index 8ec1992084..be2d042692 100644 --- a/GPU/Software/RasterizerRectangle.cpp +++ b/GPU/Software/RasterizerRectangle.cpp @@ -3,7 +3,6 @@ #include #include -#include "base/basictypes.h" #include "profiler/profiler.h" #include "Core/System.h" diff --git a/GPU/Vulkan/ShaderManagerVulkan.h b/GPU/Vulkan/ShaderManagerVulkan.h index bf5404acf9..e626e84152 100644 --- a/GPU/Vulkan/ShaderManagerVulkan.h +++ b/GPU/Vulkan/ShaderManagerVulkan.h @@ -18,8 +18,8 @@ #pragma once #include +#include -#include "base/basictypes.h" #include "Common/Hashmaps.h" #include "Common/Vulkan/VulkanMemory.h" #include "GPU/Common/ShaderCommon.h" diff --git a/GPU/Vulkan/TextureScalerVulkan.cpp b/GPU/Vulkan/TextureScalerVulkan.cpp index 27f43bcdaf..8b903df905 100644 --- a/GPU/Vulkan/TextureScalerVulkan.cpp +++ b/GPU/Vulkan/TextureScalerVulkan.cpp @@ -15,13 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#if _MSC_VER == 1700 -// Has to be included before TextureScaler.h, else we get those std::bind errors in VS2012.. -#include "../native/base/basictypes.h" -#endif - #include +#include "Common/Common.h" #include "Common/Vulkan/VulkanContext.h" #include "Common/ColorConv.h" #include "Common/Log.h" diff --git a/UI/OnScreenDisplay.h b/UI/OnScreenDisplay.h index 6fbf093e55..cfd245edb8 100644 --- a/UI/OnScreenDisplay.h +++ b/UI/OnScreenDisplay.h @@ -4,9 +4,7 @@ #include #include -#include "base/basictypes.h" #include "math/geom2d.h" - #include "ui/view.h" class DrawBuffer; @@ -37,7 +35,6 @@ public: const std::list &Messages() { return messages_; } private: - std::list messages_; std::mutex mutex_; }; diff --git a/UI/Store.cpp b/UI/Store.cpp index fd27021106..846161711b 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -17,7 +17,6 @@ #include -#include "base/basictypes.h" #include "json/json_reader.h" #include "i18n/i18n.h" @@ -26,6 +25,7 @@ #include "ui/viewgroup.h" #include "gfx_es2/draw_buffer.h" +#include "Common/Common.h" #include "Common/Log.h" #include "Common/StringUtils.h" #include "Core/Config.h" diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index ddd6d3fe6b..14b4cf2169 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -3,7 +3,6 @@ #include -#include "base/basictypes.h" #include "base/NativeApp.h" #include "input/input_state.h" #include "file/vfs.h" @@ -16,6 +15,7 @@ #include "thin3d/thin3d_create.h" #include "util/text/utf8.h" +#include "Common/Common.h" #include "Common/DirectXHelper.h" #include "Common/FileUtil.h" #include "Common/Log.h" diff --git a/Windows/GEDebugger/TabState.cpp b/Windows/GEDebugger/TabState.cpp index 3b3241b947..b72ed126a8 100644 --- a/Windows/GEDebugger/TabState.cpp +++ b/Windows/GEDebugger/TabState.cpp @@ -15,7 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "base/basictypes.h" +#include "Common/Common.h" #include "Windows/resource.h" #include "Windows/main.h" #include "Windows/InputBox.h" diff --git a/Windows/GEDebugger/TabVertices.cpp b/Windows/GEDebugger/TabVertices.cpp index bd65e87999..55eb23cc4b 100644 --- a/Windows/GEDebugger/TabVertices.cpp +++ b/Windows/GEDebugger/TabVertices.cpp @@ -15,7 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "base/basictypes.h" +#include "Common/Common.h" #include "Core/System.h" #include "Windows/resource.h" #include "Windows/GEDebugger/GEDebugger.h" diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp index f3db153a6e..b7ca679ed5 100644 --- a/android/jni/TestRunner.cpp +++ b/android/jni/TestRunner.cpp @@ -26,7 +26,6 @@ #include #include "ppsspp_config.h" -#include "base/basictypes.h" #include "base/display.h" #include "Common/FileUtil.h" diff --git a/ext/disarm.cpp b/ext/disarm.cpp index ece10410f4..57b34b0b53 100644 --- a/ext/disarm.cpp +++ b/ext/disarm.cpp @@ -66,11 +66,10 @@ #pragma GCC diagnostic ignored "-Wstring-plus-int" #endif -#include -#include -#include +#include +#include +#include -#include "base/basictypes.h" #include "Common/ArmEmitter.h" #include "ext/disarm.h" diff --git a/ext/native/base/basictypes.h b/ext/native/base/basictypes.h index f2e53d2d1e..8a52f1b6c7 100644 --- a/ext/native/base/basictypes.h +++ b/ext/native/base/basictypes.h @@ -3,36 +3,7 @@ #include #include // for byte swapping -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4996) -#endif - -#ifndef DISALLOW_COPY_AND_ASSIGN -#define DISALLOW_COPY_AND_ASSIGN(t) \ - t(const t &other) = delete; \ - void operator =(const t &other) = delete; -#endif - -#ifndef ENUM_CLASS_BITOPS -#define ENUM_CLASS_BITOPS(T) \ - static inline T operator |(const T &lhs, const T &rhs) { \ - return T((int)lhs | (int)rhs); \ - } \ - static inline T &operator |= (T &lhs, const T &rhs) { \ - lhs = lhs | rhs; \ - return lhs; \ - } \ - static inline bool operator &(const T &lhs, const T &rhs) { \ - return ((int)lhs & (int)rhs) != 0; \ - } -#endif - // Byteswapping -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) -#endif - // Just in case this has been defined by platform #undef swap16 #undef swap32 diff --git a/ext/native/base/buffer.h b/ext/native/base/buffer.h index 63ab44b907..3fad61d549 100644 --- a/ext/native/base/buffer.h +++ b/ext/native/base/buffer.h @@ -3,8 +3,6 @@ #include #include -#include "base/basictypes.h" - #include "Common/Common.h" // Acts as a queue. Intended to be as fast as possible for most uses. diff --git a/ext/native/base/colorutil.h b/ext/native/base/colorutil.h index f79c4a214b..0f9fa33b7a 100644 --- a/ext/native/base/colorutil.h +++ b/ext/native/base/colorutil.h @@ -1,6 +1,6 @@ #pragma once -#include "base/basictypes.h" +#include uint32_t whiteAlpha(float alpha); uint32_t blackAlpha(float alpha); diff --git a/ext/native/file/fd_util.cpp b/ext/native/file/fd_util.cpp index e7726392d4..9851d655b6 100644 --- a/ext/native/file/fd_util.cpp +++ b/ext/native/file/fd_util.cpp @@ -18,6 +18,7 @@ #endif #include +#include "Common/Common.h" #include "Common/Log.h" namespace fd_util { diff --git a/ext/native/file/fd_util.h b/ext/native/file/fd_util.h index 5160c4e157..230cba88f1 100644 --- a/ext/native/file/fd_util.h +++ b/ext/native/file/fd_util.h @@ -3,8 +3,6 @@ #include #include -#include "base/basictypes.h" - namespace fd_util { // Slow as hell and should only be used for prototyping. diff --git a/ext/native/file/file_util.cpp b/ext/native/file/file_util.cpp index 9ef63d5462..bc677e65c0 100644 --- a/ext/native/file/file_util.cpp +++ b/ext/native/file/file_util.cpp @@ -18,7 +18,6 @@ #include #include -#include "base/basictypes.h" #include "file/file_util.h" #include "util/text/utf8.h" diff --git a/ext/native/file/free.cpp b/ext/native/file/free.cpp index 3948008057..fd458ae428 100644 --- a/ext/native/file/free.cpp +++ b/ext/native/file/free.cpp @@ -17,7 +17,6 @@ #include #endif -#include "base/basictypes.h" #include "util/text/utf8.h" bool free_disk_space(const std::string &dir, uint64_t &space) { diff --git a/ext/native/file/free.h b/ext/native/file/free.h index 1c5690737e..df671fa3ed 100644 --- a/ext/native/file/free.h +++ b/ext/native/file/free.h @@ -1,6 +1,6 @@ #pragma once #include -#include "base/basictypes.h" +#include bool free_disk_space(const std::string &dir, uint64_t &space); diff --git a/ext/native/file/vfs.h b/ext/native/file/vfs.h index ce1023b635..b823519865 100644 --- a/ext/native/file/vfs.h +++ b/ext/native/file/vfs.h @@ -1,7 +1,8 @@ #pragma once -#include "base/basictypes.h" +#include #include "file/file_util.h" + // Basic virtual file system. Used to manage assets on Android, where we have to // read them manually out of the APK zipfile, while being able to run on other // platforms as well with the appropriate directory set-up. diff --git a/ext/native/file/zip_read.cpp b/ext/native/file/zip_read.cpp index 7efcab7255..45acc56f9b 100644 --- a/ext/native/file/zip_read.cpp +++ b/ext/native/file/zip_read.cpp @@ -7,9 +7,9 @@ #include #endif -#include "base/basictypes.h" #include "file/zip_read.h" +#include "Common/Common.h" #include "Common/Log.h" #ifdef __ANDROID__ @@ -201,6 +201,11 @@ bool ZipAssetReader::GetFileInfo(const char *path, FileInfo *info) { #endif +DirectoryAssetReader::DirectoryAssetReader(const char *path) { + strncpy(path_, path, ARRAY_SIZE(path_)); + path_[ARRAY_SIZE(path_) - 1] = '\0'; +} + uint8_t *DirectoryAssetReader::ReadAsset(const char *path, size_t *size) { char new_path[2048]; new_path[0] = '\0'; diff --git a/ext/native/file/zip_read.h b/ext/native/file/zip_read.h index 750a71a154..086fc43775 100644 --- a/ext/native/file/zip_read.h +++ b/ext/native/file/zip_read.h @@ -8,7 +8,6 @@ #include #include -#include "base/basictypes.h" #include "file/vfs.h" #include "file/file_util.h" @@ -48,10 +47,7 @@ private: class DirectoryAssetReader : public AssetReader { public: - explicit DirectoryAssetReader(const char *path) { - strncpy(path_, path, ARRAY_SIZE(path_)); - path_[ARRAY_SIZE(path_) - 1] = '\0'; - } + explicit DirectoryAssetReader(const char *path); // use delete[] virtual uint8_t *ReadAsset(const char *path, size_t *size); virtual bool GetFileListing(const char *path, std::vector *listing, const char *filter); diff --git a/ext/native/gfx_es2/draw_buffer.h b/ext/native/gfx_es2/draw_buffer.h index a702fd6693..9b1e5d7e8d 100644 --- a/ext/native/gfx_es2/draw_buffer.h +++ b/ext/native/gfx_es2/draw_buffer.h @@ -3,8 +3,8 @@ // "Immediate mode"-lookalike buffered drawing. Very fast way to draw 2D. #include +#include -#include "base/basictypes.h" #include "base/colorutil.h" #include "gfx/texture_atlas.h" #include "math/geom2d.h" diff --git a/ext/native/gfx_es2/draw_text.h b/ext/native/gfx_es2/draw_text.h index f6bf8e3e34..094ccdd28d 100644 --- a/ext/native/gfx_es2/draw_text.h +++ b/ext/native/gfx_es2/draw_text.h @@ -10,10 +10,9 @@ #include "ppsspp_config.h" -#include #include +#include -#include "base/basictypes.h" #include "gfx_es2/draw_buffer.h" #include "util/text/wrap_text.h" @@ -41,12 +40,6 @@ struct TextMeasureEntry { int lastUsedFrame; }; -// Not yet functional -enum { - FONTSTYLE_BOLD = 1, - FONTSTYLE_ITALIC = 2, -}; - class TextDrawer { public: virtual ~TextDrawer(); @@ -99,11 +92,10 @@ protected: bool ignoreGlobalDpi_ = false; }; - class TextDrawerWordWrapper : public WordWrapper { public: - TextDrawerWordWrapper(TextDrawer *drawer, const char *str, float maxW, int flags) : WordWrapper(str, maxW, flags), drawer_(drawer) { - } + TextDrawerWordWrapper(TextDrawer *drawer, const char *str, float maxW, int flags) + : WordWrapper(str, maxW, flags), drawer_(drawer) {} protected: float MeasureWidth(const char *str, size_t bytes) override; diff --git a/ext/native/i18n/i18n.h b/ext/native/i18n/i18n.h index a973ea2f8f..f8493d1b99 100644 --- a/ext/native/i18n/i18n.h +++ b/ext/native/i18n/i18n.h @@ -14,7 +14,7 @@ #include #include -#include "base/basictypes.h" +#include "Common/Common.h" // Reasonably thread safe. diff --git a/ext/native/image/zim_load.h b/ext/native/image/zim_load.h index ccec2d71b9..18354bc6d6 100644 --- a/ext/native/image/zim_load.h +++ b/ext/native/image/zim_load.h @@ -1,6 +1,6 @@ #pragma once -#include "base/basictypes.h" +#include // LoadZIM's responsibility: // * Parse the ZIM format diff --git a/ext/native/image/zim_save.cpp b/ext/native/image/zim_save.cpp index b62ba3adb8..f46ca72ef7 100644 --- a/ext/native/image/zim_save.cpp +++ b/ext/native/image/zim_save.cpp @@ -2,6 +2,7 @@ #include #include +#include "image/zim_load.h" #include "image/zim_save.h" #include "zlib.h" @@ -77,8 +78,6 @@ bool ispowerof2 (int x) { return true; } - - void Convert(const uint8_t *image_data, int width, int height, int pitch, int flags, uint8_t **data, int *data_size) { // For 4444 and 565. Ordered dither matrix. looks really surprisingly good on cell phone screens at 4444. @@ -157,10 +156,10 @@ uint8_t *DownsampleBy2(const uint8_t *image, int width, int height, int pitch) { int degamma[256]; int gamma[32768]; for (int i =0; i < 256; i++) { - degamma[i] = powf((float)i / 255.0f, 1.0f/2.2f) * 8191.0f; + degamma[i] = (int)(powf((float)i / 255.0f, 1.0f/2.2f) * 8191.0f); } for (int i = 0; i < 32768; i++) { - gamma[i] = powf((float)i / 32764.0f, 2.2f) * 255.0f; + gamma[i] = (int)(powf((float)i / 32764.0f, 2.2f) * 255.0f); } // Really stupid mipmap downsampling - at least it does gamma though. diff --git a/ext/native/image/zim_save.h b/ext/native/image/zim_save.h index 3fe5c2f68a..c8938a91e9 100644 --- a/ext/native/image/zim_save.h +++ b/ext/native/image/zim_save.h @@ -1,9 +1,10 @@ #pragma once #include +#include -#include "base/basictypes.h" -#include "image/zim_load.h" +// For the type enums etc. +#include "zim_load.h" // SaveZIM's responsibility: // * Write the ZIM format diff --git a/ext/native/input/input_state.h b/ext/native/input/input_state.h index c648612e34..2ce502f860 100644 --- a/ext/native/input/input_state.h +++ b/ext/native/input/input_state.h @@ -8,7 +8,6 @@ #include #include "math/lin/vec3.h" -#include "base/basictypes.h" #include "input/keycodes.h" // Default device IDs diff --git a/ext/native/json/json_reader.h b/ext/native/json/json_reader.h index 612a7f9d2f..60cc78cfb9 100644 --- a/ext/native/json/json_reader.h +++ b/ext/native/json/json_reader.h @@ -2,8 +2,8 @@ #include #include -#include "base/basictypes.h" #include "ext/gason/gason.h" +#include "Common/Common.h" #include "Common/Log.h" namespace json { diff --git a/ext/native/math/curves.cpp b/ext/native/math/curves.cpp index ae5ad95ee7..65dae53f5e 100644 --- a/ext/native/math/curves.cpp +++ b/ext/native/math/curves.cpp @@ -1,9 +1,11 @@ -#include +#include #include "math/math_util.h" #include "curves.h" +#include "Common/Common.h" + float linearInOut(int t, int fadeInLength, int solidLength, int fadeOutLength) { if (t < 0) return 0; if (t < fadeInLength) { diff --git a/ext/native/math/curves.h b/ext/native/math/curves.h index 8799a0cf82..8a2004e012 100644 --- a/ext/native/math/curves.h +++ b/ext/native/math/curves.h @@ -1,10 +1,7 @@ #pragma once -#include "base/basictypes.h" - // Easy curve computation for fades etc. - // output range: [0.0, 1.0] float linearInOut(int t, int fadeInLength, int solidLength, int fadeOutLength); float linearIn(int t, int fadeInLength); diff --git a/ext/native/math/expression_parser.h b/ext/native/math/expression_parser.h index 306075c9c9..3d39340a42 100644 --- a/ext/native/math/expression_parser.h +++ b/ext/native/math/expression_parser.h @@ -1,6 +1,6 @@ #pragma once -#include "../base/basictypes.h" +#include #include typedef std::pair ExpressionPair; diff --git a/ext/native/math/math_util.h b/ext/native/math/math_util.h index 12147a6f64..0cf1101321 100644 --- a/ext/native/math/math_util.h +++ b/ext/native/math/math_util.h @@ -5,8 +5,7 @@ #include #include - -#include "base/basictypes.h" +#include typedef unsigned short float16; @@ -101,7 +100,7 @@ inline int is_even(float d) { // Rounds *.5 to closest even number inline double round_ieee_754(double d) { - float i = floor(d); + float i = (float)floor(d); d -= i; if (d < 0.5f) return i; diff --git a/ext/native/net/http_client.h b/ext/native/net/http_client.h index 9c935858fa..be71cedcff 100644 --- a/ext/native/net/http_client.h +++ b/ext/native/net/http_client.h @@ -3,8 +3,8 @@ #include #include #include +#include -#include "base/basictypes.h" #include "base/buffer.h" #include "net/resolve.h" diff --git a/ext/native/net/url.h b/ext/native/net/url.h index a46564d642..1a8a91677b 100644 --- a/ext/native/net/url.h +++ b/ext/native/net/url.h @@ -1,13 +1,12 @@ #pragma once #include -#include -#include +#include +#include #include +#include #include -#include "base/basictypes.h" - #if defined(_MSC_VER) && _MSC_VER < 1900 #undef snprintf #define snprintf _snprintf diff --git a/ext/native/thread/prioritizedworkqueue.h b/ext/native/thread/prioritizedworkqueue.h index 032e6a9694..83848d2c65 100644 --- a/ext/native/thread/prioritizedworkqueue.h +++ b/ext/native/thread/prioritizedworkqueue.h @@ -5,9 +5,10 @@ #include #include -#include "base/basictypes.h" #include "thread/threadutil.h" +#include "Common/Common.h" + // Priorities can change dynamically. // Try to make priority() fast, it will be called a lot. diff --git a/ext/native/thread/threadutil.cpp b/ext/native/thread/threadutil.cpp index 9971293685..8b9d32bc52 100644 --- a/ext/native/thread/threadutil.cpp +++ b/ext/native/thread/threadutil.cpp @@ -9,8 +9,8 @@ #endif #include +#include -#include "base/basictypes.h" #include "thread/threadutil.h" #include "Common/Log.h" diff --git a/ext/native/tools/zimtool.cpp b/ext/native/tools/zimtool.cpp index 7fadb4218b..9e3fe3b813 100644 --- a/ext/native/tools/zimtool.cpp +++ b/ext/native/tools/zimtool.cpp @@ -3,8 +3,11 @@ #include #include "image/png_load.h" +#include "image/zim_load.h" #include "image/zim_save.h" +#include "Common/Common.h" + char magic[5] = "ZIMG"; bool FLAGS_flip = false; diff --git a/ext/native/ui/screen.h b/ext/native/ui/screen.h index d269995880..f0c696a6de 100644 --- a/ext/native/ui/screen.h +++ b/ext/native/ui/screen.h @@ -16,10 +16,11 @@ #include #include -#include "base/basictypes.h" #include "base/NativeApp.h" #include "input/input_state.h" +#include "Common/Common.h" + namespace UI { class View; } diff --git a/ext/native/ui/ui_context.h b/ext/native/ui/ui_context.h index b6d9dd3e43..03130d29b9 100644 --- a/ext/native/ui/ui_context.h +++ b/ext/native/ui/ui_context.h @@ -2,8 +2,8 @@ #include #include +#include -#include "base/basictypes.h" #include "math/geom2d.h" #include "math/lin/vec3.h" #include "gfx/texture_atlas.h" diff --git a/ext/native/ui/view.h b/ext/native/ui/view.h index b21d82076d..379456301f 100644 --- a/ext/native/ui/view.h +++ b/ext/native/ui/view.h @@ -15,12 +15,13 @@ #include #include -#include "base/basictypes.h" #include "gfx/texture_atlas.h" #include "math/lin/matrix4x4.h" #include "math/math_util.h" #include "math/geom2d.h" +#include "Common/Common.h" + #undef small struct KeyInput; diff --git a/ext/native/util/hash/hash.cpp b/ext/native/util/hash/hash.cpp index 3bb840f84d..5af7728d0d 100644 --- a/ext/native/util/hash/hash.cpp +++ b/ext/native/util/hash/hash.cpp @@ -1,4 +1,4 @@ -#include "base/basictypes.h" +#include #include "util/hash/hash.h" namespace hash { diff --git a/ext/native/util/random/rng.h b/ext/native/util/random/rng.h index 0a5960fa70..50ec4ea60e 100644 --- a/ext/native/util/random/rng.h +++ b/ext/native/util/random/rng.h @@ -1,6 +1,6 @@ #pragma once -#include "base/basictypes.h" +#include // George Marsaglia-style random number generator. class GMRng { diff --git a/ext/native/util/text/parsers.h b/ext/native/util/text/parsers.h index a2bf62dfd4..909e667178 100644 --- a/ext/native/util/text/parsers.h +++ b/ext/native/util/text/parsers.h @@ -2,8 +2,7 @@ #include #include - -#include "base/basictypes.h" +#include #undef major #undef minor diff --git a/ext/native/util/text/shiftjis.h b/ext/native/util/text/shiftjis.h index e92df04db6..5f77f7665d 100644 --- a/ext/native/util/text/shiftjis.h +++ b/ext/native/util/text/shiftjis.h @@ -1,6 +1,6 @@ #pragma once -#include "base/basictypes.h" +#include // Warning: decodes/encodes JIS, not Unicode. // Use a table to map. @@ -137,4 +137,4 @@ struct ShiftJIS { private: const char *c_; int index_; -}; \ No newline at end of file +}; diff --git a/ext/native/util/text/utf16.h b/ext/native/util/text/utf16.h index 830eac2c51..c23a554856 100644 --- a/ext/native/util/text/utf16.h +++ b/ext/native/util/text/utf16.h @@ -1,5 +1,6 @@ #pragma once +#include #include "base/basictypes.h" // Should optimize out. diff --git a/ext/native/util/text/utf8.cpp b/ext/native/util/text/utf8.cpp index 5c24b761af..a847feef96 100644 --- a/ext/native/util/text/utf8.cpp +++ b/ext/native/util/text/utf8.cpp @@ -18,15 +18,15 @@ #undef max #endif -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include "base/basictypes.h" #include "utf8.h" #include "utf16.h" diff --git a/ext/native/util/text/utf8.h b/ext/native/util/text/utf8.h index fd6ddf64e7..9d04a788a0 100644 --- a/ext/native/util/text/utf8.h +++ b/ext/native/util/text/utf8.h @@ -16,7 +16,7 @@ #pragma once -#include "base/basictypes.h" +#include #include uint32_t u8_nextchar(const char *s, int *i); diff --git a/ext/snappy/snappy-stubs-public.h b/ext/snappy/snappy-stubs-public.h index 50d501324d..fddafbc8c7 100644 --- a/ext/snappy/snappy-stubs-public.h +++ b/ext/snappy/snappy-stubs-public.h @@ -35,7 +35,6 @@ #ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ #define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ -#include "base/basictypes.h" #include namespace snappy {