From 7c64113acfb56fb413d71d57ae5a48c8c57bb697 Mon Sep 17 00:00:00 2001 From: Headline Date: Sat, 28 Jul 2018 04:32:51 -0700 Subject: [PATCH] Fix more unused vars for gcc --- core/ChatTriggers.cpp | 6 ++---- core/logic/GameConfigs.cpp | 5 ----- core/logic/TextParsers.cpp | 4 ---- core/logic/sprintf.cpp | 4 ---- core/smn_entities.cpp | 5 +++-- public/sm_trie_tpl.h | 2 -- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/core/ChatTriggers.cpp b/core/ChatTriggers.cpp index 6b5880cf2..b873183e3 100644 --- a/core/ChatTriggers.cpp +++ b/core/ChatTriggers.cpp @@ -383,14 +383,12 @@ bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args) /* See if we need to do extra string manipulation */ if (prepended) { - size_t len; - /* Check if we need to prepend sm_ */ if (prepended) { - len = ke::SafeSprintf(m_ToExecute, sizeof(m_ToExecute), "sm_%s", args); + ke::SafeSprintf(m_ToExecute, sizeof(m_ToExecute), "sm_%s", args); } else { - len = ke::SafeStrcpy(m_ToExecute, sizeof(m_ToExecute), args); + ke::SafeStrcpy(m_ToExecute, sizeof(m_ToExecute), args); } } else { ke::SafeStrcpy(m_ToExecute, sizeof(m_ToExecute), args); diff --git a/core/logic/GameConfigs.cpp b/core/logic/GameConfigs.cpp index aef5748d7..0b850dda0 100644 --- a/core/logic/GameConfigs.cpp +++ b/core/logic/GameConfigs.cpp @@ -642,11 +642,6 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states) /* First, preprocess the signature */ unsigned char real_sig[511]; size_t real_bytes; - size_t length; - - real_bytes = 0; - length = strlen(s_TempSig.sig); - real_bytes = UTIL_DecodeHexString(real_sig, sizeof(real_sig), s_TempSig.sig); if (real_bytes >= 1) diff --git a/core/logic/TextParsers.cpp b/core/logic/TextParsers.cpp index 318cc4f0d..e5afb5936 100644 --- a/core/logic/TextParsers.cpp +++ b/core/logic/TextParsers.cpp @@ -335,7 +335,6 @@ SMCError TextParsers::ParseStream_SMC(void *stream, unsigned int curlevel = 0; bool in_quote = false; bool ignoring = false; - bool eol_comment = false; bool ml_comment = false; unsigned int i; SMCError err = SMCError_Okay; @@ -406,7 +405,6 @@ SMCError TextParsers::ParseStream_SMC(void *stream, } /* Next, let's clear some line-based values that may no longer have meaning */ - eol_comment = false; in_quote = false; if (ignoring && !ml_comment) { @@ -536,7 +534,6 @@ SMCError TextParsers::ParseStream_SMC(void *stream, { /* standard comment */ ignoring = true; - eol_comment = true; restage = true; } else if (parse_point[i+1] == '*') @@ -555,7 +552,6 @@ SMCError TextParsers::ParseStream_SMC(void *stream, else { ignoring = true; - eol_comment = true; restage = true; } } diff --git a/core/logic/sprintf.cpp b/core/logic/sprintf.cpp index 27c10974b..9ce6f159c 100644 --- a/core/logic/sprintf.cpp +++ b/core/logic/sprintf.cpp @@ -617,7 +617,6 @@ bool gnprintf(char *buffer, int width; int prec; int n; - char sign; const char *fmt; size_t llen = maxlen - 1; @@ -644,7 +643,6 @@ bool gnprintf(char *buffer, flags = 0; width = 0; prec = -1; - sign = '\0'; rflag: ch = *fmt++; @@ -1028,7 +1026,6 @@ size_t atcprintf(char *buffer, size_t maxlen, const char *format, IPluginContext int width; int prec; int n; - char sign; const char *fmt; size_t llen = maxlen - 1; @@ -1056,7 +1053,6 @@ size_t atcprintf(char *buffer, size_t maxlen, const char *format, IPluginContext flags = 0; width = 0; prec = -1; - sign = '\0'; rflag: ch = *fmt++; diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index 784ec2f01..20461c267 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -1226,7 +1226,8 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params) pProp->GetType(), \ pProp->m_nBits, \ type); \ - } + } \ + (void)bit_count; \ inline int MatchTypeDescAsInteger(_fieldtypes type, int flags) @@ -2035,7 +2036,7 @@ static cell_t SetEntPropVector(IPluginContext *pContext, const cell_t *params) CBaseEntity *pEntity; char *prop; int offset; - int bit_count; + int bit_count; edict_t *pEdict; int element = 0; diff --git a/public/sm_trie_tpl.h b/public/sm_trie_tpl.h index 37f4ce4ea..c320cb443 100644 --- a/public/sm_trie_tpl.h +++ b/public/sm_trie_tpl.h @@ -163,7 +163,6 @@ public: unsigned int curidx; /* current node index */ const char *keyptr = key; /* input stream at current token */ KTrieNode *node = NULL; /* current node being processed */ - KTrieNode *basenode = NULL; /* current base node being processed */ unsigned int q; /* temporary var for x_check results */ unsigned int curoffs; /* current offset */ @@ -196,7 +195,6 @@ public: { /* Find where the next character is, then advance */ curidx = m_base[lastidx].idx; - basenode = &m_base[curidx]; curoffs = charval(*keyptr); curidx += curoffs; node = &m_base[curidx];