@@ -2868,26 +2868,26 @@ static bool isTernaryAssignment(const Token* assignTok, nonneg int loopVarId, no
28682868namespace {
28692869 struct LoopAnalyzer {
28702870 private:
2871- const Token* bodyTok ;
2872- const Token* loopVar {};
2873- const Settings& settings ;
2874- std::set<nonneg int > varsChanged ;
2871+ const Token* mBodyTok ;
2872+ const Token* mLoopVar {};
2873+ const Settings& mSettings ;
2874+ std::set<nonneg int > mVarsChanged ;
28752875
28762876 public:
28772877 explicit LoopAnalyzer (const Token* tok, const Settings& psettings)
2878- : bodyTok (tok->linkAt (1 )->next()), settings (psettings)
2878+ : mBodyTok (tok->linkAt (1 )->next()), mSettings (psettings)
28792879 {
28802880 const Token* splitTok = tok->next ()->astOperand2 ();
28812881 if (Token::simpleMatch (splitTok, " :" ) && splitTok->previous ()->varId () != 0 ) {
2882- loopVar = splitTok->previous ();
2882+ mLoopVar = splitTok->previous ();
28832883 }
28842884 if (valid ()) {
28852885 findChangedVariables ();
28862886 }
28872887 }
28882888 private:
28892889 bool isLoopVarChanged () const {
2890- return varsChanged .count (loopVar ->varId ()) > 0 ;
2890+ return mVarsChanged .count (mLoopVar ->varId ()) > 0 ;
28912891 }
28922892
28932893 bool isModified (const Token* tok) const
@@ -2897,11 +2897,11 @@ namespace {
28972897 int n = 1 + (astIsPointer (tok) ? 1 : 0 );
28982898 for (int i = 0 ; i < n; i++) {
28992899 bool inconclusive = false ;
2900- if (isVariableChangedByFunctionCall (tok, i, settings , &inconclusive))
2900+ if (isVariableChangedByFunctionCall (tok, i, mSettings , &inconclusive))
29012901 return true ;
29022902 if (inconclusive)
29032903 return true ;
2904- if (isVariableChanged (tok, i, settings ))
2904+ if (isVariableChanged (tok, i, mSettings ))
29052905 return true ;
29062906 }
29072907 return false ;
@@ -2910,7 +2910,7 @@ namespace {
29102910 template <class Predicate , class F >
29112911 void findTokens (Predicate pred, F f) const
29122912 {
2913- for (const Token* tok = bodyTok ; precedes (tok, bodyTok ->link ()); tok = tok->next ()) {
2913+ for (const Token* tok = mBodyTok ; precedes (tok, mBodyTok ->link ()); tok = tok->next ()) {
29142914 if (pred (tok))
29152915 f (tok);
29162916 }
@@ -2919,7 +2919,7 @@ namespace {
29192919 template <class Predicate >
29202920 const Token* findToken (Predicate pred) const
29212921 {
2922- for (const Token* tok = bodyTok ; precedes (tok, bodyTok ->link ()); tok = tok->next ()) {
2922+ for (const Token* tok = mBodyTok ; precedes (tok, mBodyTok ->link ()); tok = tok->next ()) {
29232923 if (pred (tok))
29242924 return tok;
29252925 }
@@ -2934,7 +2934,7 @@ namespace {
29342934 }
29352935
29362936 bool valid () const {
2937- return bodyTok && loopVar ;
2937+ return mBodyTok && mLoopVar ;
29382938 }
29392939
29402940 public:
@@ -2943,7 +2943,7 @@ namespace {
29432943 if (!valid ())
29442944 return " " ;
29452945 bool loopVarChanged = isLoopVarChanged ();
2946- if (!loopVarChanged && varsChanged .empty ()) {
2946+ if (!loopVarChanged && mVarsChanged .empty ()) {
29472947 if (hasGotoOrBreak ())
29482948 return " " ;
29492949 bool alwaysTrue = true ;
@@ -2976,16 +2976,16 @@ namespace {
29762976 return false ;
29772977 if (var->isPointer () || var->isReference ())
29782978 return false ;
2979- if (var->declarationId () == loopVar ->varId ())
2979+ if (var->declarationId () == mLoopVar ->varId ())
29802980 return false ;
29812981 const Scope* scope = var->scope ();
2982- return scope && scope->isNestedIn (bodyTok ->scope ());
2982+ return scope && scope->isNestedIn (mBodyTok ->scope ());
29832983 }
29842984
29852985 void findChangedVariables ()
29862986 {
29872987 std::set<nonneg int > vars;
2988- for (const Token* tok = bodyTok ; precedes (tok, bodyTok ->link ()); tok = tok->next ()) {
2988+ for (const Token* tok = mBodyTok ; precedes (tok, mBodyTok ->link ()); tok = tok->next ()) {
29892989 if (tok->varId () == 0 )
29902990 continue ;
29912991 if (vars.count (tok->varId ()) > 0 )
@@ -2996,7 +2996,7 @@ namespace {
29962996 }
29972997 if (!isModified (tok))
29982998 continue ;
2999- varsChanged .insert (tok->varId ());
2999+ mVarsChanged .insert (tok->varId ());
30003000 vars.insert (tok->varId ());
30013001 }
30023002 }
0 commit comments