From 804805d35a87c2acc9425d1762ad26b1ba2ec9ac Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Wed, 29 Jul 2015 09:04:03 -0600 Subject: Silenced and fixed many warning messages across multiple files. --- src/ChunkData.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/ChunkData.cpp') diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 80f40d39e..ca11602a6 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -156,7 +156,7 @@ BLOCKTYPE cChunkData::GetBlock(int a_X, int a_Y, int a_Z) const int Section = a_Y / SectionHeight; if (m_Sections[Section] != nullptr) { - int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * SectionHeight), a_Z); + int Index = cChunkDef::MakeIndexNoCheck(a_X, static_cast(static_cast(a_Y) - (static_cast(Section) * SectionHeight)), a_Z); return m_Sections[Section]->m_BlockTypes[Index]; } else @@ -181,7 +181,7 @@ void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) return; } - int Section = a_RelY / SectionHeight; + int Section = static_cast(static_cast(a_RelY) / SectionHeight); if (m_Sections[Section] == nullptr) { if (a_Block == 0x00) @@ -196,7 +196,7 @@ void cChunkData::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) } ZeroSection(m_Sections[Section]); } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, static_cast(static_cast(a_RelY) - (static_cast(Section) * SectionHeight)), a_RelZ); m_Sections[Section]->m_BlockTypes[Index] = a_Block; } @@ -211,10 +211,10 @@ NIBBLETYPE cChunkData::GetMeta(int a_RelX, int a_RelY, int a_RelZ) const (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { - int Section = a_RelY / SectionHeight; + int Section = static_cast(static_cast(a_RelY) / SectionHeight); if (m_Sections[Section] != nullptr) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, static_cast(static_cast(a_RelY) - (static_cast(Section) * SectionHeight)), a_RelZ); return (m_Sections[Section]->m_BlockMetas[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -242,7 +242,7 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble return false; } - int Section = a_RelY / SectionHeight; + int Section = static_cast(static_cast(a_RelY) / SectionHeight); if (m_Sections[Section] == nullptr) { if ((a_Nibble & 0xf) == 0x00) @@ -257,7 +257,7 @@ bool cChunkData::SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Nibble } ZeroSection(m_Sections[Section]); } - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, static_cast(static_cast(a_RelY) - (static_cast(Section) * SectionHeight)), a_RelZ); NIBBLETYPE oldval = m_Sections[Section]->m_BlockMetas[Index / 2] >> ((Index & 1) * 4) & 0xf; m_Sections[Section]->m_BlockMetas[Index / 2] = static_cast( (m_Sections[Section]->m_BlockMetas[Index / 2] & (0xf0 >> ((Index & 1) * 4))) | // The untouched nibble @@ -278,10 +278,10 @@ NIBBLETYPE cChunkData::GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const (a_RelZ < cChunkDef::Width) && (a_RelZ > -1) ) { - int Section = a_RelY / SectionHeight; + int Section = static_cast(static_cast(a_RelY) / SectionHeight); if (m_Sections[Section] != nullptr) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, static_cast(static_cast(a_RelY) - (static_cast(Section) * SectionHeight)), a_RelZ); return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -301,10 +301,10 @@ NIBBLETYPE cChunkData::GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const { if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1)) { - int Section = a_RelY / SectionHeight; + int Section = static_cast(static_cast(a_RelY) / SectionHeight); if (m_Sections[Section] != nullptr) { - int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * SectionHeight), a_RelZ); + int Index = cChunkDef::MakeIndexNoCheck(a_RelX, static_cast(static_cast(a_RelY) - (static_cast(Section) * SectionHeight)), a_RelZ); return (m_Sections[Section]->m_BlockSkyLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f; } else @@ -442,7 +442,7 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, (const BLOCKTYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount, SectionBlockCount, static_cast(0))) { // No need for the section, the data is all-air continue; @@ -474,7 +474,7 @@ void cChunkData::SetMetas(const NIBBLETYPE * a_Src) } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, static_cast(0))) { // No need for the section, the data is all zeroes continue; @@ -510,7 +510,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, static_cast(0))) { // No need for the section, the data is all zeroes continue; @@ -545,7 +545,7 @@ void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) } // The section doesn't exist, find out if it is needed: - if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, (NIBBLETYPE)0xff)) + if (IsAllValue(a_Src + i * SectionBlockCount / 2, SectionBlockCount / 2, static_cast(0xff))) { // No need for the section, the data is all zeroes continue; -- cgit v1.2.3