1
0

Enable C++17 in build

This commit is contained in:
Peter Bell
2020-05-09 16:51:54 +01:00
committed by peterbell10
parent e6634ed26c
commit 1123c95cf2
11 changed files with 41 additions and 35 deletions

View File

@@ -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++)
{