Skip to content

Commit

Permalink
silence some MSVC warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lsalzman committed Apr 26, 2021
1 parent e3ada4e commit 0286dcd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/enet/win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#pragma warning (disable: 4244) // 64bit to 32bit int
#pragma warning (disable: 4018) // signed/unsigned mismatch
#pragma warning (disable: 4146) // unary minus operator applied to unsigned type
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif

Expand Down
3 changes: 2 additions & 1 deletion peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt)
int
enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
{
ENetChannel * channel = & peer -> channels [channelID];
ENetChannel * channel;
ENetProtocol command;
size_t fragmentLength;

Expand All @@ -108,6 +108,7 @@ enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
packet -> dataLength > peer -> host -> maximumPacketSize)
return -1;

channel = & peer -> channels [channelID];
fragmentLength = peer -> mtu - sizeof (ENetProtocolHeader) - sizeof (ENetProtocolSendFragment);
if (peer -> host -> checksum != NULL)
fragmentLength -= sizeof(enet_uint32);
Expand Down
4 changes: 2 additions & 2 deletions protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,8 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
ENetBuffer * buffer = & host -> buffers [host -> bufferCount];
ENetOutgoingCommand * outgoingCommand;
ENetListIterator currentCommand;
ENetChannel *channel;
enet_uint16 reliableWindow;
ENetChannel *channel = NULL;
enet_uint16 reliableWindow = 0;
size_t commandSize;
int windowExceeded = 0, windowWrap = 0, canPing = 1;

Expand Down

0 comments on commit 0286dcd

Please sign in to comment.