From 154df6b09d0c39ef9a9b1ee049251b645c13f559 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sun, 10 May 2020 17:16:38 +0100 Subject: Cleanup unneeded globals (#4736) --- Tools/AnvilStats/Globals.h | 63 ------------------------ Tools/GrownBiomeGenVisualiser/Globals.h | 52 -------------------- Tools/MCADefrag/Globals.h | 44 ----------------- Tools/NoiseSpeedTest/Globals.h | 44 ----------------- Tools/ProtoProxy/Globals.h | 39 --------------- Tools/QtBiomeVisualiser/Globals.h | 85 --------------------------------- Tools/RCONClient/Globals.h | 66 ------------------------- Tools/ToLuaDoxy/Globals.h | 2 +- 8 files changed, 1 insertion(+), 394 deletions(-) (limited to 'Tools') diff --git a/Tools/AnvilStats/Globals.h b/Tools/AnvilStats/Globals.h index bcf5bb159..18e2ab7c4 100644 --- a/Tools/AnvilStats/Globals.h +++ b/Tools/AnvilStats/Globals.h @@ -18,66 +18,15 @@ #define _CRT_SECURE_NO_WARNINGS - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define FORMATSTRING(formatIndex, va_argsIndex) - - // MSVC has its own custom version of zu format - #define SIZE_T_FMT "%Iu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" - #define SIZE_T_FMT_HEX "%Ix" - - #define NORETURN __declspec(noreturn) - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - // TODO: Can GCC mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) - - #define SIZE_T_FMT "%zu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" - #define SIZE_T_FMT_HEX "%zx" - - #define NORETURN __attribute((__noreturn__)) - #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - #endif @@ -223,18 +172,6 @@ typedef unsigned char Byte; -/** A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - /** Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; -} ; - - - - - /** Clamp value to the specified range. */ template T Clamp(T a_Value, T a_Min, T a_Max) diff --git a/Tools/GrownBiomeGenVisualiser/Globals.h b/Tools/GrownBiomeGenVisualiser/Globals.h index f062b4ccf..da4b5203c 100644 --- a/Tools/GrownBiomeGenVisualiser/Globals.h +++ b/Tools/GrownBiomeGenVisualiser/Globals.h @@ -16,54 +16,15 @@ // Disable some warnings that we don't care about: #pragma warning(disable:4100) - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define NORETURN __declspec(noreturn) - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - // override is part of c++11 - #if __cplusplus < 201103L - #define override - #endif - - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define NORETURN __attribute((__noreturn__)) #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - #endif @@ -214,19 +175,6 @@ typedef unsigned char Byte; -/** A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - /** Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; - virtual ~cItemCallback() {} -} ; - - - - - /** Clamp X to the specified range. */ template T Clamp(T a_Value, T a_Min, T a_Max) diff --git a/Tools/MCADefrag/Globals.h b/Tools/MCADefrag/Globals.h index f0e535888..0b871dbe2 100644 --- a/Tools/MCADefrag/Globals.h +++ b/Tools/MCADefrag/Globals.h @@ -16,46 +16,15 @@ // Disable some warnings that we don't care about: #pragma warning(disable:4100) - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define NORETURN __declspec(noreturn) - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define NORETURN __attribute((__noreturn__)) #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - #endif @@ -199,19 +168,6 @@ typedef unsigned char Byte; #define VERIFY(x) (!!(x) || (LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__), exit(1), 0)) - - - -/** A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - /** Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; - virtual ~cItemCallback() {} -} ; - - #include "BiomeDef.h" diff --git a/Tools/NoiseSpeedTest/Globals.h b/Tools/NoiseSpeedTest/Globals.h index f0400f853..adb74e24d 100644 --- a/Tools/NoiseSpeedTest/Globals.h +++ b/Tools/NoiseSpeedTest/Globals.h @@ -16,46 +16,15 @@ // Disable some warnings that we don't care about: #pragma warning(disable:4100) - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define NORETURN __declspec(noreturn) - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define NORETURN __attribute((__noreturn__)) #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - #endif @@ -211,19 +180,6 @@ typedef unsigned char Byte; -/** A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - /** Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; - virtual ~cItemCallback() {} -} ; - - - - - /** Clamps the value into the specified range. */ template T Clamp(T a_Value, T a_Min, T a_Max) diff --git a/Tools/ProtoProxy/Globals.h b/Tools/ProtoProxy/Globals.h index affd4b3fa..71173d1db 100644 --- a/Tools/ProtoProxy/Globals.h +++ b/Tools/ProtoProxy/Globals.h @@ -16,44 +16,15 @@ // Disable some warnings that we don't care about: #pragma warning(disable:4100) - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - - #endif @@ -199,18 +170,8 @@ typedef unsigned char Byte; // Pretty much the same as ASSERT() but stays in Release builds #define VERIFY(x) (!!(x) || (LOGERROR("Verification failed: %s, file %s, line %i", #x, __FILE__, __LINE__), exit(1), 0)) -// C++11 has std::shared_ptr in , included earlier -#define SharedPtr std::shared_ptr - -/* A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - /* Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; -} ; diff --git a/Tools/QtBiomeVisualiser/Globals.h b/Tools/QtBiomeVisualiser/Globals.h index 97b44dda0..d908c0b2c 100644 --- a/Tools/QtBiomeVisualiser/Globals.h +++ b/Tools/QtBiomeVisualiser/Globals.h @@ -32,90 +32,19 @@ // 2014_01_06 xoft: Disabled this warning because MSVC is stupid and reports it in obviously wrong places // #pragma warning(3 : 4244) // Conversion from 'type1' to 'type2', possible loss of data - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 #define FORMATSTRING(formatIndex, va_argsIndex) - - // MSVC has its own custom version of zu format - #define SIZE_T_FMT "%Iu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" - #define SIZE_T_FMT_HEX "%Ix" - - #define NORETURN __declspec(noreturn) - #elif defined(__GNUC__) // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - // override is part of c++11 - #if __cplusplus < 201103L - #define override - #endif - - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) - - #if defined(_WIN32) - // We're compiling on MinGW, which uses an old MSVCRT library that has no support for size_t printfing. - // We need direct size formats: - #if defined(_WIN64) - #define SIZE_T_FMT "%I64u" - #define SIZE_T_FMT_PRECISION(x) "%" #x "I64u" - #define SIZE_T_FMT_HEX "%I64x" - #else - #define SIZE_T_FMT "%u" - #define SIZE_T_FMT_PRECISION(x) "%" #x "u" - #define SIZE_T_FMT_HEX "%x" - #endif - #else - // We're compiling on Linux, so we can use libc's size_t printf format: - #define SIZE_T_FMT "%zu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" - #define SIZE_T_FMT_HEX "%zx" - #endif - - #define NORETURN __attribute((__noreturn__)) - #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - -#endif - - -#ifdef _DEBUG - #define NORETURNDEBUG NORETURN -#else - #define NORETURNDEBUG #endif @@ -331,20 +260,6 @@ around it, "(32 KiB)") */ - -/** A generic interface used mainly in ForEach() functions */ -template class cItemCallback -{ -public: - virtual ~cItemCallback() {} - - /** Called for each item in the internal list; return true to stop the loop, or false to continue enumerating */ - virtual bool Item(Type * a_Type) = 0; -} ; - - - - /** Clamp X to the specified range. */ template T Clamp(T a_Value, T a_Min, T a_Max) diff --git a/Tools/RCONClient/Globals.h b/Tools/RCONClient/Globals.h index f8558b032..661918063 100644 --- a/Tools/RCONClient/Globals.h +++ b/Tools/RCONClient/Globals.h @@ -16,21 +16,6 @@ // Disable some warnings that we don't care about: #pragma warning(disable:4100) - #define OBSOLETE __declspec(deprecated) - - // No alignment needed in MSVC - #define ALIGN_8 - #define ALIGN_16 - - #define FORMATSTRING(formatIndex, va_argsIndex) - - // MSVC has its own custom version of zu format - #define SIZE_T_FMT "%Iu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "Iu" - #define SIZE_T_FMT_HEX "%Ix" - - #define NORETURN __declspec(noreturn) - // Use non-standard defines in #define _USE_MATH_DEFINES @@ -39,61 +24,10 @@ // TODO: Can GCC explicitly mark classes as abstract (no instances can be created)? #define abstract - // TODO: Can GCC mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - #define OBSOLETE __attribute__((deprecated)) - - #define ALIGN_8 __attribute__((aligned(8))) - #define ALIGN_16 __attribute__((aligned(16))) - - // Some portability macros :) - #define stricmp strcasecmp - - #define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex))) - - #if defined(_WIN32) - // We're compiling on MinGW, which uses an old MSVCRT library that has no support for size_t printfing. - // We need direct size formats: - #if defined(_WIN64) - #define SIZE_T_FMT "%I64u" - #define SIZE_T_FMT_PRECISION(x) "%" #x "I64u" - #define SIZE_T_FMT_HEX "%I64x" - #else - #define SIZE_T_FMT "%u" - #define SIZE_T_FMT_PRECISION(x) "%" #x "u" - #define SIZE_T_FMT_HEX "%x" - #endif - #else - // We're compiling on Linux, so we can use libc's size_t printf format: - #define SIZE_T_FMT "%zu" - #define SIZE_T_FMT_PRECISION(x) "%" #x "zu" - #define SIZE_T_FMT_HEX "%zx" - #endif - - #define NORETURN __attribute((__noreturn__)) - #else #error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler" - /* - // Copy and uncomment this into another #elif section based on your compiler identification - - // Explicitly mark classes as abstract (no instances can be created) - #define abstract - - // Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class) - #define override - - // Mark functions as obsolete, so that their usage results in a compile-time warning - #define OBSOLETE - - // Mark types / variables for alignment. Do the platforms need it? - #define ALIGN_8 - #define ALIGN_16 - */ - #endif diff --git a/Tools/ToLuaDoxy/Globals.h b/Tools/ToLuaDoxy/Globals.h index 8995c1be8..9dc94892a 100644 --- a/Tools/ToLuaDoxy/Globals.h +++ b/Tools/ToLuaDoxy/Globals.h @@ -75,7 +75,7 @@ // Common headers (part 1, without macros): -#include "../../source/StringUtils.h" +#include "../../src/StringUtils.h" -- cgit v1.2.3