@@ -212,7 +212,7 @@ const Token* getParentLifetime(const Token* tok);
212212const Token* getParentLifetime (const Token* tok, const Library& library);
213213
214214std::vector<ValueType> getParentValueTypes (const Token* tok,
215- const Settings* settings = nullptr ,
215+ const Settings& settings,
216216 const Token** parent = nullptr );
217217
218218bool astIsLHS (const Token* tok);
@@ -262,7 +262,7 @@ SmallVector<ReferenceToken> followAllReferences(const Token* tok,
262262 int depth = 20 );
263263const Token* followReferences (const Token* tok, ErrorPath* errors = nullptr );
264264
265- CPPCHECKLIB bool isSameExpression (bool macro, const Token *tok1, const Token *tok2, const Library& library , bool pure, bool followVar, ErrorPath* errors=nullptr );
265+ CPPCHECKLIB bool isSameExpression (bool macro, const Token *tok1, const Token *tok2, const Settings& settings , bool pure, bool followVar, ErrorPath* errors=nullptr );
266266
267267bool isEqualKnownValue (const Token * const tok1, const Token * const tok2);
268268
@@ -273,7 +273,7 @@ const Token* isInLoopCondition(const Token* tok);
273273/* *
274274 * Is token used as boolean, that is to say cast to a bool, or used as a condition in a if/while/for
275275 */
276- CPPCHECKLIB bool isUsedAsBool (const Token* const tok, const Settings* settings = nullptr );
276+ CPPCHECKLIB bool isUsedAsBool (const Token* const tok, const Settings& settings);
277277
278278/* *
279279 * Are the tokens' flags equal?
@@ -285,12 +285,12 @@ bool compareTokenFlags(const Token* tok1, const Token* tok2, bool macro);
285285 * @param isNot do you want to know if cond1 is !cond2 or if cond1 and cond2 are non-overlapping. true: cond1==!cond2 false: cond1==true => cond2==false
286286 * @param cond1 condition1
287287 * @param cond2 condition2
288- * @param library files data
288+ * @param settings settings
289289 * @param pure boolean
290290 */
291- bool isOppositeCond (bool isNot, const Token * const cond1, const Token * const cond2, const Library& library , bool pure, bool followVar, ErrorPath* errors=nullptr );
291+ bool isOppositeCond (bool isNot, const Token * const cond1, const Token * const cond2, const Settings& settings , bool pure, bool followVar, ErrorPath* errors=nullptr );
292292
293- bool isOppositeExpression (const Token * const tok1, const Token * const tok2, const Library& library , bool pure, bool followVar, ErrorPath* errors=nullptr );
293+ bool isOppositeExpression (const Token * const tok1, const Token * const tok2, const Settings& settings , bool pure, bool followVar, ErrorPath* errors=nullptr );
294294
295295bool isConstFunctionCall (const Token* ftok, const Library& library);
296296
@@ -328,7 +328,7 @@ std::vector<const Variable*> getArgumentVars(const Token* tok, int argnr);
328328 * @param settings program settings
329329 * @param inconclusive pointer to output variable which indicates that the answer of the question is inconclusive
330330 */
331- bool isVariableChangedByFunctionCall (const Token *tok, int indirect, nonneg int varid, const Settings * settings, bool *inconclusive);
331+ bool isVariableChangedByFunctionCall (const Token *tok, int indirect, nonneg int varid, const Settings & settings, bool *inconclusive);
332332
333333/* * Is variable changed by function call?
334334 * In case the answer of the question is inconclusive, e.g. because the function declaration is not known
@@ -338,46 +338,45 @@ bool isVariableChangedByFunctionCall(const Token *tok, int indirect, nonneg int
338338 * @param settings program settings
339339 * @param inconclusive pointer to output variable which indicates that the answer of the question is inconclusive
340340 */
341- CPPCHECKLIB bool isVariableChangedByFunctionCall (const Token *tok, int indirect, const Settings * settings, bool *inconclusive);
341+ CPPCHECKLIB bool isVariableChangedByFunctionCall (const Token *tok, int indirect, const Settings & settings, bool *inconclusive);
342342
343343/* * Is variable changed in block of code? */
344- CPPCHECKLIB bool isVariableChanged (const Token *start, const Token *end, const nonneg int exprid, bool globalvar, const Settings * settings, int depth = 20 );
345- bool isVariableChanged (const Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings * settings, int depth = 20 );
344+ CPPCHECKLIB bool isVariableChanged (const Token *start, const Token *end, const nonneg int exprid, bool globalvar, const Settings & settings, int depth = 20 );
345+ bool isVariableChanged (const Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings & settings, int depth = 20 );
346346
347- bool isVariableChanged (const Token *tok, int indirect, const Settings * settings, int depth = 20 );
347+ bool isVariableChanged (const Token *tok, int indirect, const Settings & settings, int depth = 20 );
348348
349- bool isVariableChanged (const Variable * var, const Settings * settings, int depth = 20 );
349+ bool isVariableChanged (const Variable * var, const Settings & settings, int depth = 20 );
350350
351351bool isVariablesChanged (const Token* start,
352352 const Token* end,
353353 int indirect,
354354 const std::vector<const Variable*> &vars,
355- const Settings* settings);
355+ const Settings& settings);
356356
357- bool isThisChanged (const Token* tok, int indirect, const Settings* settings);
358- const Token* findThisChanged (const Token* start, const Token* end, int indirect, const Settings* settings);
357+ bool isThisChanged (const Token* tok, int indirect, const Settings& settings);
359358
360- const Token* findVariableChanged (const Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings * settings, int depth = 20 );
361- Token* findVariableChanged (Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings * settings, int depth = 20 );
359+ const Token* findVariableChanged (const Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings & settings, int depth = 20 );
360+ Token* findVariableChanged (Token *start, const Token *end, int indirect, const nonneg int exprid, bool globalvar, const Settings & settings, int depth = 20 );
362361
363362CPPCHECKLIB const Token* findExpressionChanged (const Token* expr,
364363 const Token* start,
365364 const Token* end,
366- const Settings* settings,
365+ const Settings& settings,
367366 int depth = 20 );
368367
369368const Token* findExpressionChangedSkipDeadCode (const Token* expr,
370369 const Token* start,
371370 const Token* end,
372- const Settings* settings,
371+ const Settings& settings,
373372 const std::function<std::vector<MathLib::bigint>(const Token* tok)>& evaluate,
374373 int depth = 20);
375374
376375bool isExpressionChangedAt (const Token* expr,
377376 const Token* tok,
378377 int indirect,
379378 bool globalvar,
380- const Settings* settings,
379+ const Settings& settings,
381380 int depth = 20 );
382381
383382// / If token is an alias if another variable
0 commit comments