GCC build fix

This commit is contained in:
Shauren
2022-12-17 12:54:38 +01:00
parent bf4880973d
commit 25c28c0c7d
3 changed files with 7 additions and 7 deletions
@@ -683,7 +683,7 @@ namespace WorldPackets
uint16 MessageID = 0; uint16 MessageID = 0;
uint32 SequenceIndex = 0; uint32 SequenceIndex = 0;
Optional<float> Speed; Optional<float> Speed;
Optional<SpeedRange> SpeedRange; Optional<MoveSetCompoundState::SpeedRange> SpeedRange;
Optional<KnockBackInfo> KnockBack; Optional<KnockBackInfo> KnockBack;
Optional<int32> VehicleRecID; Optional<int32> VehicleRecID;
Optional<CollisionHeightInfo> CollisionHeight; Optional<CollisionHeightInfo> CollisionHeight;
+2 -2
View File
@@ -65,6 +65,8 @@ protected:
std::vector<char*> _stringPool; std::vector<char*> _stringPool;
char** _indexTable; char** _indexTable;
uint32 _indexTableSize; uint32 _indexTableSize;
friend class UnitTestDataLoader;
}; };
template<class T> template<class T>
@@ -82,8 +84,6 @@ public:
iterator begin() const { return iterator(reinterpret_cast<T const* const*>(_indexTable), _indexTableSize); } iterator begin() const { return iterator(reinterpret_cast<T const* const*>(_indexTable), _indexTableSize); }
iterator end() const { return iterator(reinterpret_cast<T const* const*>(_indexTable), _indexTableSize, _indexTableSize); } iterator end() const { return iterator(reinterpret_cast<T const* const*>(_indexTable), _indexTableSize, _indexTableSize); }
friend class UnitTestDataLoader;
}; };
#endif #endif
+4 -4
View File
@@ -48,15 +48,15 @@ class UnitTestDataLoader
LoaderGuard Loader() { return {*this}; } LoaderGuard Loader() { return {*this}; }
void Dump() void Dump()
{ {
delete[] _store._indexTable.AsT; delete[] _store._indexTable;
for (T const& entry : _storage) for (T const& entry : _storage)
if (entry.*ID >= _store._indexTableSize) if (entry.*ID >= _store._indexTableSize)
_store._indexTableSize = entry.*ID + 1; _store._indexTableSize = entry.*ID + 1;
_store._indexTable.AsT = new T*[_store._indexTableSize]; _store._indexTable = new char*[_store._indexTableSize];
for (size_t i = 0; i < _store._indexTableSize; ++i) for (size_t i = 0; i < _store._indexTableSize; ++i)
_store._indexTable.AsT[i] = nullptr; _store._indexTable[i] = nullptr;
for (T& entry : _storage) for (T& entry : _storage)
_store._indexTable.AsT[entry.*ID] = &entry; _store._indexTable[entry.*ID] = reinterpret_cast<char*>(&entry);
} }
private: private: