Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/check64bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static bool isint(const Variable *var)

void Check64BitPortability::pointerassignment()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
Expand Down
6 changes: 3 additions & 3 deletions lib/checkassignif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CheckAssignIf instance;

void CheckAssignIf::assignIf()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
Expand Down Expand Up @@ -84,7 +84,7 @@ void CheckAssignIf::assignIfError(const Token *tok, bool result)

void CheckAssignIf::comparison()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
Expand Down Expand Up @@ -140,7 +140,7 @@ void CheckAssignIf::comparisonError(const Token *tok, bool result)

void CheckAssignIf::multiCondition()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
Expand Down
12 changes: 6 additions & 6 deletions lib/checkbufferoverrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void CheckBufferOverrun::bufferOverrun(const Token *tok, const std::string &varn

void CheckBufferOverrun::strncatUsage(const Token *tok)
{
if (_settings && !_settings->_checkCodingStyle)
if (_settings && !_settings->isEnabled("style"))
return;

reportError(tok, Severity::warning, "strncatUsage",
Expand All @@ -137,7 +137,7 @@ void CheckBufferOverrun::pointerOutOfBounds(const Token *tok, const std::string

void CheckBufferOverrun::sizeArgumentAsChar(const Token *tok)
{
if (_settings && !_settings->_checkCodingStyle)
if (_settings && !_settings->isEnabled("style"))
return;
reportError(tok, Severity::warning, "sizeArgumentAsChar", "The size argument is given as a char constant");
}
Expand Down Expand Up @@ -1017,7 +1017,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vector<std::str
if (varid && Token::Match(tok, "= %varid% + %num% ;", varid))
{
const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(3));
if (index > size && _settings->_checkCodingStyle)
if (index > size && _settings->isEnabled("style"))
pointerOutOfBounds(tok->next(), "buffer");
if (index >= size && Token::Match(tok->tokAt(-2), "[;{}] %varid% =", varid))
pointerIsOutOfBounds = true;
Expand Down Expand Up @@ -1127,7 +1127,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo
checkFunctionCall(tok, arrayInfo);
}

if (_settings->_checkCodingStyle)
if (_settings->isEnabled("style"))
{
// check for strncpy which is not terminated
if ((Token::Match(tok, "strncpy ( %varid% , %var% , %num% )", arrayInfo.varid())))
Expand Down Expand Up @@ -1217,7 +1217,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo
}

// undefined behaviour: result of pointer arithmetic is out of bounds
if (_settings->_checkCodingStyle && Token::Match(tok, "= %varid% + %num% ;", arrayInfo.varid()))
if (_settings->isEnabled("style") && Token::Match(tok, "= %varid% + %num% ;", arrayInfo.varid()))
{
const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(3));
if (index < 0 || index > arrayInfo.num(0))
Expand Down Expand Up @@ -2186,7 +2186,7 @@ void CheckBufferOverrun::executionPaths()

void CheckBufferOverrun::arrayIndexThenCheck()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{
Expand Down
12 changes: 6 additions & 6 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void CheckClass::createSymbolDatabase()

void CheckClass::constructors()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

createSymbolDatabase();
Expand Down Expand Up @@ -570,7 +570,7 @@ void CheckClass::operatorEqVarError(const Token *tok, const std::string &classna

void CheckClass::privateFunctions()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

// don't check code that contains templates. Templates that are
Expand Down Expand Up @@ -802,7 +802,7 @@ void CheckClass::memsetError(const Token *tok, const std::string &memfunc, const

void CheckClass::operatorEq()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

createSymbolDatabase();
Expand Down Expand Up @@ -841,7 +841,7 @@ void CheckClass::operatorEqReturnError(const Token *tok, const std::string &clas

void CheckClass::operatorEqRetRefThis()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

createSymbolDatabase();
Expand Down Expand Up @@ -957,7 +957,7 @@ void CheckClass::operatorEqRetRefThisError(const Token *tok)

void CheckClass::operatorEqToSelf()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

createSymbolDatabase();
Expand Down Expand Up @@ -1251,7 +1251,7 @@ void CheckClass::virtualDestructorError(const Token *tok, const std::string &Bas

void CheckClass::thisSubtraction()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

const Token *tok = _tokenizer->tokens();
Expand Down
4 changes: 2 additions & 2 deletions lib/checkexceptionsafety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CheckExceptionSafety instance;
void CheckExceptionSafety::destructors()
{
// This is a style error..
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

// Perform check..
Expand Down Expand Up @@ -175,7 +175,7 @@ void CheckExceptionSafety::deallocThrow()
//---------------------------------------------------------------------------
void CheckExceptionSafety::checkRethrowCopy()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;
const char catchPattern[] = "catch ( const| %type% &|*| %var% ) { %any%";

Expand Down
2 changes: 1 addition & 1 deletion lib/checkmemoryleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2910,7 +2910,7 @@ void CheckMemoryLeakInClass::checkPublicFunctions(const Scope *scope, const Toke
// Check that public functions deallocate the pointers that they allocate.
// There is no checking how these functions are used and therefore it
// isn't established if there is real leaks or not.
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

const unsigned int varid = classtok->varId();
Expand Down
2 changes: 1 addition & 1 deletion lib/checknonreentrantfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CheckNonReentrantFunctions instance;

void CheckNonReentrantFunctions::nonReentrantFunctions()
{
if (!_settings->isEnabled("posix") || !_settings->_checkCodingStyle)
if (!_settings->isEnabled("posix") || !_settings->isEnabled("style"))
return;

// Don't check C# and Java code
Expand Down
2 changes: 1 addition & 1 deletion lib/checkobsoletefunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CheckObsoleteFunctions instance;

void CheckObsoleteFunctions::obsoleteFunctions()
{
if (!_settings->_checkCodingStyle)
if (!_settings->isEnabled("style"))
return;

// Don't check C# and Java code
Expand Down
Loading