diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 6546686716..2c2ede99ea 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) { @@ -60,7 +60,7 @@ bool IsImmArithmetic(uint64_t input, u32 *val, bool *shift) return false; } -bool IsImmLogical(uint64_t value, unsigned int width, unsigned int *n, unsigned int *imm_s, unsigned int *imm_r) +bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned int* imm_s, unsigned int* imm_r) { //DCHECK((n != NULL) && (imm_s != NULL) && (imm_r != NULL)); // DCHECK((width == kWRegSizeInBits) || (width == kXRegSizeInBits)); @@ -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 @@ -1097,7 +1097,7 @@ void ARM64XEmitter::_MSR(PStateField field, u8 imm) EncodeSystemInst(0, op1, 4, imm, op2, WSP); } -static void GetSystemReg(PStateField field, int &o0, int &op1, int &CRn, int &CRm, int &op2) +static void GetSystemReg(PStateField field, int& o0, int& op1, int& CRn, int& CRm, int& op2) { switch (field) { @@ -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 400a87a624..9041cd32bb 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -96,12 +96,12 @@ constexpr ARM64Reg EncodeRegToDouble(ARM64Reg reg) { return static_cast(reg | 0xC0); } // For AND/TST/ORR/EOR etc -bool IsImmLogical(uint64_t value, unsigned int width, unsigned int *n, unsigned int *imm_s, unsigned int *imm_r); +bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned int* imm_s, unsigned int* imm_r); // For ADD/SUB -bool IsImmArithmetic(uint64_t input, u32 *val, bool *shift); +bool IsImmArithmetic(uint64_t input, u32* val, bool* shift); float FPImm8ToFloat(uint8_t bits); -bool FPImm8FromFloat(float value, uint8_t *immOut); +bool FPImm8FromFloat(float value, uint8_t* immOut); enum OpType { @@ -677,7 +677,7 @@ public: // Wrapper around MOVZ+MOVK void MOVI2R(ARM64Reg Rd, u64 imm, bool optimize = true); template - 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,10 +730,10 @@ 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); + 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/CDUtils.cpp b/Source/Core/Common/CDUtils.cpp index 73005c4e63..9ea5c23a1f 100644 --- a/Source/Core/Common/CDUtils.cpp +++ b/Source/Core/Common/CDUtils.cpp @@ -136,7 +136,7 @@ std::vector cdio_get_devices() // checklist: /dev/cdrom, /dev/dvd /dev/hd?, /dev/scd? /dev/sr? static struct { - const char * format; + const char* format; unsigned int num_min; unsigned int num_max; } checklist[] = @@ -166,7 +166,7 @@ static bool is_device(const std::string& source_name) } // Check a device to see if it is a DVD/CD-ROM drive -static bool is_cdrom(const std::string& drive, char *mnttype) +static bool is_cdrom(const std::string& drive, char* mnttype) { // Check if the device exists if (!is_device(drive)) @@ -213,7 +213,7 @@ bool cdio_is_cdrom(std::string device) // Resolve symbolic links. This allows symbolic links to valid // drives to be passed from the command line with the -e flag. char resolved_path[MAX_PATH]; - char *devname = realpath(device.c_str(), resolved_path); + char* devname = realpath(device.c_str(), resolved_path); if (!devname) return false; device = devname; 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/Common.h b/Source/Core/Common/Common.h index 55bf530143..1e01854cb1 100644 --- a/Source/Core/Common/Common.h +++ b/Source/Core/Common/Common.h @@ -9,11 +9,11 @@ #include // Git version number -extern const char *scm_desc_str; -extern const char *scm_branch_str; -extern const char *scm_rev_str; -extern const char *scm_rev_git_str; -extern const char *netplay_dolphin_ver; +extern const char* scm_desc_str; +extern const char* scm_branch_str; +extern const char* scm_rev_str; +extern const char* scm_rev_git_str; +extern const char* netplay_dolphin_ver; // Force enable logging in the right modes. For some reason, something had changed // so that debugfast no longer logged. 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/DebugInterface.h b/Source/Core/Common/DebugInterface.h index b64df6ce46..9ba89dfb06 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -14,7 +14,7 @@ protected: public: virtual std::string Disassemble(unsigned int /*address*/) { return "NODEBUGGER"; } - virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char *dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");} + virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char* dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");} virtual int GetInstructionSize(int /*instruction*/) {return 1;} virtual bool IsAlive() {return true;} virtual bool IsBreakpoint(unsigned int /*address*/) {return false;} 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 6857262579..5084bf545b 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -58,7 +58,7 @@ namespace File // Remove any ending forward slashes from directory paths // Modifies argument. -static void StripTailDirSlashes(std::string &fname) +static void StripTailDirSlashes(std::string& fname) { if (fname.length() > 1) { @@ -68,7 +68,7 @@ static void StripTailDirSlashes(std::string &fname) } // Returns true if file filename exists -bool Exists(const std::string &filename) +bool Exists(const std::string& filename) { struct stat64 file_info; @@ -85,7 +85,7 @@ bool Exists(const std::string &filename) } // Returns true if filename is a directory -bool IsDirectory(const std::string &filename) +bool IsDirectory(const std::string& filename) { struct stat64 file_info; @@ -110,7 +110,7 @@ bool IsDirectory(const std::string &filename) // Deletes a given filename, return true on success // Doesn't supports deleting a directory -bool Delete(const std::string &filename) +bool Delete(const std::string& filename) { INFO_LOG(COMMON, "Delete: file %s", filename.c_str()); @@ -149,7 +149,7 @@ bool Delete(const std::string &filename) } // Returns true if successful, or path already exists. -bool CreateDir(const std::string &path) +bool CreateDir(const std::string& path) { INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str()); #ifdef _WIN32 @@ -181,7 +181,7 @@ bool CreateDir(const std::string &path) } // Creates the full path of fullPath returns true on success -bool CreateFullPath(const std::string &fullPath) +bool CreateFullPath(const std::string& fullPath) { int panicCounter = 100; INFO_LOG(COMMON, "CreateFullPath: path %s", fullPath.c_str()); @@ -220,7 +220,7 @@ bool CreateFullPath(const std::string &fullPath) // Deletes a directory filename, returns true on success -bool DeleteDir(const std::string &filename) +bool DeleteDir(const std::string& filename) { INFO_LOG(COMMON, "DeleteDir: directory %s", filename.c_str()); @@ -244,7 +244,7 @@ bool DeleteDir(const std::string &filename) } // renames file srcFilename to destFilename, returns true on success -bool Rename(const std::string &srcFilename, const std::string &destFilename) +bool Rename(const std::string& srcFilename, const std::string& destFilename) { INFO_LOG(COMMON, "Rename: %s --> %s", srcFilename.c_str(), destFilename.c_str()); @@ -271,7 +271,7 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename) } #ifndef _WIN32 -static void FSyncPath(const char *path) +static void FSyncPath(const char* path) { int fd = open(path, O_RDONLY); if (fd != -1) @@ -282,7 +282,7 @@ static void FSyncPath(const char *path) } #endif -bool RenameSync(const std::string &srcFilename, const std::string &destFilename) +bool RenameSync(const std::string& srcFilename, const std::string& destFilename) { if (!Rename(srcFilename, destFilename)) return false; @@ -294,7 +294,7 @@ bool RenameSync(const std::string &srcFilename, const std::string &destFilename) close(fd); } #else - char *path = strdup(srcFilename.c_str()); + char* path = strdup(srcFilename.c_str()); FSyncPath(path); FSyncPath(dirname(path)); free(path); @@ -306,7 +306,7 @@ bool RenameSync(const std::string &srcFilename, const std::string &destFilename) } // copies file srcFilename to destFilename, returns true on success -bool Copy(const std::string &srcFilename, const std::string &destFilename) +bool Copy(const std::string& srcFilename, const std::string& destFilename) { INFO_LOG(COMMON, "Copy: %s --> %s", srcFilename.c_str(), destFilename.c_str()); @@ -372,7 +372,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename) } // Returns the size of filename (64bit) -u64 GetSize(const std::string &filename) +u64 GetSize(const std::string& filename) { if (!Exists(filename)) { @@ -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); @@ -440,7 +440,7 @@ u64 GetSize(FILE *f) } // creates an empty file filename, returns true on success -bool CreateEmptyFile(const std::string &filename) +bool CreateEmptyFile(const std::string& filename) { INFO_LOG(COMMON, "CreateEmptyFile: %s", filename.c_str()); @@ -457,7 +457,7 @@ bool CreateEmptyFile(const std::string &filename) // Scans the directory tree gets, starting from _Directory and adds the // results into parentEntry. Returns the number of files+directories found -FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive) +FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive) { INFO_LOG(COMMON, "ScanDirectoryTree: directory %s", directory.c_str()); // How many files + directories we found @@ -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; @@ -527,7 +527,7 @@ FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive) // Deletes the given directory and anything under it. Returns true on success. -bool DeleteDirRecursively(const std::string &directory) +bool DeleteDirRecursively(const std::string& directory) { INFO_LOG(COMMON, "DeleteDirRecursively: %s", directory.c_str()); #ifdef _WIN32 @@ -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; @@ -600,7 +600,7 @@ bool DeleteDirRecursively(const std::string &directory) } // Create directory and copy contents (does not overwrite existing files) -void CopyDir(const std::string &source_path, const std::string &dest_path) +void CopyDir(const std::string& source_path, const std::string& dest_path) { if (source_path == dest_path) return; if (!File::Exists(source_path)) return; @@ -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) @@ -652,7 +652,7 @@ void CopyDir(const std::string &source_path, const std::string &dest_path) // Returns the current directory std::string GetCurrentDir() { - char *dir; + char* dir; // Get the current working directory (getcwd uses malloc) if (!(dir = __getcwd(nullptr, 0))) { @@ -666,7 +666,7 @@ std::string GetCurrentDir() } // Sets the current directory to the given directory -bool SetCurrentDir(const std::string &directory) +bool SetCurrentDir(const std::string& directory) { return __chdir(directory.c_str()) == 0; } @@ -697,7 +697,7 @@ std::string CreateTempDir() #endif } -std::string GetTempFilenameForAtomicWrite(const std::string &path) +std::string GetTempFilenameForAtomicWrite(const std::string& path) { std::string abs = path; #ifdef _WIN32 @@ -883,12 +883,12 @@ std::string GetThemeDir(const std::string& theme_name) return dir; } -bool WriteStringToFile(const std::string &str, const std::string& filename) +bool WriteStringToFile(const std::string& str, const std::string& filename) { return File::IOFile(filename, "wb").WriteBytes(str.data(), str.size()); } -bool ReadFileToString(const std::string& filename, std::string &str) +bool ReadFileToString(const std::string& filename, std::string& str) { File::IOFile file(filename, "rb"); auto const f = file.GetHandle(); diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index 9ed318d1c9..fcc3c20269 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -70,65 +70,65 @@ struct FSTEntry }; // Returns true if file filename exists -bool Exists(const std::string &filename); +bool Exists(const std::string& filename); // Returns true if filename is a directory -bool IsDirectory(const std::string &filename); +bool IsDirectory(const std::string& filename); // Returns the size of filename (64bit) -u64 GetSize(const std::string &filename); +u64 GetSize(const std::string& filename); // Overloaded GetSize, accepts file descriptor 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); +bool CreateDir(const std::string& filename); // Creates the full path of fullPath returns true on success -bool CreateFullPath(const std::string &fullPath); +bool CreateFullPath(const std::string& fullPath); // Deletes a given filename, return true on success // Doesn't supports deleting a directory -bool Delete(const std::string &filename); +bool Delete(const std::string& filename); // Deletes a directory filename, returns true on success -bool DeleteDir(const std::string &filename); +bool DeleteDir(const std::string& filename); // renames file srcFilename to destFilename, returns true on success -bool Rename(const std::string &srcFilename, const std::string &destFilename); +bool Rename(const std::string& srcFilename, const std::string& destFilename); // ditto, but syncs the source file and, on Unix, syncs the directories after rename -bool RenameSync(const std::string &srcFilename, const std::string &destFilename); +bool RenameSync(const std::string& srcFilename, const std::string& destFilename); // copies file srcFilename to destFilename, returns true on success -bool Copy(const std::string &srcFilename, const std::string &destFilename); +bool Copy(const std::string& srcFilename, const std::string& destFilename); // creates an empty file filename, returns true on success -bool CreateEmptyFile(const std::string &filename); +bool CreateEmptyFile(const std::string& filename); // Recursive or non-recursive list of files under directory. -FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive); +FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive); // deletes the given directory and anything under it. Returns true on success. -bool DeleteDirRecursively(const std::string &directory); +bool DeleteDirRecursively(const std::string& directory); // Returns the current directory std::string GetCurrentDir(); // Create directory and copy contents (does not overwrite existing files) -void CopyDir(const std::string &source_path, const std::string &dest_path); +void CopyDir(const std::string& source_path, const std::string& dest_path); // Set the current directory to given directory -bool SetCurrentDir(const std::string &directory); +bool SetCurrentDir(const std::string& directory); // Creates and returns the path to a new temporary directory. std::string CreateTempDir(); // Get a filename that can hopefully be atomically renamed to the given path. -std::string GetTempFilenameForAtomicWrite(const std::string &path); +std::string GetTempFilenameForAtomicWrite(const std::string& path); // Gets a set user directory path // Don't call prior to setting the base user directory @@ -148,7 +148,7 @@ std::string GetSysDirectory(); std::string GetBundleDirectory(); #endif -std::string &GetExeDirectory(); +std::string& GetExeDirectory(); bool WriteStringToFile(const std::string& str, const std::string& filename); bool ReadFileToString(const std::string& filename, std::string& str); diff --git a/Source/Core/Common/FixedSizeQueue.h b/Source/Core/Common/FixedSizeQueue.h index 9918aed4d1..6543c1698a 100644 --- a/Source/Core/Common/FixedSizeQueue.h +++ b/Source/Core/Common/FixedSizeQueue.h @@ -16,13 +16,13 @@ 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. // Make copy constructor private for now. - FixedSizeQueue(FixedSizeQueue &other) {} + FixedSizeQueue(FixedSizeQueue& other) {} public: FixedSizeQueue() @@ -62,13 +62,13 @@ public: T pop_front() { - const T &temp = storage[head]; + const T& temp = storage[head]; pop(); return temp; } - T &front() { return storage[head]; } - const T &front() const { return storage[head]; } + T& front() { return storage[head]; } + const T& front() const { return storage[head]; } size_t size() const { diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index b0d3069525..da0e09978c 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! @@ -104,7 +104,7 @@ u32 HashEctor(const u8* ptr, int length) // Block read - if your platform needs to do endian-swapping or can only // handle aligned reads, do the conversion here -inline u64 getblock(const u64 * p, int i) +inline u64 getblock(const u64* p, int i) { return p[i]; } @@ -149,9 +149,9 @@ 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 u8* data = (const u8*)src; const int nblocks = len / 16; u32 Step = (len / 8); if (samples == 0) @@ -170,7 +170,7 @@ u64 GetMurmurHash3(const u8 *src, u32 len, u32 samples) //---------- // body - const u64 * blocks = (const u64 *)(data); + const u64* blocks = (const u64*)(data); for (int i = 0; i < nblocks; i+=Step) { @@ -183,7 +183,7 @@ u64 GetMurmurHash3(const u8 *src, u32 len, u32 samples) //---------- // tail - const u8 * tail = (const u8*)(data + nblocks*16); + const u8* tail = (const u8*)(data + nblocks*16); u64 k1 = 0; u64 k2 = 0; @@ -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; @@ -408,7 +408,7 @@ u64 GetCRC32(const u8 *src, u32 len, u32 samples) // Block read - if your platform needs to do endian-swapping or can only // handle aligned reads, do the conversion here -inline u32 getblock(const u32 * p, int i) +inline u32 getblock(const u32* p, int i) { return p[i]; } @@ -456,7 +456,7 @@ inline void bmix32(u32 & h1, u32 & h2, u32 & k1, u32 & k2, u32 & c1, u32 & c2) u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) { - const u8 * data = (const u8*)src; + const u8* data = (const u8*)src; u32 out[2]; const int nblocks = len / 8; u32 Step = (len / 4); @@ -475,7 +475,7 @@ u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) //---------- // body - const u32 * blocks = (const u32 *)(data + nblocks*8); + const u32* blocks = (const u32*)(data + nblocks*8); for (int i = -nblocks; i < 0; i+=Step) { @@ -488,7 +488,7 @@ u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) //---------- // tail - const u8 * tail = (const u8*)(data + nblocks*8); + const u8* tail = (const u8*)(data + nblocks*8); u32 k1 = 0; u32 k2 = 0; @@ -522,7 +522,7 @@ u64 GetMurmurHash3(const u8* src, u32 len, u32 samples) out[0] = h1; out[1] = h2; - return *((u64 *)&out); + return *((u64*)&out); } /* @@ -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; @@ -554,7 +554,7 @@ u64 GetHashHiresTexture(const u8 *src, u32 len, u32 samples) h *= m; } - const u8 * data2 = (const u8*)end; + const u8* data2 = (const u8*)end; switch (len & 7) { @@ -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..c0f0f4ef76 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/ConsoleListener.h b/Source/Core/Common/Logging/ConsoleListener.h index acf12a5170..06b34cdf8f 100644 --- a/Source/Core/Common/Logging/ConsoleListener.h +++ b/Source/Core/Common/Logging/ConsoleListener.h @@ -12,7 +12,7 @@ public: ConsoleListener(); ~ConsoleListener(); - void Log(LogTypes::LOG_LEVELS, const char *text) override; + void Log(LogTypes::LOG_LEVELS, const char* text) override; private: bool m_use_color; diff --git a/Source/Core/Common/Logging/ConsoleListenerDroid.cpp b/Source/Core/Common/Logging/ConsoleListenerDroid.cpp index 1a37442756..9637200813 100644 --- a/Source/Core/Common/Logging/ConsoleListenerDroid.cpp +++ b/Source/Core/Common/Logging/ConsoleListenerDroid.cpp @@ -14,7 +14,7 @@ ConsoleListener::~ConsoleListener() { } -void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text) +void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char* text) { android_LogPriority logLevel = ANDROID_LOG_UNKNOWN; diff --git a/Source/Core/Common/Logging/ConsoleListenerNix.cpp b/Source/Core/Common/Logging/ConsoleListenerNix.cpp index a7505030be..4526bc82b6 100644 --- a/Source/Core/Common/Logging/ConsoleListenerNix.cpp +++ b/Source/Core/Common/Logging/ConsoleListenerNix.cpp @@ -22,7 +22,7 @@ ConsoleListener::~ConsoleListener() fflush(nullptr); } -void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text) +void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char* text) { char color_attr[16] = ""; char reset_attr[16] = ""; diff --git a/Source/Core/Common/Logging/ConsoleListenerWin.cpp b/Source/Core/Common/Logging/ConsoleListenerWin.cpp index aaa51b40ff..8b5eeaf573 100644 --- a/Source/Core/Common/Logging/ConsoleListenerWin.cpp +++ b/Source/Core/Common/Logging/ConsoleListenerWin.cpp @@ -14,7 +14,7 @@ ConsoleListener::~ConsoleListener() { } -void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text) +void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char* text) { ::OutputDebugStringA(text); } diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 24a4aa8884..7ed6ea7e63 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -73,7 +73,7 @@ static const char LOG_LEVEL_TO_CHAR[7] = "-NEWID"; } // namespace void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, - const char *file, int line, const char *fmt, ...) + const char* file, int line, const char* fmt, ...) #ifdef __GNUC__ __attribute__((format(printf, 5, 6))) #endif diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 06efc8419c..006a5f6ffc 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -18,7 +18,7 @@ #include "Common/Logging/LogManager.h" void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, - const char *file, int line, const char* fmt, ...) + const char* file, int line, const char* fmt, ...) { va_list args; va_start(args, fmt); @@ -28,7 +28,7 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, va_end(args); } -LogManager *LogManager::m_logManager = nullptr; +LogManager* LogManager::m_logManager = nullptr; LogManager::LogManager() { @@ -115,10 +115,10 @@ LogManager::~LogManager() } void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, - const char *file, int line, const char *format, va_list args) + const char* file, int line, const char* format, va_list args) { char temp[MAX_MSGLEN]; - LogContainer *log = m_Log[type]; + LogContainer* log = m_Log[type]; if (!log->IsEnabled() || level > log->GetLevel() || !log->HasListeners()) return; @@ -160,7 +160,7 @@ FileLogListener::FileLogListener(const std::string& filename) SetEnable(true); } -void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg) +void FileLogListener::Log(LogTypes::LOG_LEVELS, const char* msg) { if (!IsEnabled() || !IsValid()) return; diff --git a/Source/Core/Common/Logging/LogManager.h b/Source/Core/Common/Logging/LogManager.h index 5f806b2ad5..a81784bba1 100644 --- a/Source/Core/Common/Logging/LogManager.h +++ b/Source/Core/Common/Logging/LogManager.h @@ -24,7 +24,7 @@ class LogListener public: virtual ~LogListener() {} - virtual void Log(LogTypes::LOG_LEVELS, const char *msg) = 0; + virtual void Log(LogTypes::LOG_LEVELS, const char* msg) = 0; enum LISTENER { @@ -41,7 +41,7 @@ class FileLogListener : public LogListener public: FileLogListener(const std::string& filename); - void Log(LogTypes::LOG_LEVELS, const char *msg) override; + void Log(LogTypes::LOG_LEVELS, const char* msg) override; bool IsValid() const { return m_logfile.good(); } bool IsEnabled() const { return m_enable; } @@ -66,7 +66,7 @@ public: void AddListener(LogListener::LISTENER id) { m_listener_ids[id] = 1; } void RemoveListener(LogListener::LISTENER id) { m_listener_ids[id] = 0; } - void Trigger(LogTypes::LOG_LEVELS, const char *msg); + void Trigger(LogTypes::LOG_LEVELS, const char* msg); bool IsEnabled() const { return m_enable; } void SetEnable(bool enable) { m_enable = enable; } @@ -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(); @@ -105,7 +105,7 @@ public: static u32 GetMaxLevel() { return MAX_LOGLEVEL; } void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, - const char *file, int line, const char *fmt, va_list args); + const char* file, int line, const char* fmt, va_list args); void SetLogLevel(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level) { @@ -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..8eb3899ce3 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) { @@ -265,7 +265,7 @@ float MathFloatVectorSum(const std::vector& Vec) return std::accumulate(Vec.begin(), Vec.end(), 0.0f); } -void Matrix33::LoadIdentity(Matrix33 &mtx) +void Matrix33::LoadIdentity(Matrix33& mtx) { memset(mtx.data, 0, sizeof(mtx.data)); mtx.data[0] = 1.0f; @@ -273,7 +273,7 @@ void Matrix33::LoadIdentity(Matrix33 &mtx) mtx.data[8] = 1.0f; } -void Matrix33::RotateX(Matrix33 &mtx, float rad) +void Matrix33::RotateX(Matrix33& mtx, float rad) { float s = sin(rad); float c = cos(rad); @@ -284,7 +284,7 @@ void Matrix33::RotateX(Matrix33 &mtx, float rad) mtx.data[7] = s; mtx.data[8] = c; } -void Matrix33::RotateY(Matrix33 &mtx, float rad) +void Matrix33::RotateY(Matrix33& mtx, float rad) { float s = sin(rad); float c = cos(rad); @@ -296,12 +296,12 @@ void Matrix33::RotateY(Matrix33 &mtx, float rad) mtx.data[8] = c; } -void Matrix33::Multiply(const Matrix33 &a, const Matrix33 &b, Matrix33 &result) +void Matrix33::Multiply(const Matrix33& a, const Matrix33& b, Matrix33& result) { MatrixMul(3, a.data, b.data, result.data); } -void Matrix33::Multiply(const Matrix33 &a, const float vec[3], float result[3]) +void Matrix33::Multiply(const Matrix33& a, const float vec[3], float result[3]) { for (int i = 0; i < 3; ++i) { @@ -314,7 +314,7 @@ void Matrix33::Multiply(const Matrix33 &a, const float vec[3], float result[3]) } } -void Matrix44::LoadIdentity(Matrix44 &mtx) +void Matrix44::LoadIdentity(Matrix44& mtx) { memset(mtx.data, 0, sizeof(mtx.data)); mtx.data[0] = 1.0f; @@ -323,7 +323,7 @@ void Matrix44::LoadIdentity(Matrix44 &mtx) mtx.data[15] = 1.0f; } -void Matrix44::LoadMatrix33(Matrix44 &mtx, const Matrix33 &m33) +void Matrix44::LoadMatrix33(Matrix44& mtx, const Matrix33& m33) { for (int i = 0; i < 3; ++i) { @@ -341,7 +341,7 @@ void Matrix44::LoadMatrix33(Matrix44 &mtx, const Matrix33 &m33) mtx.data[15] = 1.0f; } -void Matrix44::Set(Matrix44 &mtx, const float mtxArray[16]) +void Matrix44::Set(Matrix44& mtx, const float mtxArray[16]) { for (int i = 0; i < 16; ++i) { @@ -349,7 +349,7 @@ void Matrix44::Set(Matrix44 &mtx, const float mtxArray[16]) } } -void Matrix44::Translate(Matrix44 &mtx, const float vec[3]) +void Matrix44::Translate(Matrix44& mtx, const float vec[3]) { LoadIdentity(mtx); mtx.data[3] = vec[0]; @@ -357,14 +357,14 @@ void Matrix44::Translate(Matrix44 &mtx, const float vec[3]) mtx.data[11] = vec[2]; } -void Matrix44::Shear(Matrix44 &mtx, const float a, const float b) +void Matrix44::Shear(Matrix44& mtx, const float a, const float b) { LoadIdentity(mtx); mtx.data[2] = a; mtx.data[6] = b; } -void Matrix44::Multiply(const Matrix44 &a, const Matrix44 &b, Matrix44 &result) +void Matrix44::Multiply(const Matrix44& a, const Matrix44& b, Matrix44& result) { MatrixMul(4, a.data, b.data, result.data); } diff --git a/Source/Core/Common/MathUtil.h b/Source/Core/Common/MathUtil.h index 968c865a3c..3ca5c1b770 100644 --- a/Source/Core/Common/MathUtil.h +++ b/Source/Core/Common/MathUtil.h @@ -192,16 +192,16 @@ inline int IntLog2(u64 val) class Matrix33 { public: - static void LoadIdentity(Matrix33 &mtx); + static void LoadIdentity(Matrix33& mtx); // set mtx to be a rotation matrix around the x axis - static void RotateX(Matrix33 &mtx, float rad); + static void RotateX(Matrix33& mtx, float rad); // set mtx to be a rotation matrix around the y axis - static void RotateY(Matrix33 &mtx, float rad); + static void RotateY(Matrix33& mtx, float rad); // set result = a x b - static void Multiply(const Matrix33 &a, const Matrix33 &b, Matrix33 &result); - static void Multiply(const Matrix33 &a, const float vec[3], float result[3]); + static void Multiply(const Matrix33& a, const Matrix33& b, Matrix33& result); + static void Multiply(const Matrix33& a, const float vec[3], float result[3]); float data[9]; }; @@ -209,14 +209,14 @@ public: class Matrix44 { public: - static void LoadIdentity(Matrix44 &mtx); - static void LoadMatrix33(Matrix44 &mtx, const Matrix33 &m33); - static void Set(Matrix44 &mtx, const float mtxArray[16]); + static void LoadIdentity(Matrix44& mtx); + static void LoadMatrix33(Matrix44& mtx, const Matrix33& m33); + static void Set(Matrix44& mtx, const float mtxArray[16]); - static void Translate(Matrix44 &mtx, const float vec[3]); - static void Shear(Matrix44 &mtx, const float a, const float b = 0); + static void Translate(Matrix44& mtx, const float vec[3]); + static void Shear(Matrix44& mtx, const float a, const float b = 0); - static void Multiply(const Matrix44 &a, const Matrix44 &b, Matrix44 &result); + static void Multiply(const Matrix44& a, const Matrix44& b, Matrix44& result); float data[16]; }; diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp index 1f8fa6a4ec..008b49de0c 100644 --- a/Source/Core/Common/MemArena.cpp +++ b/Source/Core/Common/MemArena.cpp @@ -30,7 +30,7 @@ #ifdef ANDROID #define ASHMEM_DEVICE "/dev/ashmem" -static int AshmemCreateFileMapping(const char *name, size_t size) +static int AshmemCreateFileMapping(const char* name, size_t size) { int fd, ret; fd = open(ASHMEM_DEVICE, O_RDWR); @@ -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/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index ea9ca7d625..946fcfaf4f 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -45,7 +45,7 @@ void* AllocateExecutableMemory(size_t size, bool low) #if defined(_WIN32) void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); #else - static char *map_hint = nullptr; + static char* map_hint = nullptr; #if defined(_M_X86_64) && !defined(MAP_32BIT) // This OS has no flag to enforce allocation below the 4 GB boundary, // but if we hint that we want a low address it is very likely we will diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp index 25488ef410..9c00448a6a 100644 --- a/Source/Core/Common/NandPaths.cpp +++ b/Source/Core/Common/NandPaths.cpp @@ -118,7 +118,7 @@ bool CheckTitleTIK(u64 _titleID, FromWhichRoot from) return false; } -static void CreateReplacementFile(std::string &filename) +static void CreateReplacementFile(std::string& filename) { std::ofstream replace; OpenFStream(replace, filename, std::ios_base::out); 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 213dba2b08..2eb68a944a 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -42,7 +42,7 @@ bool AsciiToHex(const std::string& _szValue, u32& result) // Set errno to a good state. errno = 0; - char *endptr = nullptr; + char* endptr = nullptr; const u32 value = strtoul(_szValue.c_str(), &endptr, 16); if (!endptr || *endptr) @@ -120,7 +120,7 @@ std::string StringFromFormat(const char* format, ...) std::string StringFromFormatV(const char* format, va_list args) { - char *buf = nullptr; + char* buf = nullptr; #ifdef _WIN32 int required = _vscprintf(format, args); buf = new char[required + 1]; @@ -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; @@ -167,7 +167,7 @@ std::string ArrayToString(const u8 *data, u32 size, int line_len, bool spaces) } // Turns " hej " into "hej". Also handles tabs. -std::string StripSpaces(const std::string &str) +std::string StripSpaces(const std::string& str) { const size_t s = str.find_first_not_of(" \t\r\n"); @@ -188,9 +188,9 @@ 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; + char* endptr = nullptr; // Reset errno to a value other than ERANGE errno = 0; @@ -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; @@ -292,7 +292,7 @@ void SplitString(const std::string& str, const char delim, std::vector @@ -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 @@ -99,7 +99,7 @@ bool TryParseVector(const std::string& str, std::vector* output, const char d // TODO: kill this bool AsciiToHex(const std::string& _szValue, u32& result); -std::string TabsToSpaces(int tab_size, const std::string &in); +std::string TabsToSpaces(int tab_size, const std::string& in); void SplitString(const std::string& str, char delim, std::vector& output); diff --git a/Source/Core/Common/SymbolDB.cpp b/Source/Core/Common/SymbolDB.cpp index 260f5de3fe..c4abe0bd26 100644 --- a/Source/Core/Common/SymbolDB.cpp +++ b/Source/Core/Common/SymbolDB.cpp @@ -23,7 +23,7 @@ void SymbolDB::List() INFO_LOG(OSHLE, "%zu functions known in this program above.", functions.size()); } -void SymbolDB::Clear(const char *prefix) +void SymbolDB::Clear(const char* prefix) { // TODO: honor prefix functions.clear(); @@ -50,7 +50,7 @@ Symbol* SymbolDB::GetSymbolFromName(const std::string& name) return nullptr; } -void SymbolDB::AddCompleteSymbol(const Symbol &symbol) +void SymbolDB::AddCompleteSymbol(const Symbol& symbol) { functions.emplace(symbol.address, symbol); } diff --git a/Source/Core/Common/SymbolDB.h b/Source/Core/Common/SymbolDB.h index 9e2094ab87..8d8f323fdb 100644 --- a/Source/Core/Common/SymbolDB.h +++ b/Source/Core/Common/SymbolDB.h @@ -79,10 +79,10 @@ 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); + void AddCompleteSymbol(const Symbol& symbol); Symbol* GetSymbolFromName(const std::string& name); Symbol* GetSymbolFromHash(u32 hash) @@ -94,10 +94,10 @@ public: return nullptr; } - const XFuncMap &Symbols() const { return functions; } - XFuncMap &AccessSymbols() { return functions; } + const XFuncMap& Symbols() const { return functions; } + XFuncMap& AccessSymbols() { return functions; } - void Clear(const char *prefix = ""); + void Clear(const char* prefix = ""); void List(); void Index(); }; diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 7fe267cadf..23a49412c8 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 @@ -162,7 +162,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh) } // Returns the size of the item in file -static unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::string &name, +static unsigned int create_item(SSysConfEntry& item, SysconfType type, const std::string& name, const int data_length, unsigned int offset) { item.offset = offset; 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/Thread.cpp b/Source/Core/Common/Thread.cpp index 11cb48bb49..ad0436c3ae 100644 --- a/Source/Core/Common/Thread.cpp +++ b/Source/Core/Common/Thread.cpp @@ -97,7 +97,7 @@ void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { #ifdef __APPLE__ thread_policy_set(pthread_mach_thread_np(thread), - THREAD_AFFINITY_POLICY, (integer_t *)&mask, 1); + THREAD_AFFINITY_POLICY, (integer_t*)&mask, 1); #elif (defined __linux__ || defined BSD4_4 || defined __FreeBSD__) && !(defined ANDROID) #ifdef __FreeBSD__ cpuset_t cpu_set; diff --git a/Source/Core/Common/Thread.h b/Source/Core/Common/Thread.h index 359137b8fe..567615e801 100644 --- a/Source/Core/Common/Thread.h +++ b/Source/Core/Common/Thread.h @@ -35,6 +35,6 @@ inline void YieldCPU() std::this_thread::yield(); } -void SetCurrentThreadName(const char *name); +void SetCurrentThreadName(const char* name); } // namespace Common diff --git a/Source/Core/Common/TraversalServer.cpp b/Source/Core/Common/TraversalServer.cpp index 6631b6359a..db6cfb294a 100644 --- a/Source/Core/Common/TraversalServer.cpp +++ b/Source/Core/Common/TraversalServer.cpp @@ -75,7 +75,7 @@ EvictFindResult EvictFind(std::unordered_map>& map, const K& #if DEBUG printf("failed to find key '"); for (size_t i = 0; i < sizeof(key); i++) { - printf("%02x", ((u8 *) &key)[i]); + printf("%02x", ((u8*) &key)[i]); } printf("'\n"); #endif diff --git a/Source/Core/Common/Version.cpp b/Source/Core/Common/Version.cpp index 2ac01cd22e..86380c4d92 100644 --- a/Source/Core/Common/Version.cpp +++ b/Source/Core/Common/Version.cpp @@ -13,7 +13,7 @@ #define BUILD_TYPE_STR "" #endif -const char *scm_rev_str = "Dolphin " +const char* scm_rev_str = "Dolphin " #if !SCM_IS_MASTER "[" SCM_BRANCH_STR "] " #endif @@ -25,14 +25,14 @@ const char *scm_rev_str = "Dolphin " #endif #ifdef _WIN32 -const char *netplay_dolphin_ver = SCM_DESC_STR " Win"; +const char* netplay_dolphin_ver = SCM_DESC_STR " Win"; #elif __APPLE__ -const char *netplay_dolphin_ver = SCM_DESC_STR " Mac"; +const char* netplay_dolphin_ver = SCM_DESC_STR " Mac"; #else -const char *netplay_dolphin_ver = SCM_DESC_STR " Lin"; +const char* netplay_dolphin_ver = SCM_DESC_STR " Lin"; #endif -const char *scm_rev_git_str = SCM_REV_STR; +const char* scm_rev_git_str = SCM_REV_STR; -const char *scm_desc_str = SCM_DESC_STR; -const char *scm_branch_str = SCM_BRANCH_STR; +const char* scm_desc_str = SCM_DESC_STR; +const char* scm_branch_str = SCM_BRANCH_STR; diff --git a/Source/Core/Common/ucrtFreadWorkaround.cpp b/Source/Core/Common/ucrtFreadWorkaround.cpp index cecab2b4ff..549c2d9ac5 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; @@ -23,7 +23,7 @@ struct PatchInfo { { L"ucrtbased.dll", 0x1C1915 , 0x91905, 5 }, }; -bool ApplyPatch(const PatchInfo &patch) { +bool ApplyPatch(const PatchInfo& patch) { auto module = GetModuleHandleW(patch.module_name); if (module == nullptr) { @@ -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..d13d612b43 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 eab55d9de6..501db27cbe 100644 --- a/Source/Core/Common/x64Analyzer.cpp +++ b/Source/Core/Common/x64Analyzer.cpp @@ -4,9 +4,9 @@ #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; + unsigned const char* startCodePtr = codePtr; u8 rex = 0; u32 opcode; int opcode_length; @@ -224,7 +224,7 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info) return true; } -bool InstructionInfo::operator==(const InstructionInfo &other) const +bool InstructionInfo::operator==(const InstructionInfo& other) const { return operandSize == other.operandSize && instructionSize == other.instructionSize && diff --git a/Source/Core/Common/x64Analyzer.h b/Source/Core/Common/x64Analyzer.h index 08faa25957..1bcf9f569f 100644 --- a/Source/Core/Common/x64Analyzer.h +++ b/Source/Core/Common/x64Analyzer.h @@ -21,7 +21,7 @@ struct InstructionInfo u64 immediate; s32 displacement; - bool operator==(const InstructionInfo &other) const; + bool operator==(const InstructionInfo& other) const; }; struct ModRM @@ -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);