mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
silence analyzer warning about peer->channels
This commit is contained in:
parent
74cea7abf5
commit
498b9e3571
1 changed files with 25 additions and 23 deletions
48
peer.c
48
peer.c
|
@ -619,8 +619,6 @@ enet_peer_queue_acknowledgement (ENetPeer * peer, const ENetProtocol * command,
|
||||||
void
|
void
|
||||||
enet_peer_setup_outgoing_command (ENetPeer * peer, ENetOutgoingCommand * outgoingCommand)
|
enet_peer_setup_outgoing_command (ENetPeer * peer, ENetOutgoingCommand * outgoingCommand)
|
||||||
{
|
{
|
||||||
ENetChannel * channel = & peer -> channels [outgoingCommand -> command.header.channelID];
|
|
||||||
|
|
||||||
peer -> outgoingDataTotal += enet_protocol_command_size (outgoingCommand -> command.header.command) + outgoingCommand -> fragmentLength;
|
peer -> outgoingDataTotal += enet_protocol_command_size (outgoingCommand -> command.header.command) + outgoingCommand -> fragmentLength;
|
||||||
|
|
||||||
if (outgoingCommand -> command.header.channelID == 0xFF)
|
if (outgoingCommand -> command.header.channelID == 0xFF)
|
||||||
|
@ -631,31 +629,35 @@ enet_peer_setup_outgoing_command (ENetPeer * peer, ENetOutgoingCommand * outgoin
|
||||||
outgoingCommand -> unreliableSequenceNumber = 0;
|
outgoingCommand -> unreliableSequenceNumber = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE)
|
|
||||||
{
|
{
|
||||||
++ channel -> outgoingReliableSequenceNumber;
|
ENetChannel * channel = & peer -> channels [outgoingCommand -> command.header.channelID];
|
||||||
channel -> outgoingUnreliableSequenceNumber = 0;
|
|
||||||
|
|
||||||
outgoingCommand -> reliableSequenceNumber = channel -> outgoingReliableSequenceNumber;
|
if (outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE)
|
||||||
outgoingCommand -> unreliableSequenceNumber = 0;
|
{
|
||||||
}
|
++ channel -> outgoingReliableSequenceNumber;
|
||||||
else
|
channel -> outgoingUnreliableSequenceNumber = 0;
|
||||||
if (outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED)
|
|
||||||
{
|
|
||||||
++ peer -> outgoingUnsequencedGroup;
|
|
||||||
|
|
||||||
outgoingCommand -> reliableSequenceNumber = 0;
|
outgoingCommand -> reliableSequenceNumber = channel -> outgoingReliableSequenceNumber;
|
||||||
outgoingCommand -> unreliableSequenceNumber = 0;
|
outgoingCommand -> unreliableSequenceNumber = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED)
|
||||||
|
{
|
||||||
|
++ peer -> outgoingUnsequencedGroup;
|
||||||
|
|
||||||
|
outgoingCommand -> reliableSequenceNumber = 0;
|
||||||
|
outgoingCommand -> unreliableSequenceNumber = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (outgoingCommand -> fragmentOffset == 0)
|
||||||
|
++ channel -> outgoingUnreliableSequenceNumber;
|
||||||
|
|
||||||
|
outgoingCommand -> reliableSequenceNumber = channel -> outgoingReliableSequenceNumber;
|
||||||
|
outgoingCommand -> unreliableSequenceNumber = channel -> outgoingUnreliableSequenceNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (outgoingCommand -> fragmentOffset == 0)
|
|
||||||
++ channel -> outgoingUnreliableSequenceNumber;
|
|
||||||
|
|
||||||
outgoingCommand -> reliableSequenceNumber = channel -> outgoingReliableSequenceNumber;
|
|
||||||
outgoingCommand -> unreliableSequenceNumber = channel -> outgoingUnreliableSequenceNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
outgoingCommand -> sendAttempts = 0;
|
outgoingCommand -> sendAttempts = 0;
|
||||||
outgoingCommand -> sentTime = 0;
|
outgoingCommand -> sentTime = 0;
|
||||||
outgoingCommand -> roundTripTimeout = 0;
|
outgoingCommand -> roundTripTimeout = 0;
|
||||||
|
|
Loading…
Reference in a new issue