Fixed a few MSVC warnings.
This commit is contained in:
parent
e3bb82d95a
commit
934b90c121
src
@ -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 yd = dy - dx / 2;
|
||||||
int zd = dz - 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);
|
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 xd = dx - dy / 2;
|
||||||
int zd = dz - 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);
|
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 xd = dx - dz / 2;
|
||||||
int yd = dy - 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);
|
RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight);
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
|
|||||||
void cCaveTunnel::Smooth(void)
|
void cCaveTunnel::Smooth(void)
|
||||||
{
|
{
|
||||||
cCaveDefPoints Pts;
|
cCaveDefPoints Pts;
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (!RefineDefPoints(m_Points, Pts))
|
if (!RefineDefPoints(m_Points, Pts))
|
||||||
{
|
{
|
||||||
@ -331,7 +331,7 @@ void cCaveTunnel::FinishLinear(void)
|
|||||||
int yd = dy - dx / 2;
|
int yd = dy - dx / 2;
|
||||||
int zd = dz - dx / 2;
|
int zd = dz - dx / 2;
|
||||||
|
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ void cCaveTunnel::FinishLinear(void)
|
|||||||
int xd = dx - dy / 2;
|
int xd = dx - dy / 2;
|
||||||
int zd = dz - dy / 2;
|
int zd = dz - dy / 2;
|
||||||
|
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ void cCaveTunnel::FinishLinear(void)
|
|||||||
int xd = dx - dz / 2;
|
int xd = dx - dz / 2;
|
||||||
int yd = dy - dz / 2;
|
int yd = dy - dz / 2;
|
||||||
|
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R));
|
||||||
|
|
||||||
|
@ -774,10 +774,11 @@ void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, in
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ASSERT(!"Unhandled biome");
|
ASSERT(!"Unhandled biome");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
} // switch (Biome)
|
} // switch (Biome)
|
||||||
ASSERT(!"Unexpected fallthrough");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ cFinishGenFluidSprings::cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cI
|
|||||||
bool IsWater = (a_Fluid == E_BLOCK_WATER);
|
bool IsWater = (a_Fluid == E_BLOCK_WATER);
|
||||||
AString SectionName = IsWater ? "WaterSprings" : "LavaSprings";
|
AString SectionName = IsWater ? "WaterSprings" : "LavaSprings";
|
||||||
AString DefaultHeightDistribution;
|
AString DefaultHeightDistribution;
|
||||||
int DefaultChance;
|
int DefaultChance = 0;
|
||||||
switch (a_World.GetDimension())
|
switch (a_World.GetDimension())
|
||||||
{
|
{
|
||||||
case dimNether:
|
case dimNether:
|
||||||
|
@ -56,7 +56,6 @@ public:
|
|||||||
case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true;
|
case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true;
|
||||||
default: a_BlockType = E_BLOCK_AIR; return true;
|
default: a_BlockType = E_BLOCK_AIR; return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4127)
|
#pragma warning(disable:4127)
|
||||||
#pragma warning(disable:4244)
|
|
||||||
#pragma warning(disable:4231)
|
|
||||||
#pragma warning(disable:4189)
|
#pragma warning(disable:4189)
|
||||||
|
#pragma warning(disable:4231)
|
||||||
|
#pragma warning(disable:4244)
|
||||||
#pragma warning(disable:4702)
|
#pragma warning(disable:4702)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -983,7 +983,7 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle all complete packets:
|
// Handle all complete packets:
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
UInt32 PacketLen;
|
UInt32 PacketLen;
|
||||||
if (!m_ReceivedData.ReadVarInt(PacketLen))
|
if (!m_ReceivedData.ReadVarInt(PacketLen))
|
||||||
|
@ -16,9 +16,12 @@
|
|||||||
#define NBT_RESERVE_SIZE 200
|
#define NBT_RESERVE_SIZE 200
|
||||||
#endif // NBT_RESERVE_SIZE
|
#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
|
// Reads the latest tag as a compound
|
||||||
int ParentIdx = m_Tags.size() - 1;
|
int ParentIdx = m_Tags.size() - 1;
|
||||||
int PrevSibling = -1;
|
int PrevSibling = -1;
|
||||||
while (true)
|
for (;;)
|
||||||
{
|
{
|
||||||
NEEDBYTES(1);
|
NEEDBYTES(1);
|
||||||
eTagType TagType = (eTagType)(m_Data[m_Pos]);
|
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)
|
for (int Child = m_Tags[a_Tag].m_FirstChild; Child != -1; Child = m_Tags[Child].m_NextSibling)
|
||||||
{
|
{
|
||||||
if (
|
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)
|
(memcmp(m_Data + m_Tags[Child].m_NameStart, a_Name, a_NameLength) == 0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user