From 1123c95cf2efdcb23ff557b956d58538ca24aefe Mon Sep 17 00:00:00 2001 From: Peter Bell Date: Sat, 9 May 2020 16:51:54 +0100 Subject: Enable C++17 in build --- src/CraftingRecipes.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/CraftingRecipes.cpp') diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp index 1a8a68523..fc0ce92f1 100644 --- a/src/CraftingRecipes.cpp +++ b/src/CraftingRecipes.cpp @@ -18,7 +18,7 @@ cCraftingGrid::cCraftingGrid(int a_Width, int a_Height) : m_Width(a_Width), m_Height(a_Height), - m_Items(new cItem[a_Width * a_Height]) + m_Items(new cItem[ToUnsigned(a_Width * a_Height)]) { } @@ -27,9 +27,7 @@ cCraftingGrid::cCraftingGrid(int a_Width, int a_Height) : cCraftingGrid::cCraftingGrid(const cItem * a_Items, int a_Width, int a_Height) : - m_Width(a_Width), - m_Height(a_Height), - m_Items(new cItem[a_Width * a_Height]) + cCraftingGrid(a_Width, a_Height) { for (int i = a_Width * a_Height - 1; i >= 0; i--) { @@ -42,9 +40,7 @@ cCraftingGrid::cCraftingGrid(const cItem * a_Items, int a_Width, int a_Height) : cCraftingGrid::cCraftingGrid(const cCraftingGrid & a_Original) : - m_Width(a_Original.m_Width), - m_Height(a_Original.m_Height), - m_Items(new cItem[a_Original.m_Width * a_Original.m_Height]) + cCraftingGrid(a_Original.m_Width, a_Original.m_Height) { for (int i = m_Width * m_Height - 1; i >= 0; i--) { -- cgit v1.2.3