1
0

Fixed a few MSVC warnings.

This commit is contained in:
madmaxoft 2014-01-07 14:24:25 +01:00
parent e3bb82d95a
commit 934b90c121
8 changed files with 21 additions and 18 deletions

View File

@ -828,7 +828,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int
int yd = dy - dx / 2;
int zd = dz - dx / 2;
while (true)
for (;;)
{
RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight);
@ -860,7 +860,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int
int xd = dx - dy / 2;
int zd = dz - dy / 2;
while (true)
for (;;)
{
RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight);
@ -894,7 +894,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int
int xd = dx - dz / 2;
int yd = dy - dz / 2;
while (true)
for (;;)
{
RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight);

View File

@ -285,7 +285,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
void cCaveTunnel::Smooth(void)
{
cCaveDefPoints Pts;
while (true)
for (;;)
{
if (!RefineDefPoints(m_Points, Pts))
{
@ -331,7 +331,7 @@ void cCaveTunnel::FinishLinear(void)
int yd = dy - dx / 2;
int zd = dz - dx / 2;
while (true)
for (;;)
{
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
@ -363,7 +363,7 @@ void cCaveTunnel::FinishLinear(void)
int xd = dx - dy / 2;
int zd = dz - dy / 2;
while (true)
for (;;)
{
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
@ -397,7 +397,7 @@ void cCaveTunnel::FinishLinear(void)
int xd = dx - dz / 2;
int yd = dy - dz / 2;
while (true)
for (;;)
{
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));

View File

@ -774,10 +774,11 @@ void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, in
return;
}
default:
{
ASSERT(!"Unhandled biome");
return;
}
} // switch (Biome)
ASSERT(!"Unexpected fallthrough");
}

View File

@ -528,7 +528,7 @@ cFinishGenFluidSprings::cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cI
bool IsWater = (a_Fluid == E_BLOCK_WATER);
AString SectionName = IsWater ? "WaterSprings" : "LavaSprings";
AString DefaultHeightDistribution;
int DefaultChance;
int DefaultChance = 0;
switch (a_World.GetDimension())
{
case dimNether:

View File

@ -56,7 +56,6 @@ public:
case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true;
default: a_BlockType = E_BLOCK_AIR; return true;
}
return false;
}
} ;

View File

@ -14,9 +14,9 @@
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4127)
#pragma warning(disable:4244)
#pragma warning(disable:4231)
#pragma warning(disable:4189)
#pragma warning(disable:4231)
#pragma warning(disable:4244)
#pragma warning(disable:4702)
#endif

View File

@ -983,7 +983,7 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size)
}
// Handle all complete packets:
while (true)
for (;;)
{
UInt32 PacketLen;
if (!m_ReceivedData.ReadVarInt(PacketLen))

View File

@ -16,9 +16,12 @@
#define NBT_RESERVE_SIZE 200
#endif // NBT_RESERVE_SIZE
#define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while (0)
#ifdef _MSC_VER
// Dodge a C4127 (conditional expression is constant) for this specific macro usage
#define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while ((false, false))
#else
#define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while (false)
#endif
@ -99,7 +102,7 @@ bool cParsedNBT::ReadCompound(void)
// Reads the latest tag as a compound
int ParentIdx = m_Tags.size() - 1;
int PrevSibling = -1;
while (true)
for (;;)
{
NEEDBYTES(1);
eTagType TagType = (eTagType)(m_Data[m_Pos]);
@ -276,7 +279,7 @@ int cParsedNBT::FindChildByName(int a_Tag, const char * a_Name, size_t a_NameLen
for (int Child = m_Tags[a_Tag].m_FirstChild; Child != -1; Child = m_Tags[Child].m_NextSibling)
{
if (
(m_Tags[Child].m_NameLength == a_NameLength) &&
(m_Tags[Child].m_NameLength == (int)a_NameLength) &&
(memcmp(m_Data + m_Tags[Child].m_NameStart, a_Name, a_NameLength) == 0)
)
{