From 54f32d331e258a801d041a1e436ff42c044c4f96 Mon Sep 17 00:00:00 2001 From: wangyix Date: Wed, 18 Jun 2014 10:20:19 -0700 Subject: [PATCH] replaced UINT16_MAX with std::numeric_limits::max --- libraries/networking/src/SentPacketHistory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/SentPacketHistory.cpp b/libraries/networking/src/SentPacketHistory.cpp index 1e1157ba71..841b5e909c 100644 --- a/libraries/networking/src/SentPacketHistory.cpp +++ b/libraries/networking/src/SentPacketHistory.cpp @@ -8,6 +8,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include #include "SentPacketHistory.h" #include @@ -15,7 +16,7 @@ SentPacketHistory::SentPacketHistory(int size) : _sentPackets(size), _newestPacketAt(0), _numExistingPackets(0), - _newestSequenceNumber(UINT16_MAX) + _newestSequenceNumber(std::numeric_limits::max()) { } @@ -42,7 +43,7 @@ void SentPacketHistory::packetSent(uint16_t sequenceNumber, const QByteArray& pa const QByteArray* SentPacketHistory::getPacket(uint16_t sequenceNumber) const { - const int UINT16_RANGE = UINT16_MAX + 1; + const int UINT16_RANGE = std::numeric_limits::max() + 1; // if sequenceNumber > _newestSequenceNumber, assume sequenceNumber is from before the most recent rollover // correct the diff so that it correctly represents how far back in the history sequenceNumber is