Fixing warnings

This commit is contained in:
Rodrigo Alfonso
2025-01-25 02:26:44 -03:00
parent e68df67aee
commit a720b14fa5

View File

@@ -69,7 +69,7 @@ class LinkWirelessOpenSDK {
static SequenceNumber fromPacketId(u32 packetId) {
return SequenceNumber{.n = ((packetId + 4) / 4) % 4,
packetId % 4,
.phase = packetId % 4,
.commState = COMMUNICATING};
}
@@ -557,7 +557,9 @@ class LinkWirelessOpenSDK {
if (canSendInflightPackets && pendingCount > 0 &&
pendingCount < MaxInflightPackets) {
return pendingTransferList.max()->cursor + 1;
auto max = pendingTransferList.max();
// (`max` is never null here! but the compiler complains...)
return max != nullptr ? max->cursor + 1 : 0;
} else {
auto minWithoutAck = pendingTransferList.minWithoutAck();
return minWithoutAck != nullptr ? minWithoutAck->cursor : cursor;