diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/public/dt_utlvector_common.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/public/dt_utlvector_common.cpp')
| -rw-r--r-- | mp/src/public/dt_utlvector_common.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/mp/src/public/dt_utlvector_common.cpp b/mp/src/public/dt_utlvector_common.cpp index a5de0666..08df842f 100644 --- a/mp/src/public/dt_utlvector_common.cpp +++ b/mp/src/public/dt_utlvector_common.cpp @@ -1,70 +1,70 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
-#include "dt_utlvector_common.h"
-#include "utldict.h"
-
-#include "tier0/memdbgon.h"
-
-static CUtlDict<int,int> *g_STDict = 0;
-static CUtlDict<int,int> *g_RTDict = 0;
-
-
-char* AllocateStringHelper2( const char *pFormat, va_list marker )
-{
- char str[512];
- _vsnprintf( str, sizeof( str ), pFormat, marker );
- str[ ARRAYSIZE(str) - 1 ] = 0;
-
- int len = strlen( str ) + 1;
- char *pRet = new char[len];
- memcpy( pRet, str, len );
-
- return pRet;
-}
-
-
-char* AllocateStringHelper( const char *pFormat, ... )
-{
- va_list marker;
- va_start( marker, pFormat );
- char *pRet = AllocateStringHelper2( pFormat, marker );
- va_end( marker );
-
- return pRet;
-}
-
-
-char* AllocateUniqueDataTableName( bool bSendTable, const char *pFormat, ... )
-{
- // Setup the string.
- va_list marker;
- va_start( marker, pFormat );
- char *pRet = AllocateStringHelper2( pFormat, marker );
- va_end( marker );
-
- // Make sure it's unique.
-#ifdef _DEBUG
- // Have to allocate them here because if they're declared as straight global variables,
- // their constructors won't have been called yet by the time we get in here.
- if ( !g_STDict )
- {
- g_STDict = new CUtlDict<int,int>;
- g_RTDict = new CUtlDict<int,int>;
- }
-
- CUtlDict<int,int> *pDict = bSendTable ? g_STDict : g_RTDict;
- if ( pDict->Find( pRet ) != pDict->InvalidIndex() )
- {
- // If it hits this, then they have 2 utlvectors in different data tables with the same name and the
- // same size limit. The names of
- Assert( false );
- }
- pDict->Insert( pRet, 0 );
-#endif
-
- return pRet;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "dt_utlvector_common.h" +#include "utldict.h" + +#include "tier0/memdbgon.h" + +static CUtlDict<int,int> *g_STDict = 0; +static CUtlDict<int,int> *g_RTDict = 0; + + +char* AllocateStringHelper2( const char *pFormat, va_list marker ) +{ + char str[512]; + _vsnprintf( str, sizeof( str ), pFormat, marker ); + str[ ARRAYSIZE(str) - 1 ] = 0; + + int len = strlen( str ) + 1; + char *pRet = new char[len]; + memcpy( pRet, str, len ); + + return pRet; +} + + +char* AllocateStringHelper( const char *pFormat, ... ) +{ + va_list marker; + va_start( marker, pFormat ); + char *pRet = AllocateStringHelper2( pFormat, marker ); + va_end( marker ); + + return pRet; +} + + +char* AllocateUniqueDataTableName( bool bSendTable, const char *pFormat, ... ) +{ + // Setup the string. + va_list marker; + va_start( marker, pFormat ); + char *pRet = AllocateStringHelper2( pFormat, marker ); + va_end( marker ); + + // Make sure it's unique. +#ifdef _DEBUG + // Have to allocate them here because if they're declared as straight global variables, + // their constructors won't have been called yet by the time we get in here. + if ( !g_STDict ) + { + g_STDict = new CUtlDict<int,int>; + g_RTDict = new CUtlDict<int,int>; + } + + CUtlDict<int,int> *pDict = bSendTable ? g_STDict : g_RTDict; + if ( pDict->Find( pRet ) != pDict->InvalidIndex() ) + { + // If it hits this, then they have 2 utlvectors in different data tables with the same name and the + // same size limit. The names of + Assert( false ); + } + pDict->Insert( pRet, 0 ); +#endif + + return pRet; +} |