diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h index 3ae573df6..1b601c72f 100644 --- a/Source/Engine/Core/Collections/BitArray.h +++ b/Source/Engine/Core/Collections/BitArray.h @@ -214,8 +214,8 @@ public: { ASSERT(index >= 0 && index < _count); const ItemType offset = index / sizeof(ItemType); - const ItemType bitMask = static_cast((int32)(1 << (index & (static_cast(sizeof(ItemType)) - 1)))); - const ItemType item = static_cast(_allocation.Get())[offset]; + const ItemType bitMask = (ItemType)(int32)(1 << (index & ((int32)sizeof(ItemType) - 1))); + const ItemType item = ((ItemType*)_allocation.Get())[offset]; return (item & bitMask) != 0; } @@ -228,12 +228,12 @@ public: { ASSERT(index >= 0 && index < _count); const ItemType offset = index / sizeof(ItemType); - const ItemType bitMask = static_cast((int32)(1 << (index & (static_cast(sizeof(ItemType)) - 1)))); - ItemType& item = reinterpret_cast(_allocation.Get())[offset]; + const ItemType bitMask = (ItemType)(int32)(1 << (index & ((int32)sizeof(ItemType) - 1))); + ItemType& item = ((ItemType*)_allocation.Get())[offset]; if (value) item |= bitMask; else - item &= ~bitMask; + item &= ~bitMask; // Clear the bit } public: