Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyValues update on 6/24/2022 #102

Merged
merged 5 commits into from Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions public/tier0/threadtools.h
@@ -1,4 +1,4 @@
//========== Copyright � 2005, Valve Corporation, All rights reserved. ========
//========== Copyright � 2005, Valve Corporation, All rights reserved. ========
//
// Purpose: A collection of utility classes to simplify thread handling, and
// as much as possible contain portability problems. Here avoiding
Expand Down Expand Up @@ -1135,7 +1135,13 @@ class PLATFORM_CLASS CThreadRWLock
class ALIGN8 PLATFORM_CLASS CThreadSpinRWLock
{
public:
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (intp)this % 8 == 0 ); memset( this, 0, sizeof( *this ) ); }
CThreadSpinRWLock() {
COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) );
Assert( (intp)this % 8 == 0 );
m_lockInfo.m_writerId = 0;
m_lockInfo.m_nReaders = 0;
m_lockInfo.m_i64 = 0;
}

bool TryLockForWrite();
bool TryLockForRead();
Expand Down
3 changes: 3 additions & 0 deletions public/tier1/KeyValues.h
Expand Up @@ -342,6 +342,9 @@ class KeyValues
char m_bHasEscapeSequences; // true, if while parsing this KeyValue, Escape Sequences are used (default false)
uint16 m_iKeyNameCaseSensitive2; // 2nd part of case sensitive symbol defined in KeyValueSystem;

uint32 m_iUnk1;
uint32 m_iUnk2;

KeyValues *m_pPeer; // pointer to next key in list
KeyValues *m_pSub; // pointer to Start of a new sub key list
KeyValues *m_pChain;// Search here if it's not in our list
Expand Down
4 changes: 3 additions & 1 deletion public/vstdlib/IKeyValuesSystem.h
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand All @@ -23,6 +23,8 @@ typedef int HKeySymbol;
class IKeyValuesSystem
{
public:
virtual ~IKeyValuesSystem() = 0;

// registers the size of the KeyValues in the specified instance
// so it can build a properly sized memory pool for the KeyValues objects
// the sizes will usually never differ but this is for versioning safety
Expand Down
5 changes: 4 additions & 1 deletion tier1/KeyValues.cpp
@@ -1,4 +1,4 @@
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
Expand Down Expand Up @@ -300,6 +300,9 @@ void KeyValues::Init()
m_pValue = NULL;

m_bHasEscapeSequences = false;

m_iUnk1 = 0;
m_iUnk2 = 0;
}

//-----------------------------------------------------------------------------
Expand Down