diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 5e16e468af..c367c2eb93 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -43,7 +43,7 @@ static bool IsPowerOfTwo(uint64_t x) #define V8_UINT64_C(x) ((uint64_t)(x)) -bool IsImmArithmetic(uint64_t input, u32 *val, bool *shift) +bool IsImmArithmetic(uint64_t input, u32* val, bool* shift) { if (input < 4096) { @@ -1002,7 +1002,7 @@ void ARM64XEmitter::BL(const void* ptr) EncodeUnconditionalBranchInst(1, ptr); } -void ARM64XEmitter::QuickCallFunction(ARM64Reg scratchreg, const void *func) +void ARM64XEmitter::QuickCallFunction(ARM64Reg scratchreg, const void* func) { s64 distance = (s64)func - (s64)m_code; distance >>= 2; // Can only branch to opcode-aligned (4) addresses @@ -4094,7 +4094,7 @@ float FPImm8ToFloat(uint8_t bits) return fl; } -bool FPImm8FromFloat(float value, uint8_t *immOut) +bool FPImm8FromFloat(float value, uint8_t* immOut) { uint32_t f; memcpy(&f, &value, sizeof(float)); diff --git a/Source/Core/Common/Arm64Emitter.h b/Source/Core/Common/Arm64Emitter.h index 40b2523826..81585d37d9 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -98,10 +98,10 @@ constexpr ARM64Reg EncodeRegToQuad(ARM64Reg reg) { return static_cast - void MOVP2R(ARM64Reg Rd, P *ptr) + void MOVP2R(ARM64Reg Rd, P* ptr) { _assert_msg_(DYNA_REC, Is64Bit(Rd), "Can't store pointers in 32-bit registers"); MOVI2R(Rd, (uintptr_t)ptr); @@ -730,7 +730,7 @@ public: } // Plain function call - void QuickCallFunction(ARM64Reg scratchreg, const void *func); + void QuickCallFunction(ARM64Reg scratchreg, const void* func); template void QuickCallFunction(ARM64Reg scratchreg, T func) { QuickCallFunction(scratchreg, (const void *)func); diff --git a/Source/Core/Common/BreakPoints.cpp b/Source/Core/Common/BreakPoints.cpp index d69f561432..59ea6864d2 100644 --- a/Source/Core/Common/BreakPoints.cpp +++ b/Source/Core/Common/BreakPoints.cpp @@ -188,7 +188,7 @@ void MemChecks::Remove(u32 _Address) jit->ClearCache(); } -TMemCheck *MemChecks::GetMemCheck(u32 address) +TMemCheck* MemChecks::GetMemCheck(u32 address) { for (TMemCheck& bp : m_MemChecks) { @@ -207,7 +207,7 @@ TMemCheck *MemChecks::GetMemCheck(u32 address) return nullptr; } -bool TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc) +bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc) { if ((write && OnWrite) || (!write && OnRead)) { diff --git a/Source/Core/Common/BreakPoints.h b/Source/Core/Common/BreakPoints.h index d2fc88c064..d7592ee54b 100644 --- a/Source/Core/Common/BreakPoints.h +++ b/Source/Core/Common/BreakPoints.h @@ -41,7 +41,7 @@ struct TMemCheck u32 numHits; // returns whether to break - bool Action(DebugInterface *dbg_interface, u32 _iValue, u32 addr, + bool Action(DebugInterface* dbg_interface, u32 _iValue, u32 addr, bool write, int size, u32 pc); }; @@ -99,7 +99,7 @@ public: void Add(const TMemCheck& _rMemoryCheck); // memory breakpoint - TMemCheck *GetMemCheck(u32 address); + TMemCheck* GetMemCheck(u32 address); void Remove(u32 _Address); void Clear() { m_MemChecks.clear(); } diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index 8ea4e3175f..386880e989 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -311,7 +311,7 @@ private: } __forceinline - void DoVoid(void *data, u32 size) + void DoVoid(void* data, u32 size) { switch (mode) { @@ -421,7 +421,7 @@ public: } // Get data - u8 *ptr = nullptr; + u8* ptr = nullptr; PointerWrap p(&ptr, PointerWrap::MODE_MEASURE); _class.DoState(p); size_t const sz = (size_t)ptr; diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index 8f02f08336..e399b1003a 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -21,7 +21,7 @@ private: virtual void PoisonMemory() = 0; protected: - u8 *region; + u8* region; size_t region_size; size_t parent_region_size; @@ -68,7 +68,7 @@ public: } } - bool IsInSpace(u8 *ptr) const + bool IsInSpace(u8* ptr) const { return (ptr >= region) && (ptr < (region + region_size)); } diff --git a/Source/Core/Common/ColorUtil.cpp b/Source/Core/Common/ColorUtil.cpp index 21898f596e..4204c7c29d 100644 --- a/Source/Core/Common/ColorUtil.cpp +++ b/Source/Core/Common/ColorUtil.cpp @@ -74,7 +74,7 @@ void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height) { for (int iy = 0; iy < 4; iy++, src += 8) { - u32 *tdst = dst+(y+iy)*width+x; + u32* tdst = dst+(y+iy)*width+x; for (int ix = 0; ix < 8; ix++) { // huh, this seems wrong. CI8, not 5A3, no? diff --git a/Source/Core/Common/Crypto/bn.cpp b/Source/Core/Common/Crypto/bn.cpp index 9311051a17..9a7ddb54d0 100644 --- a/Source/Core/Common/Crypto/bn.cpp +++ b/Source/Core/Common/Crypto/bn.cpp @@ -8,17 +8,17 @@ #include "Common/CommonTypes.h" #include "Common/Crypto/bn.h" -static void bn_zero(u8 *d, u32 n) +static void bn_zero(u8* d, u32 n) { memset(d, 0, n); } -static void bn_copy(u8 *d, const u8 *a, u32 n) +static void bn_copy(u8* d, const u8* a, u32 n) { memcpy(d, a, n); } -int bn_compare(const u8 *a, const u8 *b, u32 n) +int bn_compare(const u8* a, const u8* b, u32 n) { u32 i; @@ -32,7 +32,7 @@ int bn_compare(const u8 *a, const u8 *b, u32 n) return 0; } -void bn_sub_modulus(u8 *a, const u8 *N, u32 n) +void bn_sub_modulus(u8* a, const u8* N, u32 n) { u32 i; u32 dig; @@ -46,7 +46,7 @@ void bn_sub_modulus(u8 *a, const u8 *N, u32 n) } } -void bn_add(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n) +void bn_add(u8* d, const u8* a, const u8* b, const u8* N, u32 n) { u32 i; u32 dig; @@ -66,7 +66,7 @@ void bn_add(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n) bn_sub_modulus(d, N, n); } -void bn_mul(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n) +void bn_mul(u8* d, const u8* a, const u8* b, const u8* N, u32 n) { u32 i; u8 mask; @@ -81,7 +81,7 @@ void bn_mul(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n) } } -void bn_exp(u8 *d, const u8 *a, const u8 *N, u32 n, const u8 *e, u32 en) +void bn_exp(u8* d, const u8* a, const u8* N, u32 n, const u8* e, u32 en) { u8 t[512]; u32 i; @@ -100,7 +100,7 @@ void bn_exp(u8 *d, const u8 *a, const u8 *N, u32 n, const u8 *e, u32 en) } // only for prime N -- stupid but lazy, see if I care -void bn_inv(u8 *d, const u8 *a, const u8 *N, u32 n) +void bn_inv(u8* d, const u8* a, const u8* N, u32 n) { u8 t[512], s[512]; diff --git a/Source/Core/Common/Crypto/bn.h b/Source/Core/Common/Crypto/bn.h index 34eee13cc9..ffb6b35dd4 100644 --- a/Source/Core/Common/Crypto/bn.h +++ b/Source/Core/Common/Crypto/bn.h @@ -8,9 +8,9 @@ // bignum arithmetic -int bn_compare(const u8 *a, const u8 *b, u32 n); -void bn_sub_modulus(u8 *a, const u8 *N, u32 n); -void bn_add(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n); -void bn_mul(u8 *d, const u8 *a, const u8 *b, const u8 *N, u32 n); -void bn_inv(u8 *d, const u8 *a, const u8 *N, u32 n); // only for prime N -void bn_exp(u8 *d, const u8 *a, const u8 *N, u32 n, const u8 *e, u32 en); +int bn_compare(const u8* a, const u8* b, u32 n); +void bn_sub_modulus(u8* a, const u8* N, u32 n); +void bn_add(u8* d, const u8* a, const u8* b, const u8* N, u32 n); +void bn_mul(u8* d, const u8* a, const u8* b, const u8* N, u32 n); +void bn_inv(u8* d, const u8* a, const u8* N, u32 n); // only for prime N +void bn_exp(u8* d, const u8* a, const u8* N, u32 n, const u8* e, u32 en); diff --git a/Source/Core/Common/Crypto/ec.cpp b/Source/Core/Common/Crypto/ec.cpp index b29179e897..7aafdd4838 100644 --- a/Source/Core/Common/Crypto/ec.cpp +++ b/Source/Core/Common/Crypto/ec.cpp @@ -32,17 +32,17 @@ static const u8 ec_G[60] = ,0x01,0x00,0x6a,0x08,0xa4,0x19,0x03,0x35,0x06,0x78,0xe5,0x85,0x28,0xbe,0xbf ,0x8a,0x0b,0xef,0xf8,0x67,0xa7,0xca,0x36,0x71,0x6f,0x7e,0x01,0xf8,0x10,0x52}; -static void elt_copy(u8 *d, const u8 *a) +static void elt_copy(u8* d, const u8* a) { memcpy(d, a, 30); } -static void elt_zero(u8 *d) +static void elt_zero(u8* d) { memset(d, 0, 30); } -static int elt_is_zero(const u8 *d) +static int elt_is_zero(const u8* d) { u32 i; @@ -53,7 +53,7 @@ static int elt_is_zero(const u8 *d) return 1; } -static void elt_add(u8 *d, const u8 *a, const u8 *b) +static void elt_add(u8* d, const u8* a, const u8* b) { u32 i; @@ -61,7 +61,7 @@ static void elt_add(u8 *d, const u8 *a, const u8 *b) d[i] = a[i] ^ b[i]; } -static void elt_mul_x(u8 *d, const u8 *a) +static void elt_mul_x(u8* d, const u8* a) { u8 carry, x, y; u32 i; @@ -79,7 +79,7 @@ static void elt_mul_x(u8 *d, const u8 *a) d[20] ^= carry << 2; } -static void elt_mul(u8 *d, const u8 *a, const u8 *b) +static void elt_mul(u8* d, const u8* a, const u8* b) { u32 i, n; u8 mask; @@ -105,7 +105,7 @@ static void elt_mul(u8 *d, const u8 *a, const u8 *b) static const u8 square[16] = {0x00,0x01,0x04,0x05,0x10,0x11,0x14,0x15,0x40,0x41,0x44,0x45,0x50,0x51,0x54,0x55}; -static void elt_square_to_wide(u8 *d, const u8 *a) +static void elt_square_to_wide(u8* d, const u8* a) { u32 i; @@ -115,7 +115,7 @@ static void elt_square_to_wide(u8 *d, const u8 *a) } } -static void wide_reduce(u8 *d) +static void wide_reduce(u8* d) { u32 i; u8 x; @@ -140,7 +140,7 @@ static void wide_reduce(u8 *d) d[30] &= 1; } -static void elt_square(u8 *d, const u8 *a) +static void elt_square(u8* d, const u8* a) { u8 wide[60]; @@ -150,7 +150,7 @@ static void elt_square(u8 *d, const u8 *a) elt_copy(d, wide + 30); } -static void itoh_tsujii(u8 *d, const u8 *a, const u8 *b, u32 j) +static void itoh_tsujii(u8* d, const u8* a, const u8* b, u32 j) { u8 t[30]; @@ -163,7 +163,7 @@ static void itoh_tsujii(u8 *d, const u8 *a, const u8 *b, u32 j) elt_mul(d, t, b); } -static void elt_inv(u8 *d, const u8 *a) +static void elt_inv(u8* d, const u8* a) { u8 t[30]; u8 s[30]; @@ -181,10 +181,10 @@ static void elt_inv(u8 *d, const u8 *a) elt_square(d, s); } -UNUSED static int point_is_on_curve(u8 *p) +UNUSED static int point_is_on_curve(u8* p) { u8 s[30], t[30]; - u8 *x, *y; + u8* x, *y; x = p; y = p + 30; @@ -205,16 +205,16 @@ UNUSED static int point_is_on_curve(u8 *p) return elt_is_zero(s); } -static int point_is_zero(const u8 *p) +static int point_is_zero(const u8* p) { return elt_is_zero(p) && elt_is_zero(p + 30); } -static void point_double(u8 *r, const u8 *p) +static void point_double(u8* r, const u8* p) { u8 s[30], t[30]; - const u8 *px, *py; - u8 *rx, *ry; + const u8* px, *py; + u8* rx, *ry; px = p; py = p + 30; @@ -243,11 +243,11 @@ static void point_double(u8 *r, const u8 *p) elt_add(ry, ry, t); } -static void point_add(u8 *r, const u8 *p, const u8 *q) +static void point_add(u8* r, const u8* p, const u8* q) { u8 s[30], t[30], u[30]; - const u8 *px, *py, *qx, *qy; - u8 *rx, *ry; + const u8* px, *py, *qx, *qy; + u8* rx, *ry; px = p; py = p + 30; @@ -297,7 +297,7 @@ static void point_add(u8 *r, const u8 *p, const u8 *q) elt_add(ry, s, rx); } -static void point_mul(u8 *d, const u8 *a, const u8 *b) // a is bignum +static void point_mul(u8* d, const u8* a, const u8* b) // a is bignum { u32 i; u8 mask; @@ -324,7 +324,7 @@ static void silly_random(u8 * rndArea, u8 count) } } -void generate_ecdsa(u8 *R, u8 *S, const u8 *k, const u8 *hash) +void generate_ecdsa(u8* R, u8* S, const u8* k, const u8* hash) { u8 e[30]; u8 kk[30]; @@ -362,7 +362,7 @@ void generate_ecdsa(u8 *R, u8 *S, const u8 *k, const u8 *hash) bn_mul(S, minv, kk, ec_N, 30); } -UNUSED static int check_ecdsa(u8 *Q, u8 *R, u8 *S, const u8 *hash) +UNUSED static int check_ecdsa(u8* Q, u8* R, u8* S, const u8* hash) { u8 Sinv[30]; u8 e[30]; @@ -388,7 +388,7 @@ UNUSED static int check_ecdsa(u8 *Q, u8 *R, u8 *S, const u8 *hash) return (bn_compare(r1, R, 30) == 0); } -void ec_priv_to_pub(const u8 *k, u8 *Q) +void ec_priv_to_pub(const u8* k, u8* Q) { point_mul(Q, k, ec_G); } diff --git a/Source/Core/Common/Crypto/ec.h b/Source/Core/Common/Crypto/ec.h index efbc7e903b..b3f33cdf7e 100644 --- a/Source/Core/Common/Crypto/ec.h +++ b/Source/Core/Common/Crypto/ec.h @@ -6,6 +6,6 @@ #include "Common/CommonTypes.h" -void generate_ecdsa(u8 *R, u8 *S, const u8 *k, const u8 *hash); +void generate_ecdsa(u8* R, u8* S, const u8* k, const u8* hash); -void ec_priv_to_pub(const u8 *k, u8 *Q); +void ec_priv_to_pub(const u8* k, u8* Q); diff --git a/Source/Core/Common/FifoQueue.h b/Source/Core/Common/FifoQueue.h index 6f65253cc3..1aa2bcc1b4 100644 --- a/Source/Core/Common/FifoQueue.h +++ b/Source/Core/Common/FifoQueue.h @@ -65,7 +65,7 @@ public: { if (NeedSize) m_size--; - ElementPtr *tmpptr = m_read_ptr; + ElementPtr* tmpptr = m_read_ptr; // advance the read pointer m_read_ptr = tmpptr->next.load(); // set the next element to nullptr to stop the recursive deletion @@ -81,7 +81,7 @@ public: if (NeedSize) m_size--; - ElementPtr *tmpptr = m_read_ptr; + ElementPtr* tmpptr = m_read_ptr; m_read_ptr = tmpptr->next.load(std::memory_order_acquire); t = std::move(tmpptr->current); tmpptr->next.store(nullptr); @@ -117,8 +117,8 @@ private: std::atomic next; }; - ElementPtr *m_write_ptr; - ElementPtr *m_read_ptr; + ElementPtr* m_write_ptr; + ElementPtr* m_read_ptr; std::atomic m_size; }; diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index bcc996e732..fef0e79bc3 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -417,7 +417,7 @@ u64 GetSize(const int fd) } // Overloaded GetSize, accepts FILE* -u64 GetSize(FILE *f) +u64 GetSize(FILE* f) { // can't use off_t here because it can be 32-bit u64 pos = ftello(f); @@ -482,7 +482,7 @@ FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive) #else struct dirent dirent, *result = nullptr; - DIR *dirp = opendir(directory.c_str()); + DIR* dirp = opendir(directory.c_str()); if (!dirp) return parent_entry; @@ -547,7 +547,7 @@ bool DeleteDirRecursively(const std::string &directory) const std::string virtualName(TStrToUTF8(ffd.cFileName)); #else struct dirent dirent, *result = nullptr; - DIR *dirp = opendir(directory.c_str()); + DIR* dirp = opendir(directory.c_str()); if (!dirp) return false; @@ -621,7 +621,7 @@ void CopyDir(const std::string &source_path, const std::string &dest_path) const std::string virtualName(TStrToUTF8(ffd.cFileName)); #else struct dirent dirent, *result = nullptr; - DIR *dirp = opendir(source_path.c_str()); + DIR* dirp = opendir(source_path.c_str()); if (!dirp) return; while (!readdir_r(dirp, &dirent, &result) && result) diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index 9ed318d1c9..13812c4747 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -82,7 +82,7 @@ u64 GetSize(const std::string &filename); u64 GetSize(const int fd); // Overloaded GetSize, accepts FILE* -u64 GetSize(FILE *f); +u64 GetSize(FILE* f); // Returns true if successful, or path already exists. bool CreateDir(const std::string &filename); diff --git a/Source/Core/Common/FixedSizeQueue.h b/Source/Core/Common/FixedSizeQueue.h index 9918aed4d1..1f6e73db00 100644 --- a/Source/Core/Common/FixedSizeQueue.h +++ b/Source/Core/Common/FixedSizeQueue.h @@ -16,7 +16,7 @@ template class FixedSizeQueue { - T *storage; + T* storage; int head; int tail; int count; // sacrifice 4 bytes for a simpler implementation. may optimize away in the future. diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index b0d3069525..679c539316 100644 --- a/Source/Core/Common/Hash.cpp +++ b/Source/Core/Common/Hash.cpp @@ -9,7 +9,7 @@ #include "Common/Hash.h" #include "Common/Intrinsics.h" -static u64 (*ptrHashFunction)(const u8 *src, u32 len, u32 samples) = &GetMurmurHash3; +static u64 (*ptrHashFunction)(const u8* src, u32 len, u32 samples) = &GetMurmurHash3; // uint32_t // WARNING - may read one more byte! @@ -149,7 +149,7 @@ inline u64 fmix64(u64 k) return k; } -u64 GetMurmurHash3(const u8 *src, u32 len, u32 samples) +u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) { const u8 * data = (const u8*)src; const int nblocks = len / 16; @@ -227,13 +227,13 @@ u64 GetMurmurHash3(const u8 *src, u32 len, u32 samples) // CRC32 hash using the SSE4.2 instruction -u64 GetCRC32(const u8 *src, u32 len, u32 samples) +u64 GetCRC32(const u8* src, u32 len, u32 samples) { #if _M_SSE >= 0x402 || defined(_M_ARM_64) u64 h[4] = { len, 0, 0, 0 }; u32 Step = (len / 8); - const u64 *data = (const u64 *)src; - const u64 *end = data + Step; + const u64* data = (const u64 *)src; + const u64* end = data + Step; if (samples == 0) samples = std::max(Step, 1u); Step = Step / samples; @@ -333,14 +333,14 @@ u64 GetCRC32(const u8 *src, u32 len, u32 samples) * changed, make sure this one is still used when the legacy parameter is * true. */ -u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples) +u64 GetHashHiresTexture(const u8* src, u32 len, u32 samples) { const u64 m = 0xc6a4a7935bd1e995; u64 h = len * m; const int r = 47; u32 Step = (len / 8); - const u64 *data = (const u64 *)src; - const u64 *end = data + Step; + const u64* data = (const u64 *)src; + const u64* end = data + Step; if (samples == 0) samples = std::max(Step, 1u); Step = Step / samples; @@ -379,13 +379,13 @@ u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples) } #else // CRC32 hash using the SSE4.2 instruction -u64 GetCRC32(const u8 *src, u32 len, u32 samples) +u64 GetCRC32(const u8* src, u32 len, u32 samples) { #if _M_SSE >= 0x402 u32 h = len; u32 Step = (len/4); - const u32 *data = (const u32 *)src; - const u32 *end = data + Step; + const u32* data = (const u32 *)src; + const u32* end = data + Step; if (samples == 0) samples = std::max(Step, 1u); Step = Step / samples; @@ -397,7 +397,7 @@ u64 GetCRC32(const u8 *src, u32 len, u32 samples) data += Step; } - const u8 *data2 = (const u8*)end; + const u8* data2 = (const u8*)end; return (u64)_mm_crc32_u32(h, u32(data2[0])); #else return 0; @@ -530,14 +530,14 @@ u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) * 64-bit version. Until someone can make a new version of the 32-bit one that * makes identical hashes, this is just a c/p of the 64-bit one. */ -u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples) +u64 GetHashHiresTexture(const u8* src, u32 len, u32 samples) { const u64 m = 0xc6a4a7935bd1e995ULL; u64 h = len * m; const int r = 47; u32 Step = (len / 8); - const u64 *data = (const u64 *)src; - const u64 *end = data + Step; + const u64* data = (const u64 *)src; + const u64* end = data + Step; if (samples == 0) samples = std::max(Step, 1u); Step = Step / samples; @@ -576,7 +576,7 @@ u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples) } #endif -u64 GetHash64(const u8 *src, u32 len, u32 samples) +u64 GetHash64(const u8* src, u32 len, u32 samples) { return ptrHashFunction(src, len, samples); } diff --git a/Source/Core/Common/Hash.h b/Source/Core/Common/Hash.h index ee89912e5d..ed644b99df 100644 --- a/Source/Core/Common/Hash.h +++ b/Source/Core/Common/Hash.h @@ -11,8 +11,8 @@ 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 u32 HashEctor(const u8* ptr, int length); // JUNK. DO NOT USE FOR NEW THINGS -u64 GetCRC32(const u8 *src, u32 len, u32 samples); // SSE4.2 version of CRC32 -u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples = 0); -u64 GetMurmurHash3(const u8 *src, u32 len, u32 samples); -u64 GetHash64(const u8 *src, u32 len, u32 samples); +u64 GetCRC32(const u8* src, u32 len, u32 samples); // SSE4.2 version of CRC32 +u64 GetHashHiresTexture(const u8* src, u32 len, u32 samples = 0); +u64 GetMurmurHash3(const u8* src, u32 len, u32 samples); +u64 GetHash64(const u8* src, u32 len, u32 samples); void SetHash64Function(); diff --git a/Source/Core/Common/LinearDiskCache.h b/Source/Core/Common/LinearDiskCache.h index 0493054e69..c8b0a220b4 100644 --- a/Source/Core/Common/LinearDiskCache.h +++ b/Source/Core/Common/LinearDiskCache.h @@ -31,7 +31,7 @@ template class LinearDiskCacheReader { public: - virtual void Read(const K &key, const V *value, u32 value_size) = 0; + virtual void Read(const K &key, const V* value, u32 value_size) = 0; }; // Dead simple unsorted key-value store with append functionality. @@ -82,7 +82,7 @@ public: // good header, read some key/value pairs K key; - V *value = nullptr; + V* value = nullptr; u32 value_size = 0; u32 entry_number = 0; @@ -142,7 +142,7 @@ public: } // Appends a key-value pair to the store. - void Append(const K &key, const V *value, u32 value_size) + void Append(const K &key, const V* value, u32 value_size) { // TODO: Should do a check that we don't already have "key"? (I think each caller does that already.) Write(&value_size); @@ -167,13 +167,13 @@ private: } template - bool Write(const D *data, u32 count = 1) + bool Write(const D* data, u32 count = 1) { return m_file.write((const char*)data, count * sizeof(D)).good(); } template - bool Read(const D *data, u32 count = 1) + bool Read(const D* data, u32 count = 1) { return m_file.read((char*)data, count * sizeof(D)).good(); } diff --git a/Source/Core/Common/Logging/LogManager.h b/Source/Core/Common/Logging/LogManager.h index 7bfcccf13f..a81784bba1 100644 --- a/Source/Core/Common/Logging/LogManager.h +++ b/Source/Core/Common/Logging/LogManager.h @@ -95,7 +95,7 @@ class LogManager : NonCopyable { private: LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS]; - static LogManager *m_logManager; // Singleton. Ugh. + static LogManager* m_logManager; // Singleton. Ugh. std::array m_listeners; LogManager(); @@ -132,7 +132,7 @@ public: return m_Log[type]->GetFullName(); } - void RegisterListener(LogListener::LISTENER id, LogListener *listener) + void RegisterListener(LogListener::LISTENER id, LogListener* listener) { m_listeners[id] = listener; } @@ -152,7 +152,7 @@ public: return m_logManager; } - static void SetInstance(LogManager *logManager) + static void SetInstance(LogManager* logManager) { m_logManager = logManager; } diff --git a/Source/Core/Common/MathUtil.cpp b/Source/Core/Common/MathUtil.cpp index b2f8714698..d134ee6dde 100644 --- a/Source/Core/Common/MathUtil.cpp +++ b/Source/Core/Common/MathUtil.cpp @@ -243,7 +243,7 @@ double ApproximateReciprocal(double val) } // namespace -inline void MatrixMul(int n, const float *a, const float *b, float *result) +inline void MatrixMul(int n, const float* a, const float* b, float* result) { for (int i = 0; i < n; ++i) { diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp index 9d03227f71..008b49de0c 100644 --- a/Source/Core/Common/MemArena.cpp +++ b/Source/Core/Common/MemArena.cpp @@ -95,12 +95,12 @@ void MemArena::ReleaseSHMSegment() } -void *MemArena::CreateView(s64 offset, size_t size, void *base) +void* MemArena::CreateView(s64 offset, size_t size, void* base) { #ifdef _WIN32 return MapViewOfFileEx(hMemoryMapping, FILE_MAP_ALL_ACCESS, 0, (DWORD)((u64)offset), size, base); #else - void *retval = mmap( + void* retval = mmap( base, size, PROT_READ | PROT_WRITE, MAP_SHARED | ((base == nullptr) ? 0 : MAP_FIXED), @@ -172,7 +172,7 @@ u8* MemArena::FindMemoryBase() if (!(a_flags & MV_FAKE_VMEM) && (b_flags & MV_FAKE_VMEM)) \ continue; \ -static bool Memory_TryBase(u8 *base, MemoryView *views, int num_views, u32 flags, MemArena *arena) +static bool Memory_TryBase(u8* base, MemoryView* views, int num_views, u32 flags, MemArena* arena) { // OK, we know where to find free space. Now grab it! // We just mimic the popular BAT setup. @@ -223,7 +223,7 @@ static bool Memory_TryBase(u8 *base, MemoryView *views, int num_views, u32 flags return true; } -static u32 MemoryMap_InitializeViews(MemoryView *views, int num_views, u32 flags) +static u32 MemoryMap_InitializeViews(MemoryView* views, int num_views, u32 flags) { u32 shm_position = 0; u32 last_position = 0; @@ -245,14 +245,14 @@ static u32 MemoryMap_InitializeViews(MemoryView *views, int num_views, u32 flags return shm_position; } -u8 *MemoryMap_Setup(MemoryView *views, int num_views, u32 flags, MemArena *arena) +u8* MemoryMap_Setup(MemoryView* views, int num_views, u32 flags, MemArena* arena) { u32 total_mem = MemoryMap_InitializeViews(views, num_views, flags); arena->GrabSHMSegment(total_mem); // Now, create views in high memory where there's plenty of space. - u8 *base = MemArena::FindMemoryBase(); + u8* base = MemArena::FindMemoryBase(); // This really shouldn't fail - in 64-bit, there will always be enough // address space. if (!Memory_TryBase(base, views, num_views, flags, arena)) @@ -265,7 +265,7 @@ u8 *MemoryMap_Setup(MemoryView *views, int num_views, u32 flags, MemArena *arena return base; } -void MemoryMap_Shutdown(MemoryView *views, int num_views, u32 flags, MemArena *arena) +void MemoryMap_Shutdown(MemoryView* views, int num_views, u32 flags, MemArena* arena) { std::set freeset; for (int i = 0; i < num_views; i++) diff --git a/Source/Core/Common/MemArena.h b/Source/Core/Common/MemArena.h index fdb7ee1616..2b1ecc7c29 100644 --- a/Source/Core/Common/MemArena.h +++ b/Source/Core/Common/MemArena.h @@ -21,11 +21,11 @@ class MemArena public: void GrabSHMSegment(size_t size); void ReleaseSHMSegment(); - void *CreateView(s64 offset, size_t size, void *base = nullptr); - void ReleaseView(void *view, size_t size); + void* CreateView(s64 offset, size_t size, void* base = nullptr); + void ReleaseView(void* view, size_t size); // This finds 1 GB in 32-bit, 16 GB in 64-bit. - static u8 *FindMemoryBase(); + static u8* FindMemoryBase(); private: #ifdef _WIN32 @@ -54,5 +54,5 @@ struct MemoryView // Uses a memory arena to set up an emulator-friendly memory map according to // a passed-in list of MemoryView structures. -u8 *MemoryMap_Setup(MemoryView *views, int num_views, u32 flags, MemArena *arena); -void MemoryMap_Shutdown(MemoryView *views, int num_views, u32 flags, MemArena *arena); +u8* MemoryMap_Setup(MemoryView* views, int num_views, u32 flags, MemArena* arena); +void MemoryMap_Shutdown(MemoryView* views, int num_views, u32 flags, MemArena* arena); diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index cfbda9795e..342ab9e03a 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -62,7 +62,7 @@ const std::string SettingsHandler::GetValue(const std::string& key) void SettingsHandler::Decrypt() { - const u8 *str = m_buffer; + const u8* str = m_buffer; while (*str != 0) { if (m_position >= SETTINGS_SIZE) @@ -113,7 +113,7 @@ void SettingsHandler::WriteByte(u8 b) const std::string SettingsHandler::generateSerialNumber() { time_t rawtime; - tm *timeinfo; + tm* timeinfo; char buffer[12]; char serialNumber[12]; diff --git a/Source/Core/Common/SettingsHandler.h b/Source/Core/Common/SettingsHandler.h index e1da1ea992..5c485d8828 100644 --- a/Source/Core/Common/SettingsHandler.h +++ b/Source/Core/Common/SettingsHandler.h @@ -24,7 +24,7 @@ public: void AddSetting(const std::string& key, const std::string& value); - const u8 *GetData() const; + const u8* GetData() const; const std::string GetValue(const std::string& key); void Decrypt(); diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index afc63ca2f4..bb8ec8887c 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -145,7 +145,7 @@ std::string StringFromFormatV(const char* format, va_list args) } // For Debugging. Read out an u8 array. -std::string ArrayToString(const u8 *data, u32 size, int line_len, bool spaces) +std::string ArrayToString(const u8* data, u32 size, int line_len, bool spaces) { std::ostringstream oss; oss << std::setfill('0') << std::hex; @@ -188,7 +188,7 @@ std::string StripQuotes(const std::string& s) return s; } -bool TryParse(const std::string &str, u32 *const output) +bool TryParse(const std::string &str, u32* const output) { char* endptr = nullptr; @@ -213,7 +213,7 @@ bool TryParse(const std::string &str, u32 *const output) return true; } -bool TryParse(const std::string &str, bool *const output) +bool TryParse(const std::string &str, bool* const output) { if ("1" == str || !strcasecmp("true", str.c_str())) *output = true; diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index 2516561a5a..d90aa6d024 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -36,7 +36,7 @@ inline void CharArrayFromFormat(char (& out)[Count], const char* format, ...) } // Good -std::string ArrayToString(const u8 *data, u32 size, int line_len = 20, bool spaces = true); +std::string ArrayToString(const u8* data, u32 size, int line_len = 20, bool spaces = true); std::string StripSpaces(const std::string &s); std::string StripQuotes(const std::string &s); @@ -59,11 +59,11 @@ std::string ThousandSeparate(I value, int spaces = 0) std::string StringFromInt(int value); std::string StringFromBool(bool value); -bool TryParse(const std::string &str, bool *output); -bool TryParse(const std::string &str, u32 *output); +bool TryParse(const std::string &str, bool* output); +bool TryParse(const std::string &str, u32* output); template -static bool TryParse(const std::string &str, N *const output) +static bool TryParse(const std::string &str, N* const output) { std::istringstream iss(str); // is this right? not doing this breaks reading floats on locales that use different decimal separators diff --git a/Source/Core/Common/SymbolDB.h b/Source/Core/Common/SymbolDB.h index 29ae57e2ce..991dc9e278 100644 --- a/Source/Core/Common/SymbolDB.h +++ b/Source/Core/Common/SymbolDB.h @@ -79,8 +79,8 @@ protected: public: SymbolDB() {} virtual ~SymbolDB() {} - virtual Symbol *GetSymbolFromAddr(u32 addr) { return nullptr; } - virtual Symbol *AddFunction(u32 startAddr) { return nullptr; } + virtual Symbol* GetSymbolFromAddr(u32 addr) { return nullptr; } + virtual Symbol* AddFunction(u32 startAddr) { return nullptr; } void AddCompleteSymbol(const Symbol &symbol); diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 7fe267cadf..67602a541e 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -81,7 +81,7 @@ bool SysConf::LoadFromFile(const std::string& filename) return false; } -bool SysConf::LoadFromFileInternal(FILE *fh) +bool SysConf::LoadFromFileInternal(FILE* fh) { File::IOFile f(fh); // Fill in infos diff --git a/Source/Core/Common/SysConf.h b/Source/Core/Common/SysConf.h index 639a8b0eda..aae706f79d 100644 --- a/Source/Core/Common/SysConf.h +++ b/Source/Core/Common/SysConf.h @@ -173,7 +173,7 @@ public: void UpdateLocation(); private: - bool LoadFromFileInternal(FILE *fh); + bool LoadFromFileInternal(FILE* fh); void GenerateSysConf(); void Clear(); diff --git a/Source/Core/Common/ucrtFreadWorkaround.cpp b/Source/Core/Common/ucrtFreadWorkaround.cpp index cecab2b4ff..ea4baa2970 100644 --- a/Source/Core/Common/ucrtFreadWorkaround.cpp +++ b/Source/Core/Common/ucrtFreadWorkaround.cpp @@ -8,7 +8,7 @@ #include struct PatchInfo { - const wchar_t *module_name; + const wchar_t* module_name; u32 checksum; u32 rva; u32 length; @@ -35,7 +35,7 @@ bool ApplyPatch(const PatchInfo &patch) { return false; } - void *patch_addr = (void *)((uintptr_t)module + patch.rva); + void* patch_addr = (void *)((uintptr_t)module + patch.rva); size_t patch_size = patch.length; DWORD old_protect; diff --git a/Source/Core/Common/x64ABI.cpp b/Source/Core/Common/x64ABI.cpp index 493cd13876..ca76c80a01 100644 --- a/Source/Core/Common/x64ABI.cpp +++ b/Source/Core/Common/x64ABI.cpp @@ -81,7 +81,7 @@ void XEmitter::ABI_PopRegistersAndAdjustStack(BitSet32 mask, size_t rsp_alignmen } // Common functions -void XEmitter::ABI_CallFunction(const void *func) +void XEmitter::ABI_CallFunction(const void* func) { u64 distance = u64(func) - (u64(code) + 5); if (distance >= 0x0000000080000000ULL && @@ -97,40 +97,40 @@ void XEmitter::ABI_CallFunction(const void *func) } } -void XEmitter::ABI_CallFunctionC16(const void *func, u16 param1) +void XEmitter::ABI_CallFunctionC16(const void* func, u16 param1) { MOV(32, R(ABI_PARAM1), Imm32((u32)param1)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCC16(const void *func, u32 param1, u16 param2) +void XEmitter::ABI_CallFunctionCC16(const void* func, u32 param1, u16 param2) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(32, R(ABI_PARAM2), Imm32((u32)param2)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionC(const void *func, u32 param1) +void XEmitter::ABI_CallFunctionC(const void* func, u32 param1) { MOV(32, R(ABI_PARAM1), Imm32(param1)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCC(const void *func, u32 param1, u32 param2) +void XEmitter::ABI_CallFunctionCC(const void* func, u32 param1, u32 param2) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(32, R(ABI_PARAM2), Imm32(param2)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCP(const void *func, u32 param1, void *param2) +void XEmitter::ABI_CallFunctionCP(const void* func, u32 param1, void* param2) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(64, R(ABI_PARAM2), Imm64((u64)param2)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCCC(const void *func, u32 param1, u32 param2, u32 param3) +void XEmitter::ABI_CallFunctionCCC(const void* func, u32 param1, u32 param2, u32 param3) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(32, R(ABI_PARAM2), Imm32(param2)); @@ -138,7 +138,7 @@ void XEmitter::ABI_CallFunctionCCC(const void *func, u32 param1, u32 param2, u32 ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCCP(const void *func, u32 param1, u32 param2, void *param3) +void XEmitter::ABI_CallFunctionCCP(const void* func, u32 param1, u32 param2, void* param3) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(32, R(ABI_PARAM2), Imm32(param2)); @@ -146,7 +146,7 @@ void XEmitter::ABI_CallFunctionCCP(const void *func, u32 param1, u32 param2, voi ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionCCCP(const void *func, u32 param1, u32 param2, u32 param3, void *param4) +void XEmitter::ABI_CallFunctionCCCP(const void* func, u32 param1, u32 param2, u32 param3, void* param4) { MOV(32, R(ABI_PARAM1), Imm32(param1)); MOV(32, R(ABI_PARAM2), Imm32(param2)); @@ -155,14 +155,14 @@ void XEmitter::ABI_CallFunctionCCCP(const void *func, u32 param1, u32 param2, u3 ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionPC(const void *func, void *param1, u32 param2) +void XEmitter::ABI_CallFunctionPC(const void* func, void* param1, u32 param2) { MOV(64, R(ABI_PARAM1), Imm64((u64)param1)); MOV(32, R(ABI_PARAM2), Imm32(param2)); ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionPPC(const void *func, void *param1, void *param2, u32 param3) +void XEmitter::ABI_CallFunctionPPC(const void* func, void* param1, void* param2, u32 param3) { MOV(64, R(ABI_PARAM1), Imm64((u64)param1)); MOV(64, R(ABI_PARAM2), Imm64((u64)param2)); @@ -171,7 +171,7 @@ void XEmitter::ABI_CallFunctionPPC(const void *func, void *param1, void *param2, } // Pass a register as a parameter. -void XEmitter::ABI_CallFunctionR(const void *func, X64Reg reg1) +void XEmitter::ABI_CallFunctionR(const void* func, X64Reg reg1) { if (reg1 != ABI_PARAM1) MOV(32, R(ABI_PARAM1), R(reg1)); @@ -179,7 +179,7 @@ void XEmitter::ABI_CallFunctionR(const void *func, X64Reg reg1) } // Pass two registers as parameters. -void XEmitter::ABI_CallFunctionRR(const void *func, X64Reg reg1, X64Reg reg2) +void XEmitter::ABI_CallFunctionRR(const void* func, X64Reg reg1, X64Reg reg2) { MOVTwo(64, ABI_PARAM1, reg1, 0, ABI_PARAM2, reg2); ABI_CallFunction(func); @@ -217,7 +217,7 @@ void XEmitter::MOVTwo(int bits, Gen::X64Reg dst1, Gen::X64Reg src1, s32 offset1, } } -void XEmitter::ABI_CallFunctionAC(int bits, const void *func, const Gen::OpArg &arg1, u32 param2) +void XEmitter::ABI_CallFunctionAC(int bits, const void* func, const Gen::OpArg &arg1, u32 param2) { if (!arg1.IsSimpleReg(ABI_PARAM1)) MOV(bits, R(ABI_PARAM1), arg1); @@ -225,7 +225,7 @@ void XEmitter::ABI_CallFunctionAC(int bits, const void *func, const Gen::OpArg & ABI_CallFunction(func); } -void XEmitter::ABI_CallFunctionA(int bits, const void *func, const Gen::OpArg &arg1) +void XEmitter::ABI_CallFunctionA(int bits, const void* func, const Gen::OpArg &arg1) { if (!arg1.IsSimpleReg(ABI_PARAM1)) MOV(bits, R(ABI_PARAM1), arg1); diff --git a/Source/Core/Common/x64Analyzer.cpp b/Source/Core/Common/x64Analyzer.cpp index 0514bda0c4..51377f41fa 100644 --- a/Source/Core/Common/x64Analyzer.cpp +++ b/Source/Core/Common/x64Analyzer.cpp @@ -4,7 +4,7 @@ #include "Common/x64Analyzer.h" -bool DisassembleMov(const unsigned char* codePtr, InstructionInfo *info) +bool DisassembleMov(const unsigned char* codePtr, InstructionInfo* info) { unsigned const char* startCodePtr = codePtr; u8 rex = 0; diff --git a/Source/Core/Common/x64Analyzer.h b/Source/Core/Common/x64Analyzer.h index 2b7db9e2d9..827a3e9807 100644 --- a/Source/Core/Common/x64Analyzer.h +++ b/Source/Core/Common/x64Analyzer.h @@ -41,4 +41,4 @@ enum AccessType OP_ACCESS_WRITE = 1 }; -bool DisassembleMov(const unsigned char* codePtr, InstructionInfo *info); +bool DisassembleMov(const unsigned char* codePtr, InstructionInfo* info);