From 78aa398e7c09adc4fb9318a4c497e8fd1bcd58ba Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 21 Jan 2016 20:46:25 +0100 Subject: [PATCH] Common: asterisks go against the type name not the variable name --- Source/Core/Common/Arm64Emitter.cpp | 2 +- Source/Core/Common/Arm64Emitter.h | 2 +- Source/Core/Common/CDUtils.cpp | 6 +++--- Source/Core/Common/Common.h | 10 +++++----- Source/Core/Common/DebugInterface.h | 2 +- Source/Core/Common/FileUtil.cpp | 6 +++--- Source/Core/Common/Logging/ConsoleListener.h | 2 +- .../Core/Common/Logging/ConsoleListenerDroid.cpp | 2 +- Source/Core/Common/Logging/ConsoleListenerNix.cpp | 2 +- Source/Core/Common/Logging/ConsoleListenerWin.cpp | 2 +- Source/Core/Common/Logging/Log.h | 2 +- Source/Core/Common/Logging/LogManager.cpp | 6 +++--- Source/Core/Common/Logging/LogManager.h | 8 ++++---- Source/Core/Common/MemArena.cpp | 2 +- Source/Core/Common/MemoryUtil.cpp | 2 +- Source/Core/Common/StringUtil.cpp | 6 +++--- Source/Core/Common/SymbolDB.cpp | 2 +- Source/Core/Common/SymbolDB.h | 2 +- Source/Core/Common/Thread.h | 2 +- Source/Core/Common/Version.cpp | 14 +++++++------- Source/Core/Common/x64Analyzer.cpp | 4 ++-- Source/Core/Common/x64Analyzer.h | 2 +- 22 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 6546686716..5e16e468af 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -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)); diff --git a/Source/Core/Common/Arm64Emitter.h b/Source/Core/Common/Arm64Emitter.h index 400a87a624..40b2523826 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -96,7 +96,7 @@ 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); 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/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/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/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 6857262579..bcc996e732 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -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) @@ -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); @@ -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))) { 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..1ba9a06815 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); @@ -115,7 +115,7 @@ 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]; @@ -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..7bfcccf13f 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; } @@ -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) { diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp index 1f8fa6a4ec..9d03227f71 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); 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/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 213dba2b08..afc63ca2f4 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]; @@ -190,7 +190,7 @@ std::string StripQuotes(const std::string& s) 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; diff --git a/Source/Core/Common/SymbolDB.cpp b/Source/Core/Common/SymbolDB.cpp index 260f5de3fe..c47d6f2826 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(); diff --git a/Source/Core/Common/SymbolDB.h b/Source/Core/Common/SymbolDB.h index 9e2094ab87..29ae57e2ce 100644 --- a/Source/Core/Common/SymbolDB.h +++ b/Source/Core/Common/SymbolDB.h @@ -97,7 +97,7 @@ public: 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/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/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/x64Analyzer.cpp b/Source/Core/Common/x64Analyzer.cpp index eab55d9de6..0514bda0c4 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; diff --git a/Source/Core/Common/x64Analyzer.h b/Source/Core/Common/x64Analyzer.h index 08faa25957..2b7db9e2d9 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);