mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Change VoxelArea volume to be u32
This commit is contained in:
parent
67126cbd1b
commit
4f800dd2b4
6 changed files with 20 additions and 19 deletions
|
@ -119,10 +119,10 @@ public:
|
|||
return !m_cache_extent.X || !m_cache_extent.Y || !m_cache_extent.Z;
|
||||
}
|
||||
|
||||
s32 getVolume() const
|
||||
u32 getVolume() const
|
||||
{
|
||||
// FIXME: possible integer overflow here
|
||||
return m_cache_extent.X * m_cache_extent.Y * m_cache_extent.Z;
|
||||
return (u32)m_cache_extent.X * (u32)m_cache_extent.Y * (u32)m_cache_extent.Z;
|
||||
}
|
||||
|
||||
bool contains(const VoxelArea &a) const
|
||||
|
@ -148,8 +148,9 @@ public:
|
|||
}
|
||||
bool contains(s32 i) const
|
||||
{
|
||||
return (i >= 0 && i < getVolume());
|
||||
return i >= 0 && static_cast<u32>(i) < getVolume();
|
||||
}
|
||||
|
||||
bool operator==(const VoxelArea &other) const
|
||||
{
|
||||
return (MinEdge == other.MinEdge
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue