Don't cast bool to bool
This commit is contained in:
parent
cb58cf8163
commit
3cd2f2d092
|
@ -396,7 +396,7 @@ bool CheckAutoVariables::returnTemporary(const Token *tok)
|
||||||
if (!func && tok->type())
|
if (!func && tok->type())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return bool(!retref && retvalue);
|
return (!retref && retvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -651,7 +651,7 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
return bool(noreturn==nullptr);
|
return (noreturn == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// variable is seen..
|
// variable is seen..
|
||||||
|
|
|
@ -146,13 +146,13 @@ std::string Path::getPathFromFilename(const std::string &filename)
|
||||||
bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
|
bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) || defined(__sun) || defined(__hpux)
|
#if defined(__linux__) || defined(__sun) || defined(__hpux)
|
||||||
return bool(fname1 == fname2);
|
return (fname1 == fname2);
|
||||||
#elif defined(_MSC_VER) || (defined(__GNUC__) && defined(_WIN32))
|
#elif defined(_MSC_VER) || (defined(__GNUC__) && defined(_WIN32))
|
||||||
return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
return (_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
return bool(strcasecmp(fname1.c_str(), fname2.c_str()) == 0);
|
return (strcasecmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
#elif defined(__BORLANDC__)
|
#elif defined(__BORLANDC__)
|
||||||
return bool(stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
return (stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
#else
|
#else
|
||||||
#error Platform filename compare function needed
|
#error Platform filename compare function needed
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -185,7 +185,7 @@ class CPPCHECKLIB Variable {
|
||||||
* @return true if flag set or false in flag not set
|
* @return true if flag set or false in flag not set
|
||||||
*/
|
*/
|
||||||
bool getFlag(unsigned int flag_) const {
|
bool getFlag(unsigned int flag_) const {
|
||||||
return bool((_flags & flag_) != 0);
|
return ((_flags & flag_) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -656,7 +656,7 @@ class CPPCHECKLIB Function {
|
||||||
* @return true if flag set or false in flag not set
|
* @return true if flag set or false in flag not set
|
||||||
*/
|
*/
|
||||||
bool getFlag(unsigned int flag) const {
|
bool getFlag(unsigned int flag) const {
|
||||||
return bool((flags & flag) != 0);
|
return ((flags & flag) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -893,7 +893,7 @@ private:
|
||||||
* @return true if flag set or false in flag not set
|
* @return true if flag set or false in flag not set
|
||||||
*/
|
*/
|
||||||
bool getFlag(unsigned int flag_) const {
|
bool getFlag(unsigned int flag_) const {
|
||||||
return bool((_flags & flag_) != 0);
|
return ((_flags & flag_) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2369,7 +2369,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::map<std::stri
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bool(typeCount >= 2 && tok2 && Token::Match(tok2->tokAt(-2), "!!:: %type%"));
|
return (typeCount >= 2 && tok2 && Token::Match(tok2->tokAt(-2), "!!:: %type%"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4436,7 +4436,7 @@ private:
|
||||||
" x = 0;\n"
|
" x = 0;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" bool isValid() {\n"
|
" bool isValid() {\n"
|
||||||
" return bool(x == 0x11224488);\n"
|
" return (x == 0x11224488);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"};");
|
"};");
|
||||||
ASSERT_EQUALS("[test.cpp:9]: (style, inconclusive) Technically the member function 'Fred::isValid' can be const.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:9]: (style, inconclusive) Technically the member function 'Fred::isValid' can be const.\n", errout.str());
|
||||||
|
|
Loading…
Reference in New Issue