| 136 | } |
| 137 | |
| 138 | static bool isParameterChanged(const Token *partok) |
| 139 | { |
| 140 | bool addressOf = Token::Match(partok, "[(,] &"); |
| 141 | int argumentNumber = 0; |
| 142 | const Token *ftok; |
| 143 | for (ftok = partok; ftok && ftok->str() != "("; ftok = ftok->previous()) { |
| 144 | if (ftok->str() == ")") |
| 145 | ftok = ftok->link(); |
| 146 | else if (argumentNumber == 0U && ftok->str() == "&") |
| 147 | addressOf = true; |
| 148 | else if (ftok->str() == ",") |
| 149 | argumentNumber++; |
| 150 | } |
| 151 | ftok = ftok ? ftok->previous() : nullptr; |
| 152 | if (!(ftok && ftok->function())) |
| 153 | return true; |
| 154 | const Variable *par = ftok->function()->getArgumentVar(argumentNumber); |
| 155 | if (!par) |
| 156 | return true; |
| 157 | if (par->isConst()) |
| 158 | return false; |
| 159 | if (addressOf || par->isReference() || par->isPointer()) |
| 160 | return true; |
| 161 | return false; |
| 162 | } |
| 163 | |
| 164 | /** parse scopes recursively */ |
| 165 | bool CheckConditionImpl::assignIfParseScope(const Token * const assignTok, |
no test coverage detected