Skip to content

removed the need for Check object in CTU::getUnsafeUsage() callback / some CheckUninitVar cleanups - #5610

Merged
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:cut-unsafeusage
Nov 3, 2023
Merged

removed the need for Check object in CTU::getUnsafeUsage() callback / some CheckUninitVar cleanups#5610
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:cut-unsafeusage

Conversation

@firewave

@firewavefirewave commented Nov 2, 2023

Copy link
Copy Markdown
Collaborator

The Check objects were just created for that purpose so they basically just were wrappers for the pointers passed into them and were unnecessary.

@firewave

firewave commented Nov 2, 2023

Copy link
Copy Markdown
CollaboratorAuthor

This is in preparation of #5323.

@firewavefirewave changed the title removed the need for Check object in CTU::getUnsafeUsage() callbackremoved the need for Check object in CTU::getUnsafeUsage() callback / some cleanupsNov 2, 2023
@firewavefirewave changed the title removed the need for Check object in CTU::getUnsafeUsage() callback / some cleanupsremoved the need for Check object in CTU::getUnsafeUsage() callback / some CheckUninitVar cleanupsNov 2, 2023
const Token* CheckUninitVar::isVariableUsage(bool cpp, const Token *vartok, const Library& library, bool pointer, Alloc alloc, int indirect)
const Token* CheckUninitVar::isVariableUsage(const Token *vartok, const Library& library, bool pointer, Alloc alloc, int indirect)
{
const bool cpp = vartok->isCpp();

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can simply be taken from Token as it just points back to the TokenList it belongs to. The same applies to Tokenizer::isCPP().

@chrchr-github
chrchr-github merged commit 989d276 into cppcheck-opensource:mainNov 3, 2023
@firewave
firewave deleted the cut-unsafeusage branch November 3, 2023 17:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@firewave@chrchr-github