diff options
Diffstat (limited to 'src/BlockArea.cpp')
-rw-r--r-- | src/BlockArea.cpp | 12 |
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++) { |