Removed some unused code

This commit is contained in:
PKEuS 2015-08-15 19:16:48 +02:00
parent 7bb9d2d2f3
commit 1a266315f1
6 changed files with 3 additions and 19 deletions

View File

@ -26,7 +26,6 @@
#include <string>
class Token;
class Tokenizer;
/** Is expression a 'signed char' if no promotion is used */
bool astIsSignedChar(const Token *tok);

View File

@ -202,7 +202,7 @@ public:
};
/* key:arrayName */
std::map<std::string, struct ArrayUsage> arrayUsage;
std::map<std::string, ArrayUsage> arrayUsage;
/* key:arrayName, data:arraySize */
std::map<std::string, MathLib::bigint> arraySize;
@ -240,8 +240,7 @@ private:
public:
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
CheckBufferOverrun c(0, settings, errorLogger);
std::vector<MathLib::bigint> indexes;
indexes.push_back(2);
const std::vector<MathLib::bigint> indexes(2, 1);
c.arrayIndexOutOfBoundsError(0, ArrayInfo(0, "array", 1, 2), indexes);
c.bufferOverrunError(0, std::string("buffer"));
c.strncatUsageError(0);

View File

@ -83,11 +83,11 @@ private:
const Variable *variableInfo;
const Token *typeToken;
const Function *functionInfo;
Token *tempToken;
bool element;
bool _template;
bool address;
bool isCPP;
Token *tempToken;
private:
ArgumentInfo(const ArgumentInfo &); // not implemented

View File

@ -143,9 +143,6 @@ public:
/** @brief %Check zero division*/
void checkZeroDivision();
/** @brief %Check zero division / useless condition */
void checkZeroDivisionOrUselessCondition();
/** @brief Check for NaN (not-a-number) in an arithmetic expression */
void checkNanInArithmeticExpression();
@ -176,9 +173,6 @@ public:
/** @brief %Check for invalid 2nd parameter of memset() */
void checkMemsetInvalid2ndParam();
/** @brief %Check for suspicious code where multiple if have the same expression (e.g "if (a) { } else if (a) { }") */
void checkDuplicateIf();
/** @brief %Check for suspicious code where if and else branch are the same (e.g "if (a) b = true; else b = true;") */
void checkDuplicateBranch();
@ -237,7 +231,6 @@ private:
void checkPipeParameterSizeError(const Token *tok, const std::string &strVarName, const std::string &strDim);
void clarifyCalculationError(const Token *tok, const std::string &op);
void clarifyStatementError(const Token* tok);
void redundantGetAndSetUserIdError(const Token *tok);
void cstyleCastError(const Token *tok);
void invalidPointerCastError(const Token* tok, const std::string& from, const std::string& to, bool inconclusive);
void invalidFunctionArgError(const Token *tok, const std::string &functionName, int argnr, const std::string &validstr);
@ -265,12 +258,9 @@ private:
void memsetZeroBytesError(const Token *tok, const std::string &varname);
void memsetFloatError(const Token *tok, const std::string &var_value);
void memsetValueOutOfRangeError(const Token *tok, const std::string &value);
void duplicateIfError(const Token *tok1, const Token *tok2);
void duplicateBranchError(const Token *tok1, const Token *tok2);
void duplicateExpressionError(const Token *tok1, const Token *tok2, const std::string &op);
void duplicateExpressionTernaryError(const Token *tok);
void alwaysTrueFalseStringCompareError(const Token *tok, const std::string& str1, const std::string& str2);
void alwaysTrueStringVariableCompareError(const Token *tok, const std::string& str1, const std::string& str2);
void duplicateBreakError(const Token *tok, bool inconclusive);
void unreachableCodeError(const Token* tok, bool inconclusive);
void unsignedLessThanZeroError(const Token *tok, const std::string &varname, bool inconclusive);
@ -397,7 +387,6 @@ private:
"- testing if unsigned variable is negative/positive\n"
"- Suspicious use of ; at the end of 'if/for/while' statement.\n"
"- Array filled incompletely using memset/memcpy/memmove.\n"
"- redundant get and set function of user id (--std=posix).\n"
"- NaN (not a number) value used in arithmetic expression.\n"
"- comma in return statement (the comma can easily be misread as a semicolon).\n"
"- prefer erfc, expm1 or log1p to avoid loss of precision.\n"

View File

@ -71,8 +71,6 @@ public:
/** @brief %Check for implicit long cast of int result */
void checkLongCast();
private:
bool isUnsigned(const Variable *var) const;
static bool isSigned(const Variable *var);
// Error messages..
void tooBigBitwiseShiftError(const Token *tok, int lhsbits, const ValueFlow::Value &rhsbits);

View File

@ -65,7 +65,6 @@ public:
/** @brief %Check for unused function variables */
void checkFunctionVariableUsage_iterateScopes(const Scope* const scope, Variables& variables, bool insideLoop);
void checkVariableUsage(const Scope* const scope, const Token* start, Variables& variables);
void checkFunctionVariableUsage();
/** @brief %Check that all struct members are used */