Correct CUtlHashtableEntry data type

Resolves compile time errors for key types larger that 4 bytes
This commit is contained in:
GAMMACASE committed 2026-03-20 18:08:41 +03:00
1 parent e6a77091ef
commit efbc62c362
2 files changed
+2 -2

No files matched your search

+1 -1
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 );
+1 -1
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; }