@@ -70,7 +70,7 @@ void VarInfo::possibleUsageAll(const std::string &functionName)
7070void CheckLeakAutoVar::leakError (const Token *tok, const std::string &varname, int type)
7171{
7272 const CheckMemoryLeak checkmemleak (_tokenizer, _errorLogger, _settings);
73- if (_settings->environment .isresource (type))
73+ if (_settings->library .isresource (type))
7474 checkmemleak.resourceLeakError (tok, varname);
7575 else
7676 checkmemleak.memleakError (tok, varname);
@@ -96,7 +96,7 @@ void CheckLeakAutoVar::deallocReturnError(const Token *tok, const std::string &v
9696
9797void CheckLeakAutoVar::configurationInfo (const Token* tok, const std::string &functionName)
9898{
99- if (_settings->isEnabled ( " information " ) && _settings-> experimental ) {
99+ if (_settings->checkLibrary ) {
100100 reportError (tok,
101101 Severity::information,
102102 " leakconfiguration" ,
@@ -232,7 +232,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
232232
233233 // allocation?
234234 if (Token::Match (tok->tokAt (2 ), " %type% (" )) {
235- int i = _settings->environment .alloc (tok->strAt (2 ));
235+ int i = _settings->library .alloc (tok->strAt (2 ));
236236 if (i > 0 ) {
237237 alloctype[tok->varId ()] = i;
238238 }
@@ -255,7 +255,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
255255 if (innerTok->str () == " )" )
256256 break ;
257257 if (innerTok->str () == " (" && innerTok->previous ()->isName ()) {
258- const int deallocId = _settings->environment .dealloc (tok->str ());
258+ const int deallocId = _settings->library .dealloc (tok->str ());
259259 functionCall (innerTok->previous (), varInfo, deallocId);
260260 innerTok = innerTok->link ();
261261 }
@@ -335,7 +335,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
335335
336336 // Function call..
337337 else if (Token::Match (tok, " %type% (" ) && tok->str () != " return" ) {
338- const int dealloc = _settings->environment .dealloc (tok->str ());
338+ const int dealloc = _settings->library .dealloc (tok->str ());
339339
340340 functionCall (tok, varInfo, dealloc);
341341
@@ -345,8 +345,8 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
345345 if (dealloc == NOALLOC && Token::simpleMatch (tok, " ) ; }" )) {
346346 const std::string &functionName (tok->link ()->previous ()->str ());
347347 bool unknown = false ;
348- if (_settings->environment .ignore .find (functionName) == _settings->environment .ignore .end () &&
349- _settings->environment .use .find (functionName) == _settings->environment .use .end () &&
348+ if (_settings->library .ignore .find (functionName) == _settings->library .ignore .end () &&
349+ _settings->library .use .find (functionName) == _settings->library .use .end () &&
350350 _tokenizer->IsScopeNoReturn (tok->tokAt (2 ), &unknown)) {
351351 if (unknown) {
352352 // const std::string &functionName(tok->link()->previous()->str());
@@ -385,7 +385,7 @@ void CheckLeakAutoVar::functionCall(const Token *tok, VarInfo *varInfo, const in
385385 std::map<unsigned int , std::string> &possibleUsage = varInfo->possibleUsage ;
386386
387387 // Ignore function call?
388- const bool ignore = bool (_settings->environment .ignore .find (tok->str ()) != _settings->environment .ignore .end ());
388+ const bool ignore = bool (_settings->library .ignore .find (tok->str ()) != _settings->library .ignore .end ());
389389
390390 if (ignore)
391391 return ;
0 commit comments