From 6d2fea442616c2d311e6a6e60ad109323818a27b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 9 Jul 2015 11:24:58 -0700 Subject: [PATCH] make NLPacket copy take const, fix get in SPH --- libraries/networking/src/NLPacket.cpp | 2 +- libraries/networking/src/NLPacket.h | 2 +- libraries/networking/src/SentPacketHistory.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/NLPacket.cpp b/libraries/networking/src/NLPacket.cpp index f125cdc6b7..4f17d3d754 100644 --- a/libraries/networking/src/NLPacket.cpp +++ b/libraries/networking/src/NLPacket.cpp @@ -44,7 +44,7 @@ std::unique_ptr NLPacket::createCopy(const NLPacket& other) { NLPacket::NLPacket(PacketType::Value type, int64_t size) : Packet(type, localHeaderSize(type) + size) { } -NLPacket::NLPacket(NLPacket& other) : Packet(other) { +NLPacket::NLPacket(const NLPacket& other) : Packet(other) { } void NLPacket::setSourceUuid(QUuid sourceUuid) { diff --git a/libraries/networking/src/NLPacket.h b/libraries/networking/src/NLPacket.h index 7ea449815b..9368b25720 100644 --- a/libraries/networking/src/NLPacket.h +++ b/libraries/networking/src/NLPacket.h @@ -29,7 +29,7 @@ public: protected: NLPacket(PacketType::Value type, int64_t size); - NLPacket(NLPacket& other); + NLPacket(const NLPacket& other); void setSourceUuid(QUuid sourceUuid); void setConnectionUuid(QUuid connectionUuid); diff --git a/libraries/networking/src/SentPacketHistory.cpp b/libraries/networking/src/SentPacketHistory.cpp index 4717970c2a..68bd5f1c67 100644 --- a/libraries/networking/src/SentPacketHistory.cpp +++ b/libraries/networking/src/SentPacketHistory.cpp @@ -49,5 +49,5 @@ const NLPacket& SentPacketHistory::getPacket(uint16_t sequenceNumber) const { seqDiff += UINT16_RANGE; } - return *_sentPackets.get(seqDiff).get(); + return *_sentPackets.get(seqDiff)->get(); }