diff --git a/gui/codeeditorstyle.cpp b/gui/codeeditorstyle.cpp index fc981ad40..509a9570b 100644 --- a/gui/codeeditorstyle.cpp +++ b/gui/codeeditorstyle.cpp @@ -32,16 +32,17 @@ CodeEditorStyle::CodeEditorStyle( // cppcheck-suppress naming-varname - TODO: fix this QColor LnNumFGColor, QColor LnNumBGColor, // cppcheck-suppress naming-varname - TODO: fix this - QColor KeyWdFGColor, const QFont::Weight& KeyWdWeight, + QColor KeyWdFGColor, QFont::Weight KeyWdWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor ClsFGColor, const QFont::Weight& ClsWeight, + QColor ClsFGColor, QFont::Weight ClsWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor QteFGColor, const QFont::Weight& QteWeight, + QColor QteFGColor, QFont::Weight QteWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor CmtFGColor, const QFont::Weight& CmtWeight, + QColor CmtFGColor, QFont::Weight CmtWeight, // cppcheck-suppress naming-varname - TODO: fix this QColor SymbFGColor, QColor SymbBGColor, - const QFont::Weight& SymbWeight) : + // cppcheck-suppress naming-varname - TODO: fix this + QFont::Weight SymbWeight) : widgetFGColor(std::move(CtrlFGColor)), widgetBGColor(std::move(CtrlBGColor)), highlightBGColor(std::move(HiLiBGColor)), diff --git a/gui/codeeditorstyle.h b/gui/codeeditorstyle.h index 392602b9a..a700aa810 100644 --- a/gui/codeeditorstyle.h +++ b/gui/codeeditorstyle.h @@ -58,16 +58,17 @@ public: // cppcheck-suppress naming-varname - TODO: fix this QColor LnNumFGColor, QColor LnNumBGColor, // cppcheck-suppress naming-varname - TODO: fix this - QColor KeyWdFGColor, const QFont::Weight& KeyWdWeight, + QColor KeyWdFGColor, QFont::Weight KeyWdWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor ClsFGColor, const QFont::Weight& ClsWeight, + QColor ClsFGColor, QFont::Weight ClsWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor QteFGColor, const QFont::Weight& QteWeight, + QColor QteFGColor, QFont::Weight QteWeight, // cppcheck-suppress naming-varname - TODO: fix this - QColor CmtFGColor, const QFont::Weight& CmtWeight, + QColor CmtFGColor, QFont::Weight CmtWeight, // cppcheck-suppress naming-varname - TODO: fix this QColor SymbFGColor, QColor SymbBGColor, - const QFont::Weight& SymbWeight); + // cppcheck-suppress naming-varname - TODO: fix this + QFont::Weight SymbWeight); bool operator==(const CodeEditorStyle& rhs) const; bool operator!=(const CodeEditorStyle& rhs) const; diff --git a/gui/codeeditstylecontrols.cpp b/gui/codeeditstylecontrols.cpp index 8cd4465c5..8d5c3ec9c 100644 --- a/gui/codeeditstylecontrols.cpp +++ b/gui/codeeditstylecontrols.cpp @@ -113,7 +113,7 @@ void SelectFontWeightCombo::changeWeight(int index) } } -void SelectFontWeightCombo::setWeight(const QFont::Weight& weight) +void SelectFontWeightCombo::setWeight(QFont::Weight weight) { mWeight = weight; updateWeight(); diff --git a/gui/codeeditstylecontrols.h b/gui/codeeditstylecontrols.h index 7285598ad..719d84d2a 100644 --- a/gui/codeeditstylecontrols.h +++ b/gui/codeeditstylecontrols.h @@ -57,12 +57,12 @@ class SelectFontWeightCombo : public QComboBox { public: explicit SelectFontWeightCombo(QWidget* parent); - void setWeight(const QFont::Weight& weight); + void setWeight(QFont::Weight weight); const QFont::Weight& getWeight(); signals: // NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) - caused by generated MOC code - void weightChanged(const QFont::Weight& newWeight); + void weightChanged(QFont::Weight newWeight); public slots: void updateWeight(); diff --git a/gui/codeeditstyledialog.cpp b/gui/codeeditstyledialog.cpp index fe159fc30..dc2dd0ff1 100644 --- a/gui/codeeditstyledialog.cpp +++ b/gui/codeeditstyledialog.cpp @@ -296,7 +296,7 @@ void StyleEditDialog::colorChangedKeywordFG(const QColor& newColor) updateStyle(); } -void StyleEditDialog::weightChangedKeyword(const QFont::Weight& newWeight) +void StyleEditDialog::weightChangedKeyword(QFont::Weight newWeight) { mStyleOutgoing.keywordWeight = newWeight; updateStyle(); @@ -308,7 +308,7 @@ void StyleEditDialog::colorChangedClassFG(const QColor& newColor) updateStyle(); } -void StyleEditDialog::weightChangedClass(const QFont::Weight& newWeight) +void StyleEditDialog::weightChangedClass(QFont::Weight newWeight) { mStyleOutgoing.classWeight = newWeight; updateStyle(); @@ -320,7 +320,7 @@ void StyleEditDialog::colorChangedQuoteFG(const QColor& newColor) updateStyle(); } -void StyleEditDialog::weightChangedQuote(const QFont::Weight& newWeight) +void StyleEditDialog::weightChangedQuote(QFont::Weight newWeight) { mStyleOutgoing.quoteWeight = newWeight; updateStyle(); @@ -332,7 +332,7 @@ void StyleEditDialog::colorChangedCommentFG(const QColor& newColor) updateStyle(); } -void StyleEditDialog::weightChangedComment(const QFont::Weight& newWeight) +void StyleEditDialog::weightChangedComment(QFont::Weight newWeight) { mStyleOutgoing.commentWeight = newWeight; updateStyle(); @@ -350,7 +350,7 @@ void StyleEditDialog::colorChangedSymbolBG(const QColor& newColor) updateStyle(); } -void StyleEditDialog::weightChangedSymbol(const QFont::Weight& newWeight) +void StyleEditDialog::weightChangedSymbol(QFont::Weight newWeight) { mStyleOutgoing.symbolWeight = newWeight; updateStyle(); diff --git a/gui/codeeditstyledialog.h b/gui/codeeditstyledialog.h index c4aeffc99..331795d4f 100644 --- a/gui/codeeditstyledialog.h +++ b/gui/codeeditstyledialog.h @@ -59,16 +59,16 @@ public slots: void colorChangedLineNumFG(const QColor& newColor); void colorChangedLineNumBG(const QColor& newColor); void colorChangedKeywordFG(const QColor& newColor); - void weightChangedKeyword(const QFont::Weight& newWeight); + void weightChangedKeyword(QFont::Weight newWeight); void colorChangedClassFG(const QColor& newColor); - void weightChangedClass(const QFont::Weight& newWeight); + void weightChangedClass(QFont::Weight newWeight); void colorChangedQuoteFG(const QColor& newColor); - void weightChangedQuote(const QFont::Weight& newWeight); + void weightChangedQuote(QFont::Weight newWeight); void colorChangedCommentFG(const QColor& newColor); - void weightChangedComment(const QFont::Weight& newWeight); + void weightChangedComment(QFont::Weight newWeight); void colorChangedSymbolFG(const QColor& newColor); void colorChangedSymbolBG(const QColor& newColor); - void weightChangedSymbol(const QFont::Weight& newWeight); + void weightChangedSymbol(QFont::Weight newWeight); private: CodeEditorStyle mStyleIncoming; diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 4c6a1224f..dd611356d 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -65,7 +65,7 @@ static const struct CWE CWE825(825U); // Expired Pointer Dereference static const struct CWE CWE833(833U); // Deadlock static const struct CWE CWE834(834U); // Excessive Iteration -static bool isElementAccessYield(const Library::Container::Yield& yield) +static bool isElementAccessYield(Library::Container::Yield yield) { return contains({Library::Container::Yield::ITEM, Library::Container::Yield::AT_INDEX}, yield); } diff --git a/lib/color.cpp b/lib/color.cpp index a8f10462e..20c3d7e37 100644 --- a/lib/color.cpp +++ b/lib/color.cpp @@ -40,7 +40,7 @@ static bool isStreamATty(const std::ostream & os) } #endif -std::ostream& operator<<(std::ostream & os, const Color& c) +std::ostream& operator<<(std::ostream & os, Color c) { #ifndef _WIN32 if (!gDisableColors && isStreamATty(os)) @@ -51,7 +51,7 @@ std::ostream& operator<<(std::ostream & os, const Color& c) return os; } -std::string toString(const Color& c) +std::string toString(Color c) { #ifndef _WIN32 std::stringstream ss; diff --git a/lib/color.h b/lib/color.h index dfd47b567..247de2992 100644 --- a/lib/color.h +++ b/lib/color.h @@ -34,9 +34,9 @@ enum class Color { FgMagenta = 35, FgDefault = 39 }; -CPPCHECKLIB std::ostream& operator<<(std::ostream& os, const Color& c); +CPPCHECKLIB std::ostream& operator<<(std::ostream& os, Color c); -CPPCHECKLIB std::string toString(const Color& c); +CPPCHECKLIB std::string toString(Color c); extern CPPCHECKLIB bool gDisableColors; // for testing diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 28a505362..b1f50440f 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -3662,7 +3662,7 @@ static std::ostream & operator << (std::ostream & s, Scope::ScopeType type) return s; } -static std::string accessControlToString(const AccessControl& access) +static std::string accessControlToString(AccessControl access) { switch (access) { case AccessControl::Public: diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 3e44a1cfd..82edfe5e9 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7965,7 +7965,7 @@ void Tokenizer::unhandledCharLiteral(const Token *tok, const std::string& msg) c * @param floatConstant the string with stringified float constant to check against * @return true in case s is equal to X or X.0 and false otherwise. */ -static bool isNumberOneOf(const std::string &s, const MathLib::bigint& intConstant, const char* floatConstant) +static bool isNumberOneOf(const std::string &s, MathLib::bigint intConstant, const char* floatConstant) { if (MathLib::isInt(s)) { if (MathLib::toLongNumber(s) == intConstant)