MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getArgDirection

Method getArgDirection

lib/library.cpp:1723–1740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1721}
1722
1723Library::ArgumentChecks::Direction Library::getArgDirection(const Token* ftok, int argnr, int indirect) const
1724{
1725 const ArgumentChecks* arg = getarg(ftok, argnr);
1726 if (arg) {
1727 if (indirect < 0 || indirect >= arg->direction.size())
1728 return ArgumentChecks::Direction::DIR_UNKNOWN; // TODO: don't generate bad indirect values
1729 return arg->direction[indirect];
1730 }
1731 if (formatstr_function(ftok)) {
1732 const int fs_argno = formatstr_argno(ftok);
1733 if (fs_argno >= 0 && argnr >= fs_argno) {
1734 if (formatstr_scan(ftok))
1735 return ArgumentChecks::Direction::DIR_OUT;
1736 return ArgumentChecks::Direction::DIR_IN;
1737 }
1738 }
1739 return ArgumentChecks::Direction::DIR_UNKNOWN;
1740}
1741
1742bool Library::ignorefunction(const std::string& functionName) const
1743{

Callers 6

checkRecursiveMethod · 0.80
checkConstPointerMethod · 0.80
getFunctionUsageFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 1