summaryrefslogtreecommitdiffstats
path: root/src/BlockArea.cpp
diff options
context:
space:
mode:
authorPeter Bell <peterbell10@live.co.uk>2020-05-09 17:51:54 +0200
committerpeterbell10 <peterbell10@live.co.uk>2020-05-09 21:37:16 +0200
commit1123c95cf2efdcb23ff557b956d58538ca24aefe (patch)
treee8f39c2519ad06afc4f52d8fbc1d8fb334aeea42 /src/BlockArea.cpp
parentUpdate submodules (#4727) (diff)
downloadcuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.gz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.bz2
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.lz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.xz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.zst
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.zip
Diffstat (limited to 'src/BlockArea.cpp')
-rw-r--r--src/BlockArea.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp
index 1d63f147d..4aa5175f2 100644
--- a/src/BlockArea.cpp
+++ b/src/BlockArea.cpp
@@ -2086,7 +2086,7 @@ bool cBlockArea::SetSize(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
// Try to allocate the new storage
if ((a_DataTypes & baTypes) != 0)
{
- NewBlocks.reset(new BLOCKTYPE[a_SizeX * a_SizeY * a_SizeZ]);
+ NewBlocks.reset(new BLOCKTYPE[ToUnsigned(a_SizeX * a_SizeY * a_SizeZ)]);
if (NewBlocks == nullptr)
{
return false;
@@ -2094,7 +2094,7 @@ bool cBlockArea::SetSize(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
}
if ((a_DataTypes & baMetas) != 0)
{
- NewMetas.reset(new NIBBLETYPE[a_SizeX * a_SizeY * a_SizeZ]);
+ NewMetas.reset(new NIBBLETYPE[ToUnsigned(a_SizeX * a_SizeY * a_SizeZ)]);
if (NewMetas == nullptr)
{
return false;
@@ -2102,7 +2102,7 @@ bool cBlockArea::SetSize(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
}
if ((a_DataTypes & baLight) != 0)
{
- NewLight.reset(new NIBBLETYPE[a_SizeX * a_SizeY * a_SizeZ]);
+ NewLight.reset(new NIBBLETYPE[ToUnsigned(a_SizeX * a_SizeY * a_SizeZ)]);
if (NewLight == nullptr)
{
return false;
@@ -2110,7 +2110,7 @@ bool cBlockArea::SetSize(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
}
if ((a_DataTypes & baSkyLight) != 0)
{
- NewSkyLight.reset(new NIBBLETYPE[a_SizeX * a_SizeY * a_SizeZ]);
+ NewSkyLight.reset(new NIBBLETYPE[ToUnsigned(a_SizeX * a_SizeY * a_SizeZ)]);
if (NewSkyLight == nullptr)
{
return false;
@@ -2270,7 +2270,7 @@ void cBlockArea::CropBlockTypes(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int
int NewSizeX = GetSizeX() - a_AddMinX - a_SubMaxX;
int NewSizeY = GetSizeY() - a_AddMinY - a_SubMaxY;
int NewSizeZ = GetSizeZ() - a_AddMinZ - a_SubMaxZ;
- BLOCKARRAY NewBlockTypes{ new BLOCKTYPE[NewSizeX * NewSizeY * NewSizeZ] };
+ BLOCKARRAY NewBlockTypes{ new BLOCKTYPE[ToUnsigned(NewSizeX * NewSizeY * NewSizeZ)] };
size_t idx = 0;
for (int y = 0; y < NewSizeY; y++)
{
@@ -2295,7 +2295,7 @@ void cBlockArea::CropNibbles(NIBBLEARRAY & a_Array, int a_AddMinX, int a_SubMaxX
int NewSizeX = GetSizeX() - a_AddMinX - a_SubMaxX;
int NewSizeY = GetSizeY() - a_AddMinY - a_SubMaxY;
int NewSizeZ = GetSizeZ() - a_AddMinZ - a_SubMaxZ;
- NIBBLEARRAY NewNibbles{ new NIBBLETYPE[NewSizeX * NewSizeY * NewSizeZ] };
+ NIBBLEARRAY NewNibbles{ new NIBBLETYPE[ToUnsigned(NewSizeX * NewSizeY * NewSizeZ)] };
size_t idx = 0;
for (int y = 0; y < NewSizeY; y++)
{