From dc63dd6ada66057cb6e6a1ed56122a70f9704658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 1 Feb 2021 19:31:30 +0100 Subject: [PATCH] Fix Cppcheck self check warnings --- lib/checkclass.cpp | 8 ++++---- lib/checkclass.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 34d3dc20f..3246df362 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -568,15 +568,15 @@ void CheckClass::initVar(std::vector &usageList, nonneg int varid) } } -void CheckClass::assignAllVar(std::vector &usage) +void CheckClass::assignAllVar(std::vector &usageList) { - for (Usage & i : usage) + for (Usage & i : usageList) i.assign = true; } -void CheckClass::clearAllVar(std::vector &usage) +void CheckClass::clearAllVar(std::vector &usageList) { - for (Usage & i : usage) { + for (Usage & i : usageList) { i.assign = false; i.init = false; } diff --git a/lib/checkclass.h b/lib/checkclass.h index 6be4cf6d9..cc77d9f6a 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -274,7 +274,7 @@ private: // constructors helper function /** @brief Information about a member variable. Used when checking for uninitialized variables */ struct Usage { - Usage(const Variable *var) : var(var), assign(false), init(false) { } + explicit Usage(const Variable *var) : var(var), assign(false), init(false) { } /** Variable that this usage is for */ const Variable *var;