aboutsummaryrefslogtreecommitdiffhomepage
path: root/peer.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2021-04-25 23:44:51 -0400
committerLee Salzman <[email protected]>2021-04-25 23:44:51 -0400
commit0286dcdb3481966e0f2c2cabbc468a4b299adf5c (patch)
treeac8fe2280b870819aa6a7790ebe7b4ce7ab9ad58 /peer.c
parente3ada4ed750b976833e3d54a9c1179445289bbf6 (diff)
downloadenet-0286dcdb3481966e0f2c2cabbc468a4b299adf5c.tar.gz
enet-0286dcdb3481966e0f2c2cabbc468a4b299adf5c.zip
silence some MSVC warnings
Diffstat (limited to 'peer.c')
-rw-r--r--peer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/peer.c b/peer.c
index 9370ef4..32f9809 100644
--- a/peer.c
+++ b/peer.c
@@ -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;
@@ -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);