summaryrefslogtreecommitdiffstats
path: root/src/CraftingRecipes.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-13 20:00:01 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-13 20:00:01 +0100
commit944fdd173f40c0fcc718d6aa2af191bf993adc70 (patch)
tree28436adf7e20c58427c8d48685d944b964e11147 /src/CraftingRecipes.cpp
parentMerge pull request #3430 from cuberite/Overrides (diff)
downloadcuberite-WarningsFixes.tar
cuberite-WarningsFixes.tar.gz
cuberite-WarningsFixes.tar.bz2
cuberite-WarningsFixes.tar.lz
cuberite-WarningsFixes.tar.xz
cuberite-WarningsFixes.tar.zst
cuberite-WarningsFixes.zip
Diffstat (limited to '')
-rw-r--r--src/CraftingRecipes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 3aa9074e2..a3f50865a 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[static_cast<size_t>(a_Width * a_Height)])
{
}
@@ -29,7 +29,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])
+ m_Items(new cItem[static_cast<size_t>(a_Width * a_Height)])
{
for (int i = a_Width * a_Height - 1; i >= 0; i--)
{
@@ -44,7 +44,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])
+ m_Items(new cItem[static_cast<size_t>(a_Original.m_Width * a_Original.m_Height)])
{
for (int i = m_Width * m_Height - 1; i >= 0; i--)
{
@@ -201,7 +201,7 @@ void cCraftingGrid::Dump(void)
for (int y = 0; y < m_Height; y++) for (int x = 0; x < m_Width; x++)
{
#ifdef _DEBUG
- int idx = x + m_Width * y;
+ int idx = x + m_Width * y;
#endif
LOGD("Slot (%d, %d): Type %d, health %d, count %d",
x, y, m_Items[idx].m_ItemType, m_Items[idx].m_ItemDamage, m_Items[idx].m_ItemCount