From 653c7715a5d99d62ba8df258b5903f081b45a342 Mon Sep 17 00:00:00 2001 From: def Date: Sat, 22 Jan 2022 13:44:22 +0100 Subject: [PATCH] Add readability-avoid-const-params-in-decls --- .clang-tidy | 1 + src/engine/client/backend/opengl/opengl_sl_program.h | 6 +++--- src/engine/client/client.h | 2 +- src/engine/client/serverbrowser.h | 2 +- src/game/client/components/menus.h | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 9dd2e7993..fcc5ecf4e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -36,6 +36,7 @@ Checks: > -misc-static-assert, -misc-unused-parameters, modernize-loop-convert, + readability-avoid-const-params-in-decls, readability-qualified-auto, performance-*, -performance-no-int-to-ptr, diff --git a/src/engine/client/backend/opengl/opengl_sl_program.h b/src/engine/client/backend/opengl/opengl_sl_program.h index 0ff1ccb5b..abb0fbbd3 100644 --- a/src/engine/client/backend/opengl/opengl_sl_program.h +++ b/src/engine/client/backend/opengl/opengl_sl_program.h @@ -35,9 +35,9 @@ public: //Support various types void SetUniformVec2(int Loc, int Count, const float *pValue); void SetUniformVec4(int Loc, int Count, const float *pValue); - void SetUniform(int Loc, const int Value); - void SetUniform(int Loc, const bool Value); - void SetUniform(int Loc, const float Value); + void SetUniform(int Loc, int Value); + void SetUniform(int Loc, bool Value); + void SetUniform(int Loc, float Value); void SetUniform(int Loc, int Count, const float *pValues); //for performance reason we do not use SetUniform with using strings... save the Locations of the variables instead diff --git a/src/engine/client/client.h b/src/engine/client/client.h index fa61394fc..efdb3dbb6 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -504,7 +504,7 @@ public: virtual void DemoSliceBegin(); virtual void DemoSliceEnd(); virtual void DemoSlice(const char *pDstPath, CLIENTFUNC_FILTER pfnFilter, void *pUser); - virtual void SaveReplay(const int Length); + virtual void SaveReplay(int Length); virtual bool EditorHasUnsavedData() const { return m_pEditor->HasUnsavedData(); } diff --git a/src/engine/client/serverbrowser.h b/src/engine/client/serverbrowser.h index d998ea9f3..87927b471 100644 --- a/src/engine/client/serverbrowser.h +++ b/src/engine/client/serverbrowser.h @@ -229,7 +229,7 @@ private: static void Con_LeakIpAddress(IConsole::IResult *pResult, void *pUserData); void SetInfo(CServerEntry *pEntry, const CServerInfo &Info); - void SetLatency(const NETADDR Addr, int Latency); + void SetLatency(NETADDR Addr, int Latency); static void ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData); }; diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index d2147ccbb..6d1045830 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -87,8 +87,8 @@ class CMenus : public CComponent int DoButton_CheckBox(const void *pID, const char *pText, int Checked, const CUIRect *pRect); int DoButton_CheckBoxAutoVMarginAndSet(const void *pID, const char *pText, int *pValue, CUIRect *pRect, float VMargin); int DoButton_CheckBox_Number(const void *pID, const char *pText, int Checked, const CUIRect *pRect); - ColorHSLA DoLine_ColorPicker(int *pResetID, const float LineSize, const float WantedPickerPosition, const float LabelSize, const float BottomMargin, CUIRect *pMainRect, const char *pText, unsigned int *pColorValue, const ColorRGBA DefaultColor, bool CheckBoxSpacing = true, bool UseCheckBox = false, int *pCheckBoxValue = NULL); - void DoLaserPreview(const CUIRect *pRect, const ColorHSLA OutlineColor, const ColorHSLA InnerColor); + ColorHSLA DoLine_ColorPicker(int *pResetID, float LineSize, float WantedPickerPosition, float LabelSize, float BottomMargin, CUIRect *pMainRect, const char *pText, unsigned int *pColorValue, ColorRGBA DefaultColor, bool CheckBoxSpacing = true, bool UseCheckBox = false, int *pCheckBoxValue = NULL); + void DoLaserPreview(const CUIRect *pRect, ColorHSLA OutlineColor, ColorHSLA InnerColor); int DoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, bool UseScroll, int Current, int Min, int Max, int Step, float Scale, bool IsHex, float Round, ColorRGBA *Color); int DoButton_Icon(int ImageId, int SpriteId, const CUIRect *pRect); int DoButton_GridHeader(const void *pID, const char *pText, int Checked, const CUIRect *pRect);