Try to fix appveyor. Replace int64_t with MathLib::bigint.
This commit is contained in:
parent
05d35b063d
commit
45844ef962
|
@ -1200,7 +1200,7 @@ int Library::returnValueContainer(const Token *ftok) const
|
||||||
return it != mReturnValueContainer.end() ? it->second : -1;
|
return it != mReturnValueContainer.end() ? it->second : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Library::returnValueSafeValues(const Token *ftok, int64_t *v1, int64_t *v2) const
|
bool Library::returnValueSafeValues(const Token *ftok, MathLib::bigint *v1, MathLib::bigint *v2) const
|
||||||
{
|
{
|
||||||
if (isNotLibraryFunction(ftok))
|
if (isNotLibraryFunction(ftok))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -181,7 +181,7 @@ public:
|
||||||
const std::string& returnValue(const Token *ftok) const;
|
const std::string& returnValue(const Token *ftok) const;
|
||||||
const std::string& returnValueType(const Token *ftok) const;
|
const std::string& returnValueType(const Token *ftok) const;
|
||||||
int returnValueContainer(const Token *ftok) const;
|
int returnValueContainer(const Token *ftok) const;
|
||||||
bool returnValueSafeValues(const Token *ftok, int64_t *v1, int64_t *v2) const;
|
bool returnValueSafeValues(const Token *ftok, MathLib::bigint *v1, MathLib::bigint *v2) const;
|
||||||
|
|
||||||
bool isnoreturn(const Token *ftok) const;
|
bool isnoreturn(const Token *ftok) const;
|
||||||
bool isnotnoreturn(const Token *ftok) const;
|
bool isnotnoreturn(const Token *ftok) const;
|
||||||
|
@ -543,8 +543,8 @@ private:
|
||||||
std::map<std::string, std::string> mReturnValueType;
|
std::map<std::string, std::string> mReturnValueType;
|
||||||
std::map<std::string, int> mReturnValueContainer;
|
std::map<std::string, int> mReturnValueContainer;
|
||||||
struct SafeValues {
|
struct SafeValues {
|
||||||
int64_t minValue;
|
MathLib::bigint minValue;
|
||||||
int64_t maxValue;
|
MathLib::bigint maxValue;
|
||||||
};
|
};
|
||||||
std::map<std::string, SafeValues> mReturnSafeValues;
|
std::map<std::string, SafeValues> mReturnSafeValues;
|
||||||
std::map<std::string, bool> mReportErrors;
|
std::map<std::string, bool> mReportErrors;
|
||||||
|
|
|
@ -5338,7 +5338,7 @@ static void valueFlowDynamicBufferSize(TokenList *tokenlist, SymbolDatabase *sym
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool getMinMaxValues(const ValueType *vt, const cppcheck::Platform &platform, int64_t *minValue, int64_t *maxValue)
|
static bool getMinMaxValues(const ValueType *vt, const cppcheck::Platform &platform, MathLib::bigint *minValue, MathLib::bigint *maxValue)
|
||||||
{
|
{
|
||||||
if (!vt || !vt->isIntegral() || vt->pointer)
|
if (!vt || !vt->isIntegral() || vt->pointer)
|
||||||
return false;
|
return false;
|
||||||
|
@ -5393,7 +5393,7 @@ static bool getMinMaxValues(const ValueType *vt, const cppcheck::Platform &platf
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool getMinMaxValues(const std::string &typestr, const Settings *settings, int64_t *minvalue, int64_t *maxvalue)
|
static bool getMinMaxValues(const std::string &typestr, const Settings *settings, MathLib::bigint *minvalue, MathLib::bigint *maxvalue)
|
||||||
{
|
{
|
||||||
TokenList typeTokens(settings);
|
TokenList typeTokens(settings);
|
||||||
std::istringstream istr(typestr+";");
|
std::istringstream istr(typestr+";");
|
||||||
|
@ -5420,7 +5420,7 @@ static void valueFlowSafeFunctions(TokenList *tokenlist, SymbolDatabase *symbold
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (const Variable &arg : function->argumentList) {
|
for (const Variable &arg : function->argumentList) {
|
||||||
int64_t minValue, maxValue;
|
MathLib::bigint minValue, maxValue;
|
||||||
if (!getMinMaxValues(arg.valueType(), *settings, &minValue, &maxValue))
|
if (!getMinMaxValues(arg.valueType(), *settings, &minValue, &maxValue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -5451,13 +5451,13 @@ static void valueFlowSafeFunctionReturn(TokenList *tokenlist, const Settings *se
|
||||||
continue;
|
continue;
|
||||||
if (!Token::Match(tok->previous(), "%name%"))
|
if (!Token::Match(tok->previous(), "%name%"))
|
||||||
continue;
|
continue;
|
||||||
int64_t v1,v2;
|
MathLib::bigint v1,v2;
|
||||||
if (!settings->library.returnValueSafeValues(tok->previous(), &v1, &v2))
|
if (!settings->library.returnValueSafeValues(tok->previous(), &v1, &v2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Get min/max values for return type
|
// Get min/max values for return type
|
||||||
const std::string typestr = settings->library.returnValueType(tok->previous());
|
const std::string typestr = settings->library.returnValueType(tok->previous());
|
||||||
int64_t minvalue, maxvalue;
|
MathLib::bigint minvalue, maxvalue;
|
||||||
if (!getMinMaxValues(typestr, settings, &minvalue, &maxvalue))
|
if (!getMinMaxValues(typestr, settings, &minvalue, &maxvalue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue