From 043b8f255fbf69e06f8383cf55913cc277fe9edc Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 15 Mar 2007 04:34:42 +0000 Subject: [PATCH] removed const from most apis. it was pointless since there were no actual const pointers. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40621 --- core/PlayerManager.cpp | 18 +++++++++--------- core/PlayerManager.h | 18 +++++++++--------- core/systems/ForwardSys.cpp | 6 +++--- core/systems/ForwardSys.h | 6 +++--- core/systems/PluginSys.cpp | 28 ++++++++++++++-------------- core/systems/PluginSys.h | 28 ++++++++++++++-------------- public/IForwardSys.h | 6 +++--- public/IPlayerHelpers.h | 16 ++++++++-------- public/IPluginSys.h | 20 ++++++++++---------- 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 0b9581c3..53a528f2 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -467,42 +467,42 @@ void CPlayer::SetName(const char *name) m_Name.assign(name); } -const char *CPlayer::GetName() const +const char *CPlayer::GetName() { return m_Name.c_str(); } -const char *CPlayer::GetIPAddress() const +const char *CPlayer::GetIPAddress() { return m_Ip.c_str(); } -const char *CPlayer::GetAuthString() const +const char *CPlayer::GetAuthString() { return m_AuthID.c_str(); } -edict_t *CPlayer::GetEdict() const +edict_t *CPlayer::GetEdict() { return m_pEdict; } -bool CPlayer::IsInGame() const +bool CPlayer::IsInGame() { return m_IsInGame; } -bool CPlayer::IsConnected() const +bool CPlayer::IsConnected() { return m_IsConnected; } -bool CPlayer::IsAuthorized() const +bool CPlayer::IsAuthorized() { return m_IsAuthorized; } -bool CPlayer::IsFakeClient() const +bool CPlayer::IsFakeClient() { return (strcmp(m_AuthID.c_str(), "BOT") == 0); } @@ -520,7 +520,7 @@ void CPlayer::SetAdminId(AdminId id, bool temporary) m_TempAdmin = temporary; } -AdminId CPlayer::GetAdminId() const +AdminId CPlayer::GetAdminId() { return m_Admin; } diff --git a/core/PlayerManager.h b/core/PlayerManager.h index afdbd884..87632aa5 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -32,16 +32,16 @@ class CPlayer : public IGamePlayer public: CPlayer(); public: - const char *GetName() const; - const char *GetIPAddress() const; - const char *GetAuthString() const; - edict_t *GetEdict() const; - bool IsInGame() const; - bool IsConnected() const; - bool IsAuthorized() const; - bool IsFakeClient() const; + const char *GetName(); + const char *GetIPAddress(); + const char *GetAuthString(); + edict_t *GetEdict(); + bool IsInGame(); + bool IsConnected(); + bool IsAuthorized(); + bool IsFakeClient(); void SetAdminId(AdminId id, bool temporary); - AdminId GetAdminId() const; + AdminId GetAdminId(); private: void Initialize(const char *name, const char *ip, edict_t *pEntity); void Connect(); diff --git a/core/systems/ForwardSys.cpp b/core/systems/ForwardSys.cpp index 1cbcccd9..ae18abdf 100644 --- a/core/systems/ForwardSys.cpp +++ b/core/systems/ForwardSys.cpp @@ -671,17 +671,17 @@ bool CForward::AddFunction(IPluginFunction *func) return true; } -const char *CForward::GetForwardName() const +const char *CForward::GetForwardName() { return m_name; } -unsigned int CForward::GetFunctionCount() const +unsigned int CForward::GetFunctionCount() { return m_functions.size(); } -ExecType CForward::GetExecType() const +ExecType CForward::GetExecType() { return m_ExecType; } diff --git a/core/systems/ForwardSys.h b/core/systems/ForwardSys.h index 2dbde5c8..b1d8703a 100644 --- a/core/systems/ForwardSys.h +++ b/core/systems/ForwardSys.h @@ -55,9 +55,9 @@ public: //ICallable virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags); virtual void Cancel(); public: //IForward - virtual const char *GetForwardName() const; - virtual unsigned int GetFunctionCount() const; - virtual ExecType GetExecType() const; + virtual const char *GetForwardName(); + virtual unsigned int GetFunctionCount(); + virtual ExecType GetExecType(); virtual int Execute(cell_t *result, IForwardFilter *filter); public: //IChangeableForward virtual bool RemoveFunction(IPluginFunction *func); diff --git a/core/systems/PluginSys.cpp b/core/systems/PluginSys.cpp index 235d6499..95b4f4e7 100644 --- a/core/systems/PluginSys.cpp +++ b/core/systems/PluginSys.cpp @@ -349,47 +349,47 @@ bool CPlugin::Call_AskPluginLoad(char *error, size_t maxlength) return true; } -const sp_plugin_t *CPlugin::GetPluginStructure() const +const sp_plugin_t *CPlugin::GetPluginStructure() { return m_plugin; } -IPluginContext *CPlugin::GetBaseContext() const +IPluginContext *CPlugin::GetBaseContext() { return m_ctx.base; } -sp_context_t *CPlugin::GetContext() const +sp_context_t *CPlugin::GetContext() { return m_ctx.ctx; } -const char *CPlugin::GetFilename() const +const char *CPlugin::GetFilename() { return m_filename; } -PluginType CPlugin::GetType() const +PluginType CPlugin::GetType() { return m_type; } -const sm_plugininfo_t *CPlugin::GetPublicInfo() const +const sm_plugininfo_t *CPlugin::GetPublicInfo() { return &m_info; } -unsigned int CPlugin::GetSerial() const +unsigned int CPlugin::GetSerial() { return m_serial; } -PluginStatus CPlugin::GetStatus() const +PluginStatus CPlugin::GetStatus() { return m_status; } -bool CPlugin::IsDebugging() const +bool CPlugin::IsDebugging() { if (!m_ctx.ctx) { @@ -430,7 +430,7 @@ bool CPlugin::SetPauseState(bool paused) return true; } -IdentityToken_t *CPlugin::GetIdentity() const +IdentityToken_t *CPlugin::GetIdentity() { return m_ident; } @@ -501,7 +501,7 @@ bool CPlugin::ToggleDebugMode(bool debug, char *error, size_t maxlength) return true; } -bool CPlugin::IsRunnable() const +bool CPlugin::IsRunnable() { return (m_status <= Plugin_Paused) ? true : false; } @@ -524,7 +524,7 @@ time_t CPlugin::GetFileTimeStamp() } } -time_t CPlugin::GetTimeStamp() const +time_t CPlugin::GetTimeStamp() { return m_LastAccess; } @@ -539,12 +539,12 @@ void CPlugin::AddLangFile(unsigned int index) m_PhraseFiles.push_back(index); } -size_t CPlugin::GetLangFileCount() const +size_t CPlugin::GetLangFileCount() { return m_PhraseFiles.size(); } -unsigned int CPlugin::GetLangFileByIndex(unsigned int index) const +unsigned int CPlugin::GetLangFileByIndex(unsigned int index) { return m_PhraseFiles.at(index); } diff --git a/core/systems/PluginSys.h b/core/systems/PluginSys.h index 39634ac2..d68340c2 100644 --- a/core/systems/PluginSys.h +++ b/core/systems/PluginSys.h @@ -116,17 +116,17 @@ public: CPlugin(const char *file); ~CPlugin(); public: - virtual PluginType GetType() const; - virtual SourcePawn::IPluginContext *GetBaseContext() const; - virtual sp_context_t *GetContext() const; - virtual const sm_plugininfo_t *GetPublicInfo() const; - virtual const char *GetFilename() const; - virtual bool IsDebugging() const; - virtual PluginStatus GetStatus() const; + virtual PluginType GetType(); + virtual SourcePawn::IPluginContext *GetBaseContext(); + virtual sp_context_t *GetContext(); + virtual const sm_plugininfo_t *GetPublicInfo(); + virtual const char *GetFilename(); + virtual bool IsDebugging(); + virtual PluginStatus GetStatus(); virtual bool SetPauseState(bool paused); - virtual unsigned int GetSerial() const; - virtual const sp_plugin_t *GetPluginStructure() const; - virtual IdentityToken_t *GetIdentity() const; + virtual unsigned int GetSerial(); + virtual const sp_plugin_t *GetPluginStructure(); + virtual IdentityToken_t *GetIdentity(); virtual bool SetProperty(const char *prop, void *ptr); virtual bool GetProperty(const char *prop, void **ptr, bool remove=false); public: @@ -189,7 +189,7 @@ public: /** * Returns true if a plugin is usable. */ - bool IsRunnable() const; + bool IsRunnable(); /** * Adds a language file index to the plugin's list. @@ -199,17 +199,17 @@ public: /** * Get language file count for this plugin. */ - size_t GetLangFileCount() const; + size_t GetLangFileCount(); /** * Get language file index based on the vector index. */ - unsigned int GetLangFileByIndex(unsigned int index) const; + unsigned int GetLangFileByIndex(unsigned int index); public: /** * Returns the modification time during last plugin load. */ - time_t GetTimeStamp() const; + time_t GetTimeStamp(); /** * Returns the current modification time of the plugin file. diff --git a/public/IForwardSys.h b/public/IForwardSys.h index a6e9b018..da188d27 100644 --- a/public/IForwardSys.h +++ b/public/IForwardSys.h @@ -146,21 +146,21 @@ namespace SourceMod * * @return Forward name. */ - virtual const char *GetForwardName() const =0; + virtual const char *GetForwardName() =0; /** * @brief Returns the number of functions in this forward. * * @return Number of functions in forward. */ - virtual unsigned int GetFunctionCount() const =0; + virtual unsigned int GetFunctionCount() =0; /** * @brief Returns the method of multi-calling this forward has. * * @return ExecType of the forward. */ - virtual ExecType GetExecType() const =0; + virtual ExecType GetExecType() =0; /** * @brief Executes the forward. diff --git a/public/IPlayerHelpers.h b/public/IPlayerHelpers.h index 91142e90..92dae146 100644 --- a/public/IPlayerHelpers.h +++ b/public/IPlayerHelpers.h @@ -45,7 +45,7 @@ namespace SourceMod * @return String containing the player's name, * or NULL if unavailable. */ - virtual const char *GetName() const =0; + virtual const char *GetName() =0; /** * @brief Returns the player's IP address. @@ -53,7 +53,7 @@ namespace SourceMod * @return String containing the player's IP address, * or NULL if unavailable. */ - virtual const char *GetIPAddress() const =0; + virtual const char *GetIPAddress() =0; /** * @brief Returns the player's authentication string. @@ -61,21 +61,21 @@ namespace SourceMod * @return String containing the player's auth string. * May be NULL if unavailable. */ - virtual const char *GetAuthString() const =0; + virtual const char *GetAuthString() =0; /** * @brief Returns the player's edict_t structure. * * @return edict_t pointer, or NULL if unavailable. */ - virtual edict_t *GetEdict() const =0; + virtual edict_t *GetEdict() =0; /** * @brief Returns whether the player is in game (putinserver). * * @return True if in game, false otherwise. */ - virtual bool IsInGame() const =0; + virtual bool IsInGame() =0; /** * @brief Returns whether the player is connected. @@ -85,21 +85,21 @@ namespace SourceMod * * @return True if connected, false otherwise. */ - virtual bool IsConnected() const =0; + virtual bool IsConnected() =0; /** * @brief Returns whether the player is a fake client. * * @return True if a fake client, false otherwise. */ - virtual bool IsFakeClient() const =0; + virtual bool IsFakeClient() =0; /** * @brief Returns the client's AdminId, if any. * * @return AdminId, or INVALID_ADMIN_ID if none. */ - virtual AdminId GetAdminId() const =0; + virtual AdminId GetAdminId() =0; /** * @brief Sets the client's AdminId. diff --git a/public/IPluginSys.h b/public/IPluginSys.h index 7cbcb5a9..f9154c3d 100644 --- a/public/IPluginSys.h +++ b/public/IPluginSys.h @@ -93,50 +93,50 @@ namespace SourceMod /** * @brief Returns the lifetime of a plugin. */ - virtual PluginType GetType() const =0; + virtual PluginType GetType() =0; /** * @brief Returns the current API context being used in the plugin. * * @return Pointer to an IPluginContext, or NULL if not loaded. */ - virtual SourcePawn::IPluginContext *GetBaseContext() const =0; + virtual SourcePawn::IPluginContext *GetBaseContext() =0; /** * @brief Returns the context structure being used in the plugin. * * @return Pointer to an sp_context_t, or NULL if not loaded. */ - virtual sp_context_t *GetContext() const =0; + virtual sp_context_t *GetContext() =0; /** * @brief Returns the plugin file structure. * * @return Pointer to an sp_plugin_t, or NULL if not loaded. */ - virtual const sp_plugin_t *GetPluginStructure() const =0; + virtual const sp_plugin_t *GetPluginStructure() =0; /** * @brief Returns information about the plugin by reference. * * @return Pointer to a sm_plugininfo_t object, NULL if plugin is not loaded. */ - virtual const sm_plugininfo_t *GetPublicInfo() const =0; + virtual const sm_plugininfo_t *GetPublicInfo() =0; /** * @brief Returns the plugin filename (relative to plugins dir). */ - virtual const char *GetFilename() const =0; + virtual const char *GetFilename() =0; /** * @brief Returns true if a plugin is in debug mode, false otherwise. */ - virtual bool IsDebugging() const =0; + virtual bool IsDebugging() =0; /** * @brief Returns the plugin status. */ - virtual PluginStatus GetStatus() const =0; + virtual PluginStatus GetStatus() =0; /** * @brief Sets whether the plugin is paused or not. @@ -148,12 +148,12 @@ namespace SourceMod /** * @brief Returns the unique serial number of a plugin. */ - virtual unsigned int GetSerial() const =0; + virtual unsigned int GetSerial() =0; /** * @brief Returns a plugin's identity token. */ - virtual IdentityToken_t *GetIdentity() const =0; + virtual IdentityToken_t *GetIdentity() =0; /** * @brief Sets a property on this plugin. This is used for per-plugin