From 3940eefc909a1612817325f04193c7ae7a6d34fc Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 13 Mar 2018 17:54:16 -0400 Subject: [PATCH] Update ConVar flags to use int64 everywhere. (alliedmodders/metamod-source#42) Still needs tier1 recompile. --- public/tier1/convar.h | 26 +++++++++++++------------- tier1/convar.cpp | 24 ++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/public/tier1/convar.h b/public/tier1/convar.h index 40df43749..75dd63104 100644 --- a/public/tier1/convar.h +++ b/public/tier1/convar.h @@ -133,7 +133,7 @@ class ConCommandBase public: ConCommandBase( void ); ConCommandBase( const char *pName, const char *pHelpString = 0, - int flags = 0 ); + int64 flags = 0 ); virtual ~ConCommandBase( void ); @@ -167,7 +167,7 @@ class ConCommandBase protected: virtual void Create( const char *pName, const char *pHelpString = 0, - int flags = 0 ); + int64 flags = 0 ); // Used internally by OneTimeInit to initialize/shutdown virtual void Init(); @@ -295,13 +295,13 @@ friend class CCvar; typedef ConCommandBase BaseClass; ConCommand( const char *pName, FnCommandCallback_t callback, - const char *pHelpString = 0, int flags = 0, FnCommandCompletionCallback completionFunc = 0 ); + const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 ); ConCommand(const char *pName, FnCommandCallbackV1_t callback, - const char *pHelpString = 0, int flags = 0, FnCommandCompletionCallback completionFunc = 0); + const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0); ConCommand(const char *pName, FnCommandCallbackV2_t callback, - const char *pHelpString = 0, int flags = 0, FnCommandCompletionCallback completionFunc = 0); + const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0); ConCommand( const char *pName, ICommandCallback *pCallback, - const char *pHelpString = 0, int flags = 0, ICommandCompletionCallback *pCommandCompletionCallback = 0 ); + const char *pHelpString = 0, int64 flags = 0, ICommandCompletionCallback *pCommandCompletionCallback = 0 ); virtual ~ConCommand( void ); @@ -367,15 +367,15 @@ friend class SplitScreenConVarRef; public: typedef ConCommandBase BaseClass; - ConVar( const char *pName, const char *pDefaultValue, int flags = 0); + ConVar( const char *pName, const char *pDefaultValue, int64 flags = 0); - ConVar( const char *pName, const char *pDefaultValue, int flags, + ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString ); - ConVar( const char *pName, const char *pDefaultValue, int flags, + ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax ); - ConVar( const char *pName, const char *pDefaultValue, int flags, + ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, FnChangeCallback_t callback ); - ConVar( const char *pName, const char *pDefaultValue, int flags, + ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback ); @@ -470,7 +470,7 @@ friend class SplitScreenConVarRef; virtual bool ClampValue( float& value ); virtual void ChangeStringValue( const char *tempVal, float flOldValue ); - virtual void Create( const char *pName, const char *pDefaultValue, int flags = 0, + virtual void Create( const char *pName, const char *pDefaultValue, int64 flags = 0, const char *pHelpString = 0, bool bMin = false, float fMin = 0.0, bool bMax = false, float fMax = false, FnChangeCallback_t callback = 0 ); @@ -920,7 +920,7 @@ class CConCommandMemberAccessor : public ConCommand, public ICommandCallback, pu public: CConCommandMemberAccessor( T* pOwner, const char *pName, FnMemberCommandCallback_t callback, const char *pHelpString = 0, - int flags = 0, FnMemberCommandCompletionCallback_t completionFunc = 0 ) : + int64 flags = 0, FnMemberCommandCompletionCallback_t completionFunc = 0 ) : BaseClass( pName, this, pHelpString, flags, ( completionFunc != 0 ) ? this : NULL ) { m_pOwner = pOwner; diff --git a/tier1/convar.cpp b/tier1/convar.cpp index b42830284..5ddb9ab5d 100644 --- a/tier1/convar.cpp +++ b/tier1/convar.cpp @@ -113,7 +113,7 @@ ConCommandBase::ConCommandBase( void ) // *pHelpString - help text // flags - flags //----------------------------------------------------------------------------- -ConCommandBase::ConCommandBase( const char *pName, const char *pHelpString /*=0*/, int flags /*= 0*/ ) +ConCommandBase::ConCommandBase( const char *pName, const char *pHelpString /*=0*/, int64 flags /*= 0*/ ) { Create( pName, pHelpString, flags ); } @@ -152,7 +152,7 @@ CVarDLLIdentifier_t ConCommandBase::GetDLLIdentifier() const // *pHelpString - // flags - //----------------------------------------------------------------------------- -void ConCommandBase::Create( const char *pName, const char *pHelpString /*= 0*/, int flags /*= 0*/ ) +void ConCommandBase::Create( const char *pName, const char *pHelpString /*= 0*/, int64 flags /*= 0*/ ) { static const char *empty_string = ""; @@ -512,7 +512,7 @@ int DefaultCompletionFunc( const char *partial, CUtlVector< CUtlString > &comman } -ConCommand::ConCommand( const char *pName, FnCommandCallback_t callback, const char *pHelpString /*= 0*/, int flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/ ) +ConCommand::ConCommand( const char *pName, FnCommandCallback_t callback, const char *pHelpString /*= 0*/, int64 flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/ ) { // Add the callback if (callback) @@ -536,7 +536,7 @@ ConCommand::ConCommand( const char *pName, FnCommandCallback_t callback, const c BaseClass::Create( pName, pHelpString, flags ); } -ConCommand::ConCommand(const char *pName, FnCommandCallbackV1_t callback, const char *pHelpString /*= 0*/, int flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/) +ConCommand::ConCommand(const char *pName, FnCommandCallbackV1_t callback, const char *pHelpString /*= 0*/, int64 flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/) { // Add the callback if (callback) @@ -560,7 +560,7 @@ ConCommand::ConCommand(const char *pName, FnCommandCallbackV1_t callback, const BaseClass::Create(pName, pHelpString, flags); } -ConCommand::ConCommand(const char *pName, FnCommandCallbackV2_t callback, const char *pHelpString /*= 0*/, int flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/) +ConCommand::ConCommand(const char *pName, FnCommandCallbackV2_t callback, const char *pHelpString /*= 0*/, int64 flags /*= 0*/, FnCommandCompletionCallback completionFunc /*= 0*/) { // Add the callback if (callback) @@ -584,7 +584,7 @@ ConCommand::ConCommand(const char *pName, FnCommandCallbackV2_t callback, const BaseClass::Create(pName, pHelpString, flags); } -ConCommand::ConCommand( const char *pName, ICommandCallback *pCallback, const char *pHelpString /*= 0*/, int flags /*= 0*/, ICommandCompletionCallback *pCompletionCallback /*= 0*/ ) +ConCommand::ConCommand( const char *pName, ICommandCallback *pCallback, const char *pHelpString /*= 0*/, int64 flags /*= 0*/, ICommandCompletionCallback *pCompletionCallback /*= 0*/ ) { // Add the callback iface if (pCallback) @@ -701,27 +701,27 @@ bool ConCommand::CanAutoComplete( void ) //----------------------------------------------------------------------------- // Various constructors //----------------------------------------------------------------------------- -ConVar::ConVar( const char *pName, const char *pDefaultValue, int flags /* = 0 */ ) +ConVar::ConVar( const char *pName, const char *pDefaultValue, int64 flags /* = 0 */ ) { Create( pName, pDefaultValue, flags ); } -ConVar::ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString ) +ConVar::ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString ) { Create( pName, pDefaultValue, flags, pHelpString ); } -ConVar::ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax ) +ConVar::ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax ) { Create( pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax ); } -ConVar::ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString, FnChangeCallback_t callback ) +ConVar::ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, FnChangeCallback_t callback ) { Create( pName, pDefaultValue, flags, pHelpString, false, 0.0, false, 0.0, callback ); } -ConVar::ConVar( const char *pName, const char *pDefaultValue, int flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback ) +ConVar::ConVar( const char *pName, const char *pDefaultValue, int64 flags, const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback ) { Create( pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax, callback ); } @@ -1010,7 +1010,7 @@ float ConVar::GetFloatVirtualized() const //----------------------------------------------------------------------------- // Purpose: Private creation //----------------------------------------------------------------------------- -void ConVar::Create( const char *pName, const char *pDefaultValue, int flags /*= 0*/, +void ConVar::Create( const char *pName, const char *pDefaultValue, int64 flags /*= 0*/, const char *pHelpString /*= NULL*/, bool bMin /*= false*/, float fMin /*= 0.0*/, bool bMax /*= false*/, float fMax /*= false*/, FnChangeCallback_t callback /*= NULL*/ ) {