Correct CUtlHashtableEntry data type

Resolves compile time errors for key types larger that 4 bytes
This commit is contained in:
GAMMACASE 2025-10-21 17:39:53 +03:00
parent 2551ced759
commit f1573c3515
2 changed files with 2 additions and 2 deletions

View File

@ -1770,7 +1770,7 @@ inline void ValidateAlignmentExplicit(void)
// Alignment must be a multiple of the size of the object type, or elements will *NOT* be aligned!
ALIGN_ASSERT((sizeof(T) % ALIGN) == 0);
// Alignment should be a multiple of the base alignment of T
// ALIGN_ASSERT((ALIGN % VALIGNOF(T)) == 0);
ALIGN_ASSERT((ALIGN % VALIGNOF(T)) == 0);
// Alignment must not be bigger than the maximum declared alignment used by DECLARE_ALIGNED_BYTE_ARRAY
// (if you hit this, just add more powers of 2 below and increase this limit)
ALIGN_ASSERT( ALIGN <= 128 );

View File

@ -74,7 +74,7 @@ public:
};
storage_t flags_and_hash;
AlignedByteArrayExplicit_t<(sizeof( KVPair ) + sizeof( storage_t ) - 1) / sizeof( storage_t ), storage_t, MAX( alignof(KVPair), alignof(storage_t) )> data;
AlignedByteArray_t<1, KVPair> data;
bool IsValid() const { return flags_and_hash >= 0; }
void MarkInvalid() { int32 flag = FLAG_FREE; flags_and_hash = (storage_t)flag; }