From b9b6b6108e53e3b5ea09b78c334b16fa0e4ac8a9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 10 Aug 2015 22:01:50 -0700 Subject: [PATCH] Dead macro cleanup Enable -Wunused-macros, and remove said unused macros --- fish.xcodeproj/project.pbxproj | 21 ++++++++++++++++++--- src/complete.cpp | 29 ----------------------------- src/kill.cpp | 11 ----------- src/output.cpp | 5 ----- src/parser.cpp | 11 ----------- src/wutil.cpp | 5 ----- 6 files changed, 18 insertions(+), 64 deletions(-) diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index be2b83906..5c6b07e3f 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -1294,11 +1294,16 @@ ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/osx/**"; - WARNING_CFLAGS = "-Wall"; + WARNING_CFLAGS = ( + "-Wall", + "-Wunused-macros", + ); }; name = "Release_C++11"; }; @@ -1423,12 +1428,17 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/osx/**"; - WARNING_CFLAGS = "-Wall"; + WARNING_CFLAGS = ( + "-Wall", + "-Wunused-macros", + ); }; name = Debug; }; @@ -1450,11 +1460,16 @@ ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/osx/**"; - WARNING_CFLAGS = "-Wall"; + WARNING_CFLAGS = ( + "-Wall", + "-Wunused-macros", + ); }; name = Release; }; diff --git a/src/complete.cpp b/src/complete.cpp index ed30776dc..25e81c67e 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -57,35 +57,6 @@ */ #define COMPLETE_VAR_DESC_VAL _( L"Variable: %ls" ) -/** - The maximum number of commands on which to perform description - lookup. The lookup process is quite time consuming, so this should - be set to a pretty low number. -*/ -#define MAX_CMD_DESC_LOOKUP 10 - -/** - Condition cache value returned from hashtable when this condition - has not yet been tested. This value is NULL, so that when the hash - table returns NULL, this wil be seen as an untested condition. -*/ -#define CC_NOT_TESTED 0 - -/** - Condition cache value returned from hashtable when the condition is - met. This can be any value, that is a valid pointer, and that is - different from CC_NOT_TESTED and CC_FALSE. -*/ -#define CC_TRUE L"true" - -/** - Condition cache value returned from hashtable when the condition is - not met. This can be any value, that is a valid pointer, and that - is different from CC_NOT_TESTED and CC_TRUE. - -*/ -#define CC_FALSE L"false" - /** The special cased translation macro for completions. The empty string needs to be special cased, since it can occur, and should diff --git a/src/kill.cpp b/src/kill.cpp index 22f214757..7b68b16cd 100644 --- a/src/kill.cpp +++ b/src/kill.cpp @@ -20,17 +20,6 @@ #include "exec.h" #include "path.h" -/** - Maximum entries in killring -*/ -#define KILL_MAX 8192 - -/** Last kill string */ -//static ll_node_t *kill_last=0; - -/** Current kill string */ -//static ll_node_t *kill_current=0; - /** Kill ring */ typedef std::list kill_list_t; static kill_list_t kill_list; diff --git a/src/output.cpp b/src/output.cpp index 8f97ce61a..1707f4fb7 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -31,11 +31,6 @@ #include "common.h" #include "output.h" -/** - Number of color names in the col array - */ -#define FISH_COLORS (sizeof(col)/sizeof(wchar_t *)) - static int writeb_internal(char c); diff --git a/src/parser.cpp b/src/parser.cpp index 958809223..4b2bff930 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -29,22 +29,11 @@ The fish parser. Contains functions for parsing and evaluating code. #include "parse_tree.h" #include "parse_execution.h" -/** - Error message for tokenizer error. The tokenizer message is - appended to this message. -*/ -#define TOK_ERR_MSG _( L"Tokenizer error: '%ls'") - /** Error for evaluating in illegal scope */ #define INVALID_SCOPE_ERR_MSG _( L"Tried to evaluate commands using invalid block type '%ls'" ) -/** - Error for wrong token type -*/ -#define UNEXPECTED_TOKEN_ERR_MSG _( L"Unexpected token of type '%ls'") - /** While block description */ diff --git a/src/wutil.cpp b/src/wutil.cpp index 196450421..0e233ac78 100644 --- a/src/wutil.cpp +++ b/src/wutil.cpp @@ -30,11 +30,6 @@ typedef std::string cstring; const file_id_t kInvalidFileID = {(dev_t)-1LL, (ino_t)-1LL, (uint64_t)-1LL, -1, -1, (uint32_t)-1}; -/** - Minimum length of the internal covnersion buffers -*/ -#define TMP_LEN_MIN 256 - #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN