1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-22 17:47:38 +08:00

suppress: void* memset(void*, int, size_t)’ clearing an object of type ‘class CThreadSpinRWLock’ with no trivial copy-assignment; use value-initialization instead (#212)

This commit is contained in:
Dora 2024-05-13 13:48:20 +02:00 committed by GitHub
parent 017abba661
commit 4c27c1305c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1127,7 +1127,12 @@ private:
class ALIGN8 PLATFORM_CLASS CThreadSpinRWLock class ALIGN8 PLATFORM_CLASS CThreadSpinRWLock
{ {
public: public:
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (intp)this % 8 == 0 ); memset( this, 0, sizeof( *this ) ); }
CThreadSpinRWLock() : m_lockInfo{ 0, 0 }
{
COMPILE_TIME_ASSERT(sizeof(LockInfo_t) == sizeof(int64));
Assert((intp)this % 8 == 0);
}
bool TryLockForWrite(); bool TryLockForWrite();
bool TryLockForRead(); bool TryLockForRead();