From 3c809ae9b05401e32cdef0086fe3c4675e2fa273 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Tue, 26 Jun 2007 19:29:24 +0000 Subject: [PATCH] Made some things const in convar_sm.h --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401026 --- core/CoreConfig.cpp | 3 +-- core/convar_sm.h | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index 933aa30d..65bcf334 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -247,8 +247,7 @@ bool SM_ExecuteConfig(CPlugin *pl, AutoConfig *cfg, bool can_create) float x; for (iter = convars->begin(); iter != convars->end(); iter++) { - //:TODO: GetFlags should probably be const so we don't have to do this! - ConVar *cvar = (ConVar *)(*iter); + const ConVar *cvar = (*iter); if ((cvar->GetFlags() & FCVAR_DONTRECORD) == FCVAR_DONTRECORD) { diff --git a/core/convar_sm.h b/core/convar_sm.h index 114786e9..0981bb3d 100644 --- a/core/convar_sm.h +++ b/core/convar_sm.h @@ -200,7 +200,7 @@ protected: static IConCommandBaseAccessor *s_pAccessor; public: // Hackalicous - inline int GetFlags() + inline int GetFlags() const { return m_nFlags; } @@ -252,7 +252,7 @@ private: FnCommandCompletionCallback m_fnCompletionCallback; bool m_bHasCompletionCallback; public: // Hackalicous - inline FnCommandCallback GetCallback() + inline FnCommandCallback GetCallback() const { return m_fnCommandCallback; } @@ -369,16 +369,16 @@ private: // Call this function when ConVar changes FnChangeCallback m_fnChangeCallback; public: // Hackalicous - inline FnChangeCallback GetCallback() + inline FnChangeCallback GetCallback() const { return m_fnChangeCallback; } - inline void SetMin(bool set, float min) + inline void SetMin(bool set, float min=0.0) { m_bHasMin = set; m_fMinVal = min; } - inline void SetMax(bool set, float max) + inline void SetMax(bool set, float max=0.0) { m_bHasMax = set; m_fMaxVal = max;