From f0f7e48ef4e59a7de6d90889b2147d7028403f34 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 15 Dec 2014 17:09:36 -0500 Subject: [PATCH] Common: Move headers over to using pragma once Just makes the headers more consistent. --- Common/ABI.h | 7 +------ Common/ArmEmitter.h | 5 +---- Common/Atomic_GCC.h | 5 +---- Common/Atomic_Win32.h | 5 +---- Common/Atomics.h | 5 +---- Common/CPUDetect.h | 5 +---- Common/Common.h | 5 +---- Common/ConsoleListener.h | 5 +---- Common/FileUtil.h | 11 ++++------- Common/FixedSizeQueue.h | 5 +---- Common/MemArena.h | 5 +---- Common/MemoryUtil.h | 5 +---- Common/MsgHandler.h | 5 +---- Common/StdMutex.h | 6 ++---- Common/StringUtils.h | 5 +---- Common/Thunk.h | 5 +---- Common/Timer.h | 5 +---- Common/ppcEmitter.h | 5 +---- Common/x64Analyzer.h | 9 +++------ 19 files changed, 25 insertions(+), 83 deletions(-) diff --git a/Common/ABI.h b/Common/ABI.h index e86da83e4d..90cb36b6b9 100644 --- a/Common/ABI.h +++ b/Common/ABI.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _JIT_ABI_H_ -#define _JIT_ABI_H_ +#pragma once #include "Common.h" @@ -77,7 +76,3 @@ #endif // WIN32 #endif // X86 - -#endif // _JIT_ABI_H_ - - diff --git a/Common/ArmEmitter.h b/Common/ArmEmitter.h index 9bf92b8993..46ba4e783e 100644 --- a/Common/ArmEmitter.h +++ b/Common/ArmEmitter.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _DOLPHIN_ARM_CODEGEN_ -#define _DOLPHIN_ARM_CODEGEN_ +#pragma once #include #include @@ -901,5 +900,3 @@ extern const VFPEnc VFPOps[16][2]; extern const char *VFPOpNames[16]; } // namespace - -#endif diff --git a/Common/Atomic_GCC.h b/Common/Atomic_GCC.h index f5dc45a017..46dc2948c5 100644 --- a/Common/Atomic_GCC.h +++ b/Common/Atomic_GCC.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _ATOMIC_GCC_H_ -#define _ATOMIC_GCC_H_ +#pragma once #ifdef BLACKBERRY #include @@ -93,5 +92,3 @@ inline void AtomicStoreRelease(volatile u32& dest, u32 value) { } } - -#endif diff --git a/Common/Atomic_Win32.h b/Common/Atomic_Win32.h index ce2016b82c..c0b5bcbc36 100644 --- a/Common/Atomic_Win32.h +++ b/Common/Atomic_Win32.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _ATOMIC_WIN32_H_ -#define _ATOMIC_WIN32_H_ +#pragma once #include "Common.h" #ifndef _XBOX @@ -85,5 +84,3 @@ inline void AtomicStoreRelease(volatile u32& dest, u32 value) { } } - -#endif diff --git a/Common/Atomics.h b/Common/Atomics.h index 86b400b065..bdf2161d7e 100644 --- a/Common/Atomics.h +++ b/Common/Atomics.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _ATOMIC_H_ -#define _ATOMIC_H_ +#pragma once #ifdef _WIN32 @@ -28,5 +27,3 @@ #include "Atomic_GCC.h" #endif - -#endif diff --git a/Common/CPUDetect.h b/Common/CPUDetect.h index ceb5bb3549..0adbfac8e6 100644 --- a/Common/CPUDetect.h +++ b/Common/CPUDetect.h @@ -16,8 +16,7 @@ // http://code.google.com/p/dolphin-emu/ // Detect the cpu, so we'll know which optimizations to use -#ifndef _CPUDETECT_H_ -#define _CPUDETECT_H_ +#pragma once // Every architecture has its own define. This needs to be added to. #if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__) @@ -102,5 +101,3 @@ private: }; extern CPUInfo cpu_info; - -#endif // _CPUDETECT_H_ diff --git a/Common/Common.h b/Common/Common.h index 91cf7ecd37..7e67c37f72 100644 --- a/Common/Common.h +++ b/Common/Common.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _COMMON_H_ -#define _COMMON_H_ +#pragma once // DO NOT EVER INCLUDE directly _or indirectly_ from this file // since it slows down the build a lot. @@ -138,5 +137,3 @@ private: #endif #include "Swap.h" - -#endif // _COMMON_H_ diff --git a/Common/ConsoleListener.h b/Common/ConsoleListener.h index b2b5acd8d0..95691cf24c 100644 --- a/Common/ConsoleListener.h +++ b/Common/ConsoleListener.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _CONSOLELISTENER_H -#define _CONSOLELISTENER_H +#pragma once #include "LogManager.h" @@ -72,5 +71,3 @@ private: bool bHidden; bool bUseColor; }; - -#endif // _CONSOLELISTENER_H diff --git a/Common/FileUtil.h b/Common/FileUtil.h index c97f9f5a94..8c49ba04ed 100644 --- a/Common/FileUtil.h +++ b/Common/FileUtil.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _FILEUTIL_H_ -#define _FILEUTIL_H_ +#pragma once #include #include @@ -168,10 +167,10 @@ public: // clear error state void Clear() { - m_good = true; + m_good = true; #undef clearerr - std::clearerr(m_file); - } + std::clearerr(m_file); + } private: IOFile& operator=(const IOFile&) /*= delete*/; @@ -181,5 +180,3 @@ private: }; } // namespace - -#endif diff --git a/Common/FixedSizeQueue.h b/Common/FixedSizeQueue.h index 21a9b8d00d..b1381b4c45 100644 --- a/Common/FixedSizeQueue.h +++ b/Common/FixedSizeQueue.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _FIXED_SIZE_QUEUE_H_ -#define _FIXED_SIZE_QUEUE_H_ +#pragma once #include #include "ChunkFile.h" @@ -225,5 +224,3 @@ private: volatile int curWriteBlock; }; -#endif // _FIXED_SIZE_QUEUE_H_ - diff --git a/Common/MemArena.h b/Common/MemArena.h index b3c100bb89..9d6b4b9483 100644 --- a/Common/MemArena.h +++ b/Common/MemArena.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _MEMARENA_H_ -#define _MEMARENA_H_ +#pragma once #ifdef _WIN32 #include "CommonWindows.h" @@ -46,5 +45,3 @@ private: int fd; #endif }; - -#endif // _MEMARENA_H_ diff --git a/Common/MemoryUtil.h b/Common/MemoryUtil.h index 3f6812434c..bd583596df 100644 --- a/Common/MemoryUtil.h +++ b/Common/MemoryUtil.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _MEMORYUTIL_H -#define _MEMORYUTIL_H +#pragma once #ifndef _WIN32 #include @@ -83,5 +82,3 @@ private: T *buf_; size_t size_; }; - -#endif diff --git a/Common/MsgHandler.h b/Common/MsgHandler.h index 61de29c4d2..97e865bedf 100644 --- a/Common/MsgHandler.h +++ b/Common/MsgHandler.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _MSGHANDLER_H_ -#define _MSGHANDLER_H_ +#pragma once // Message alerts enum MSG_TYPE { @@ -46,5 +45,3 @@ void SetEnableAlert(bool enable); #define PanicAlert(format, ...) ; #define PanicYesNo(format, ...) ; #endif - -#endif // _MSGHANDLER_H_ diff --git a/Common/StdMutex.h b/Common/StdMutex.h index 40aeb02cfa..2c2e8d8733 100644 --- a/Common/StdMutex.h +++ b/Common/StdMutex.h @@ -1,8 +1,7 @@ -#ifndef MUTEX_H_ -#define MUTEX_H_ +#pragma once -#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z)) +#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z)) #define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) // Note: __MAC_10_7 is defined on 10.7+. @@ -351,4 +350,3 @@ void swap(unique_lock& x, unique_lock& y) } #endif -#endif diff --git a/Common/StringUtils.h b/Common/StringUtils.h index df8d3cb9ca..0498c907b2 100644 --- a/Common/StringUtils.h +++ b/Common/StringUtils.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _STRINGUTIL_H_ -#define _STRINGUTIL_H_ +#pragma once #include @@ -38,5 +37,3 @@ inline void CharArrayFromFormat(char (& out)[Count], const char* format, ...) // "C:/Windows/winhelp.exe" to "C:/Windows/", "winhelp", ".exe" bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension); - -#endif // _STRINGUTIL_H_ diff --git a/Common/Thunk.h b/Common/Thunk.h index 526069f050..101ea84a8d 100644 --- a/Common/Thunk.h +++ b/Common/Thunk.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _THUNK_H_ -#define _THUNK_H_ +#pragma once #include @@ -98,5 +97,3 @@ private: int ThunkStackOffset(); int ThunkBytesNeeded(); }; - -#endif // _THUNK_H_ diff --git a/Common/Timer.h b/Common/Timer.h index dbe19f5469..6094c5e7c8 100644 --- a/Common/Timer.h +++ b/Common/Timer.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _TIMER_H_ -#define _TIMER_H_ +#pragma once #include "Common.h" #include @@ -57,5 +56,3 @@ private: }; } // Namespace Common - -#endif // _TIMER_H_ diff --git a/Common/ppcEmitter.h b/Common/ppcEmitter.h index 3ed650254f..7f3bef67a0 100644 --- a/Common/ppcEmitter.h +++ b/Common/ppcEmitter.h @@ -19,8 +19,7 @@ // http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.aixassem/doc/alangref/linkage_convent.htm // http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.aixassem/doc/alangref/instruction_set.htm -#ifndef _DOLPHIN_PPC_CODEGEN_ -#define _DOLPHIN_PPC_CODEGEN_ +#pragma once #include "Common.h" #include "MemoryUtil.h" @@ -517,5 +516,3 @@ namespace PpcGen }; } // namespace - -#endif // _DOLPHIN_INTEL_CODEGEN_ diff --git a/Common/x64Analyzer.h b/Common/x64Analyzer.h index bddde399b0..ad2fed886d 100644 --- a/Common/x64Analyzer.h +++ b/Common/x64Analyzer.h @@ -15,8 +15,7 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef _X64ANALYZER_H_ -#define _X64ANALYZER_H_ +#pragma once #include "Common.h" @@ -46,7 +45,7 @@ struct ModRM } }; -enum{ +enum { MOVZX_BYTE = 0xB6, //movzx on byte MOVZX_SHORT = 0xB7, //movzx on short MOVSX_BYTE = 0xBE, //movsx on byte @@ -56,11 +55,9 @@ enum{ MOVE_REG_TO_MEM = 0x89, //move reg to memory }; -enum AccessType{ +enum AccessType { OP_ACCESS_READ = 0, OP_ACCESS_WRITE = 1 }; bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int accessType); - -#endif // _X64ANALYZER_H_