Skip to content

Commit

Permalink
Merge pull request #13489 from hrydgard/remove-more-old-stuff
Browse files Browse the repository at this point in the history
Remove more old stuff
  • Loading branch information
hrydgard authored Sep 29, 2020
2 parents b878266 + 63c8b0f commit a1964ca
Show file tree
Hide file tree
Showing 189 changed files with 666 additions and 842 deletions.
29 changes: 18 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,35 @@ add_library(Common STATIC
${CommonFake}
${CommonWindows}
${CommonVulkan}
Common/ColorConv.cpp
Common/ColorConv.h
Common/Serialize/Serializer.cpp
Common/Serialize/Serializer.h
Common/Serialize/SerializeDeque.h
Common/Serialize/SerializeFuncs.h
Common/Serialize/SerializeList.h
Common/Serialize/SerializeMap.h
Common/Serialize/SerializeSet.h
Common/ConsoleListener.cpp
Common/ConsoleListener.h
Common/Crypto/md5.cpp
Common/Crypto/md5.h
Common/Crypto/sha1.cpp
Common/Crypto/sha1.h
Common/Crypto/sha256.cpp
Common/Crypto/sha256.h
Common/BitScan.h
Common/BitSet.h
Common/Buffer.h
Common/Buffer.cpp
Common/ByteSwap.h
Common/CodeBlock.h
Common/ColorConv.cpp
Common/ColorConv.h
Common/Common.h
Common/CommonFuncs.h
Common/CommonTypes.h
Common/ConsoleListener.cpp
Common/ConsoleListener.h
Common/DbgNew.h
Common/FakeEmitter.h
Common/FixedSizeQueue.h
Common/ExceptionHandlerSetup.cpp
Common/ExceptionHandlerSetup.h
Common/FileUtil.cpp
Expand All @@ -463,11 +475,12 @@ add_library(Common STATIC
Common/MemArena.h
Common/MemoryUtil.cpp
Common/MemoryUtil.h
Common/Misc.cpp
Common/OSVersion.cpp
Common/OSVersion.h
Common/StringUtils.cpp
Common/StringUtils.h
Common/SysError.h
Common/SysError.cpp
Common/ThreadPools.cpp
Common/ThreadPools.h
Common/ThreadSafeList.h
Expand Down Expand Up @@ -939,16 +952,10 @@ endif()

add_library(native STATIC
${nativeExtra}
ext/native/base/basictypes.h
ext/native/base/buffer.cpp
ext/native/base/buffer.h
ext/native/base/colorutil.cpp
ext/native/base/colorutil.h
ext/native/base/display.cpp
ext/native/base/display.h
ext/native/base/linked_ptr.h
ext/native/base/stringutil.cpp
ext/native/base/stringutil.h
ext/native/data/base64.cpp
ext/native/data/base64.h
ext/native/data/compression.cpp
Expand Down
7 changes: 2 additions & 5 deletions Common/Arm64Emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
#include "ppsspp_config.h"

#include <limits>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cinttypes>

#include <stdlib.h>
#include <string.h>

#include "base/basictypes.h"
#include <cstdlib>
#include <cstring>

#include "Arm64Emitter.h"
#include "MathUtil.h"
Expand Down
12 changes: 6 additions & 6 deletions ext/native/base/buffer.cpp → Common/Buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "base/buffer.h"

#include <stdarg.h>
#include <stdlib.h>
Expand All @@ -18,15 +17,16 @@
#define MSG_NOSIGNAL 0x00
#endif

#include "Common/TimeUtil.h"
#include "file/fd_util.h"

#include "Common/TimeUtil.h"
#include "Common/Buffer.h"
#include "Common/Log.h"

Buffer::Buffer() { }
Buffer::~Buffer() { }

char *Buffer::Append(ssize_t length) {
char *Buffer::Append(size_t length) {
if (length > 0) {
size_t old_size = data_.size();
data_.resize(old_size + length);
Expand Down Expand Up @@ -120,8 +120,8 @@ void Buffer::Printf(const char *fmt, ...) {
char buffer[2048];
va_list vl;
va_start(vl, fmt);
ssize_t retval = vsnprintf(buffer, sizeof(buffer), fmt, vl);
if (retval >= (ssize_t)sizeof(buffer)) {
size_t retval = vsnprintf(buffer, sizeof(buffer), fmt, vl);
if ((int)retval >= (int)sizeof(buffer)) {
// Output was truncated. TODO: Do something.
ERROR_LOG(IO, "Buffer::Printf truncated output");
}
Expand All @@ -135,7 +135,7 @@ void Buffer::Printf(const char *fmt, ...) {

bool Buffer::Flush(int fd) {
// Look into using send() directly.
bool success = (ssize_t)data_.size() == fd_util::WriteLine(fd, &data_[0], data_.size());
bool success = data_.size() == fd_util::WriteLine(fd, &data_[0], data_.size());
if (success) {
data_.resize(0);
}
Expand Down
5 changes: 1 addition & 4 deletions ext/native/base/buffer.h → Common/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include <string>
#include <vector>

#include "base/basictypes.h"

#include "Common/Common.h"

// Acts as a queue. Intended to be as fast as possible for most uses.
Expand All @@ -16,8 +14,7 @@ class Buffer {

// Write max [length] bytes to the returned pointer.
// Any other operation on this Buffer invalidates the pointer.
char *Append(ssize_t length);
char *Append(size_t length) { return Append((ssize_t)length); }
char *Append(size_t length);

// These work pretty much like you'd expect.
void Append(const char *str); // str null-terminated. The null is not copied.
Expand Down
29 changes: 29 additions & 0 deletions Common/ByteSwap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include <cstdint>
#include <cstdlib> // for byte swapping

// Byteswapping
// Just in case this has been defined by platform
#undef swap16
#undef swap32
#undef swap64

#ifdef _WIN32
inline uint16_t swap16(uint16_t _data) { return _byteswap_ushort(_data); }
inline uint32_t swap32(uint32_t _data) { return _byteswap_ulong(_data); }
inline uint64_t swap64(uint64_t _data) { return _byteswap_uint64(_data); }
#elif defined(__GNUC__)
inline uint16_t swap16(uint16_t _data) { return __builtin_bswap16(_data); }
inline uint32_t swap32(uint32_t _data) { return __builtin_bswap32(_data); }
inline uint64_t swap64(uint64_t _data) { return __builtin_bswap64(_data); }
#else
// Slow generic implementation. Hopefully this never hits
inline uint16_t swap16(uint16_t data) { return (data >> 8) | (data << 8); }
inline uint32_t swap32(uint32_t data) { return (swap16(data) << 16) | swap16(data >> 16); }
inline uint64_t swap64(uint64_t data) { return ((uint64_t)swap32(data) << 32) | swap32(data >> 32); }
#endif

inline uint16_t swap16(const uint8_t* _pData) { return swap16(*(const uint16_t*)_pData); }
inline uint32_t swap32(const uint8_t* _pData) { return swap32(*(const uint32_t*)_pData); }
inline uint64_t swap64(const uint8_t* _pData) { return swap64(*(const uint64_t*)_pData); }
1 change: 0 additions & 1 deletion Common/CPUDetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <memory.h>
#include <set>

#include "base/basictypes.h"
#include "file/file_util.h"

#include "Common/Common.h"
Expand Down
22 changes: 21 additions & 1 deletion Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include <stdarg.h>

#ifdef _MSC_VER
#pragma warning (disable:4100)
#pragma warning(disable:4100)
#pragma warning(disable:4244)
#pragma warning(disable:4996)
#endif

#include "Log.h"
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@
<ClInclude Include="ArmEmitter.h" />
<ClInclude Include="BitScan.h" />
<ClInclude Include="BitSet.h" />
<ClInclude Include="Buffer.h" />
<ClInclude Include="ByteSwap.h" />
<ClInclude Include="FakeEmitter.h" />
<ClInclude Include="Serialize\SerializeDeque.h" />
<ClInclude Include="Serialize\SerializeFuncs.h" />
Expand Down Expand Up @@ -413,6 +415,7 @@
<ClInclude Include="stdafx.h" />
<ClInclude Include="StringUtils.h" />
<ClInclude Include="Swap.h" />
<ClInclude Include="SysError.h" />
<ClInclude Include="ThreadPools.h" />
<ClInclude Include="ThreadSafeList.h" />
<ClInclude Include="Thunk.h" />
Expand Down Expand Up @@ -440,6 +443,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="ArmEmitter.cpp" />
<ClCompile Include="Buffer.cpp" />
<ClCompile Include="ColorConvNEON.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -498,7 +502,7 @@
<ClCompile Include="MemArenaDarwin.cpp" />
<ClCompile Include="MemoryUtil.cpp" />
<ClCompile Include="MipsEmitter.cpp" />
<ClCompile Include="Misc.cpp" />
<ClCompile Include="SysError.cpp" />
<ClCompile Include="OSVersion.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
Expand Down
6 changes: 5 additions & 1 deletion Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
</ClInclude>
<ClInclude Include="TimeUtil.h" />
<ClInclude Include="FakeEmitter.h" />
<ClInclude Include="ByteSwap.h" />
<ClInclude Include="Buffer.h" />
<ClInclude Include="SysError.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp" />
Expand All @@ -103,7 +106,6 @@
<ClCompile Include="FileUtil.cpp" />
<ClCompile Include="LogManager.cpp" />
<ClCompile Include="MemoryUtil.cpp" />
<ClCompile Include="Misc.cpp" />
<ClCompile Include="StringUtils.cpp" />
<ClCompile Include="Thunk.cpp" />
<ClCompile Include="Timer.cpp" />
Expand Down Expand Up @@ -161,6 +163,8 @@
</ClCompile>
<ClCompile Include="TimeUtil.cpp" />
<ClCompile Include="Log.cpp" />
<ClCompile Include="Buffer.cpp" />
<ClCompile Include="SysError.cpp" />
</ItemGroup>
<ItemGroup>
<Filter Include="Crypto">
Expand Down
8 changes: 0 additions & 8 deletions Common/CommonFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,3 @@ inline u64 __rotr64(u64 x, unsigned int shift){
#endif
#define Crash() {__debugbreak();}
#endif // WIN32 ndef

// Generic function to get last error message.
// Call directly after the command or use the error num.
// This function might change the error code.
// Defined in Misc.cpp.
const char *GetLastErrorMsg();
const char *GetStringErrorMsg(int errCode);

5 changes: 3 additions & 2 deletions Common/ConsoleListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
#include "ppsspp_config.h"
#include "thread/threadutil.h"
#include "util/text/utf8.h"
#include "Common.h"
#include "ConsoleListener.h" // Common
#include "Common/Common.h"
#include "Common/ConsoleListener.h"
#include "Common/StringUtils.h"

#if defined(USING_WIN_UI)
const int LOG_PENDING_MAX = 120 * 10000;
Expand Down
4 changes: 2 additions & 2 deletions Common/FakeCPUDetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include <memory>
#include <cstdint>

#include <memory.h>
#include "base/basictypes.h"
#include "Common.h"
#include "CPUDetect.h"
#include "StringUtils.h"
Expand Down
Loading

0 comments on commit a1964ca

Please sign in to comment.