Fixed a few MSVC warnings.
This commit is contained in:
parent
db978fc687
commit
9c8af58b75
@ -70,8 +70,8 @@ void cFurnaceEntity::UsedBy(cPlayer * a_Player)
|
|||||||
if (a_Player->GetWindow() != Window)
|
if (a_Player->GetWindow() != Window)
|
||||||
{
|
{
|
||||||
a_Player->OpenWindow(Window);
|
a_Player->OpenWindow(Window);
|
||||||
BroadcastProgress(PROGRESSBAR_FUEL, m_LastProgressFuel);
|
BroadcastProgress(PROGRESSBAR_FUEL, (short)m_LastProgressFuel);
|
||||||
BroadcastProgress(PROGRESSBAR_SMELTING, m_LastProgressCook);
|
BroadcastProgress(PROGRESSBAR_SMELTING, (short)m_LastProgressCook);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,14 +445,14 @@ void cFurnaceEntity::UpdateProgressBars(void)
|
|||||||
int CurFuel = (m_FuelBurnTime > 0) ? (200 - 200 * m_TimeBurned / m_FuelBurnTime) : 0;
|
int CurFuel = (m_FuelBurnTime > 0) ? (200 - 200 * m_TimeBurned / m_FuelBurnTime) : 0;
|
||||||
if ((CurFuel / 8) != (m_LastProgressFuel / 8))
|
if ((CurFuel / 8) != (m_LastProgressFuel / 8))
|
||||||
{
|
{
|
||||||
BroadcastProgress(PROGRESSBAR_FUEL, CurFuel);
|
BroadcastProgress(PROGRESSBAR_FUEL, (short)CurFuel);
|
||||||
m_LastProgressFuel = CurFuel;
|
m_LastProgressFuel = CurFuel;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CurCook = (m_NeedCookTime > 0) ? (200 * m_TimeCooked / m_NeedCookTime) : 0;
|
int CurCook = (m_NeedCookTime > 0) ? (200 * m_TimeCooked / m_NeedCookTime) : 0;
|
||||||
if ((CurCook / 8) != (m_LastProgressCook / 8))
|
if ((CurCook / 8) != (m_LastProgressCook / 8))
|
||||||
{
|
{
|
||||||
BroadcastProgress(PROGRESSBAR_SMELTING, CurCook);
|
BroadcastProgress(PROGRESSBAR_SMELTING, (short)CurCook);
|
||||||
m_LastProgressCook = CurCook;
|
m_LastProgressCook = CurCook;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -488,7 +488,6 @@ bool cHopperEntity::MoveItemsToFurnace(cChunk & a_Chunk, int a_BlockX, int a_Blo
|
|||||||
// Feed the fuel slot of the furnace
|
// Feed the fuel slot of the furnace
|
||||||
return MoveItemsToSlot(*Furnace, cFurnaceEntity::fsFuel);
|
return MoveItemsToSlot(*Furnace, cFurnaceEntity::fsFuel);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ void cHTTPConnection::SendNeedAuth(const AString & a_Realm)
|
|||||||
|
|
||||||
void cHTTPConnection::Send(const cHTTPResponse & a_Response)
|
void cHTTPConnection::Send(const cHTTPResponse & a_Response)
|
||||||
{
|
{
|
||||||
ASSERT(m_State = wcsRecvIdle);
|
ASSERT(m_State == wcsRecvIdle);
|
||||||
a_Response.AppendToData(m_OutgoingData);
|
a_Response.AppendToData(m_OutgoingData);
|
||||||
m_State = wcsSendingResp;
|
m_State = wcsSendingResp;
|
||||||
m_HTTPServer.NotifyConnectionWrite(*this);
|
m_HTTPServer.NotifyConnectionWrite(*this);
|
||||||
|
@ -133,7 +133,6 @@ bool cHTTPFormParser::HasFormData(const cHTTPRequest & a_Request)
|
|||||||
(a_Request.GetURL().find('?') != AString::npos)
|
(a_Request.GetURL().find('?') != AString::npos)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,7 +253,6 @@ void cNameValueParser::Parse(const char * a_Data, int a_Size)
|
|||||||
m_State = psValueRaw;
|
m_State = psValueRaw;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
} // while (i < a_Size)
|
} // while (i < a_Size)
|
||||||
break;
|
break;
|
||||||
} // case psEqual
|
} // case psEqual
|
||||||
|
@ -246,7 +246,7 @@ void cItems::Delete(int a_Idx)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cItems::Set(int a_Idx, ENUM_ITEM_ID a_ItemType, char a_ItemCount, short a_ItemDamage)
|
void cItems::Set(int a_Idx, short a_ItemType, char a_ItemCount, short a_ItemDamage)
|
||||||
{
|
{
|
||||||
if ((a_Idx < 0) || (a_Idx >= (int)size()))
|
if ((a_Idx < 0) || (a_Idx >= (int)size()))
|
||||||
{
|
{
|
||||||
|
@ -181,9 +181,9 @@ public:
|
|||||||
void Delete(int a_Idx);
|
void Delete(int a_Idx);
|
||||||
void Clear (void) {clear(); }
|
void Clear (void) {clear(); }
|
||||||
int Size (void) {return size(); }
|
int Size (void) {return size(); }
|
||||||
void Set (int a_Idx, ENUM_ITEM_ID a_ItemType, char a_ItemCount, short a_ItemDamage);
|
void Set (int a_Idx, short a_ItemType, char a_ItemCount, short a_ItemDamage);
|
||||||
|
|
||||||
void Add (ENUM_ITEM_ID a_ItemType, char a_ItemCount, short a_ItemDamage)
|
void Add (short a_ItemType, char a_ItemCount, short a_ItemDamage)
|
||||||
{
|
{
|
||||||
push_back(cItem(a_ItemType, a_ItemCount, a_ItemDamage));
|
push_back(cItem(a_ItemType, a_ItemCount, a_ItemDamage));
|
||||||
}
|
}
|
||||||
|
@ -877,7 +877,7 @@ void cProtocol132::SendCompass(const cWorld & a_World)
|
|||||||
void cProtocol132::SendEncryptionKeyRequest(void)
|
void cProtocol132::SendEncryptionKeyRequest(void)
|
||||||
{
|
{
|
||||||
cCSLock Lock(m_CSPacket);
|
cCSLock Lock(m_CSPacket);
|
||||||
WriteByte((char)0xfd);
|
WriteByte(0xfd);
|
||||||
WriteString(cRoot::Get()->GetServer()->GetServerID());
|
WriteString(cRoot::Get()->GetServer()->GetServerID());
|
||||||
WriteShort((short)m_ServerPublicKey.size());
|
WriteShort((short)m_ServerPublicKey.size());
|
||||||
SendData(m_ServerPublicKey.data(), m_ServerPublicKey.size());
|
SendData(m_ServerPublicKey.data(), m_ServerPublicKey.size());
|
||||||
@ -925,7 +925,7 @@ void cProtocol132::HandleEncryptionKeyResponse(const AString & a_EncKey, const A
|
|||||||
{
|
{
|
||||||
// Send encryption key response:
|
// Send encryption key response:
|
||||||
cCSLock Lock(m_CSPacket);
|
cCSLock Lock(m_CSPacket);
|
||||||
WriteByte((char)0xfc);
|
WriteByte(0xfc);
|
||||||
WriteShort(0);
|
WriteShort(0);
|
||||||
WriteShort(0);
|
WriteShort(0);
|
||||||
Flush();
|
Flush();
|
||||||
|
@ -112,7 +112,7 @@ int cProtocol150::ParseWindowClick(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert Button, Mode, SlotNum and HeldItem into eClickAction:
|
// Convert Button, Mode, SlotNum and HeldItem into eClickAction:
|
||||||
eClickAction Action;
|
eClickAction Action = caUnknown;
|
||||||
switch ((Mode << 8) | Button)
|
switch ((Mode << 8) | Button)
|
||||||
{
|
{
|
||||||
case 0x0000: Action = (SlotNum != -999) ? caLeftClick : caLeftClickOutside; break;
|
case 0x0000: Action = (SlotNum != -999) ? caLeftClick : caLeftClickOutside; break;
|
||||||
|
@ -986,7 +986,6 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size)
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
UInt32 PacketLen;
|
UInt32 PacketLen;
|
||||||
int PacketStart = m_ReceivedData.GetDataStart();
|
|
||||||
if (!m_ReceivedData.ReadVarInt(PacketLen))
|
if (!m_ReceivedData.ReadVarInt(PacketLen))
|
||||||
{
|
{
|
||||||
// Not enough data
|
// Not enough data
|
||||||
|
@ -198,7 +198,7 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This is used when the client sends a server-ping, respond with the default packet:
|
// This is used when the client sends a server-ping, respond with the default packet:
|
||||||
WriteByte ((char)0xff); // PACKET_DISCONNECT
|
WriteByte (0xff); // PACKET_DISCONNECT
|
||||||
WriteString(a_Reason);
|
WriteString(a_Reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user