Revert "ssize_t instead of size_t - #510"

This reverts commit 07486bb3c8.
This commit is contained in:
tildearrow 2022-05-31 15:31:21 -05:00
parent 07486bb3c8
commit 050a98d63d
1 changed files with 3 additions and 3 deletions

View File

@ -605,10 +605,10 @@ struct IMGUI_API ImBitVector
ImVector<ImU32> Storage;
int BitCount = 0;
ImBitVector(int sz = 0) { if (sz > 0) { Create(sz); } }
void Create(int sz) { BitCount = sz; Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (ssize_t)Storage.Size * sizeof(Storage.Data[0])); }
void Create(int sz) { BitCount = sz; Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
void Clear() { Storage.clear(); }
void ClearAllBits() { IM_ASSERT(Storage.Size > 0); memset(Storage.Data, 0, (ssize_t)Storage.Size * sizeof(Storage.Data[0])); }
void SetAllBits() { IM_ASSERT(Storage.Size > 0); memset(Storage.Data, 255, (ssize_t)Storage.Size * sizeof(Storage.Data[0])); }
void ClearAllBits() { IM_ASSERT(Storage.Size > 0); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
void SetAllBits() { IM_ASSERT(Storage.Size > 0); memset(Storage.Data, 255, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
bool TestBit(int n) const { IM_ASSERT(n >= 0 && n < BitCount); return ImBitArrayTestBit(Storage.Data, n); }
void SetBit(int n) { IM_ASSERT(n >= 0 && n < BitCount); ImBitArraySetBit(Storage.Data, n); }
void SetBitRange(int n, int n2) { IM_ASSERT(n >= 0 && n < BitCount && n2 > n && n2 <= BitCount); ImBitArraySetBitRange(Storage.Data, n, n2); } // Works on range [n..n2)