@@ -128,7 +128,7 @@ void CheckClass::constructors()
128128 clearAllVar (usage);
129129
130130 std::list<const Function *> callstack;
131- initializeVarList (*func, callstack, &(* scope) , usage);
131+ initializeVarList (*func, callstack, scope, usage);
132132
133133 // Check if any variables are uninitialized
134134 std::list<Variable>::const_iterator var;
@@ -233,14 +233,14 @@ void CheckClass::copyconstructors()
233233 for (const Token* const end = func->functionScope ->classStart ; tok != end; tok = tok->next ()) {
234234 if (Token::Match (tok, " %var% ( new|malloc|g_malloc|g_try_malloc|realloc|g_realloc|g_try_realloc" )) {
235235 const Variable* var = tok->variable ();
236- if (var && var->isPointer () && var->scope () == &* scope)
236+ if (var && var->isPointer () && var->scope () == scope)
237237 allocatedVars[tok->varId ()] = tok;
238238 }
239239 }
240240 for (const Token* const end = func->functionScope ->classEnd ; tok != end; tok = tok->next ()) {
241241 if (Token::Match (tok, " %var% = new|malloc|g_malloc|g_try_malloc|realloc|g_realloc|g_try_realloc" )) {
242242 const Variable* var = tok->variable ();
243- if (var && var->isPointer () && var->scope () == &* scope)
243+ if (var && var->isPointer () && var->scope () == scope)
244244 allocatedVars[tok->varId ()] = tok;
245245 }
246246 }
@@ -882,7 +882,7 @@ void CheckClass::privateFunctions()
882882 while (!privateFuncs.empty ()) {
883883 const std::string& funcName = privateFuncs.front ()->tokenDef ->str ();
884884 // Check that all private functions are used
885- bool used = checkFunctionUsage (funcName, &* scope); // Usage in this class
885+ bool used = checkFunctionUsage (funcName, scope); // Usage in this class
886886 // Check in friend classes
887887 const std::list<Type::FriendInfo>& friendList = scope->definedType ->friendList ;
888888 for (std::list<Type::FriendInfo>::const_iterator it = friendList.begin (); !used && it != friendList.end (); ++it) {
@@ -981,18 +981,18 @@ void CheckClass::checkMemset()
981981 typeTok = typeTok->next ();
982982
983983 if (!type) {
984- const Type* t = symbolDatabase->findVariableType (&(* scope) , typeTok);
984+ const Type* t = symbolDatabase->findVariableType (scope, typeTok);
985985 if (t)
986986 type = t->classScope ;
987987 }
988988
989989 if (type) {
990990 std::list<const Scope *> parsedTypes;
991- checkMemsetType (&(* scope) , tok, type, false , parsedTypes);
991+ checkMemsetType (scope, tok, type, false , parsedTypes);
992992 }
993993 } else if (tok->variable () && tok->variable ()->typeScope () && Token::Match (tok, " %var% = calloc|malloc|realloc|g_malloc|g_try_malloc|g_realloc|g_try_realloc (" )) {
994994 std::list<const Scope *> parsedTypes;
995- checkMemsetType (&(* scope) , tok->tokAt (2 ), tok->variable ()->typeScope (), true , parsedTypes);
995+ checkMemsetType (scope, tok->tokAt (2 ), tok->variable ()->typeScope (), true , parsedTypes);
996996
997997 if (tok->variable ()->typeScope ()->numConstructors > 0 && _settings->isEnabled (" warning" ))
998998 mallocOnClassWarning (tok, tok->strAt (2 ), tok->variable ()->typeScope ()->classDef );
@@ -1163,7 +1163,7 @@ void CheckClass::operatorEqRetRefThis()
11631163 if (func->type == Function::eOperatorEqual && func->hasBody ()) {
11641164 // make sure return signature is correct
11651165 if (Token::Match (func->retDef , " %type% &" ) && func->retDef ->str () == scope->className ) {
1166- checkReturnPtrThis (&(* scope) , &(*func), func->functionScope ->classStart , func->functionScope ->classEnd );
1166+ checkReturnPtrThis (scope, &(*func), func->functionScope ->classStart , func->functionScope ->classEnd );
11671167 }
11681168 }
11691169 }
@@ -1281,7 +1281,7 @@ void CheckClass::operatorEqToSelf()
12811281 const Token *rhs = func->argumentList .begin ()->nameToken ();
12821282
12831283 if (!hasAssignSelf (&(*func), rhs)) {
1284- if (hasAllocation (&(*func), &* scope))
1284+ if (hasAllocation (&(*func), scope))
12851285 operatorEqToSelfError (func->token );
12861286 }
12871287 }
@@ -1605,7 +1605,7 @@ void CheckClass::checkConst()
16051605
16061606 bool memberAccessed = false ;
16071607 // if nothing non-const was found. write error..
1608- if (checkConstFunc (&(* scope) , &*func, memberAccessed)) {
1608+ if (checkConstFunc (scope, &*func, memberAccessed)) {
16091609 std::string classname = scope->className ;
16101610 const Scope *nest = scope->nestedIn ;
16111611 while (nest && nest->type != Scope::eGlobal) {
0 commit comments