Skip to content

Commit

Permalink
Update ConVar flags to use int64 everywhere. (alliedmodders/metamod-s…
Browse files Browse the repository at this point in the history
…ource#42)

Still needs tier1 recompile.
  • Loading branch information
psychonic committed Mar 13, 2018
1 parent 4405fd7 commit 3940eef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions public/tier1/convar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions tier1/convar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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 = "";

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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*/ )
{
Expand Down

0 comments on commit 3940eef

Please sign in to comment.