From d496b33ae6683d25ef12f9e82ee95db30aa26d57 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 7 Jul 2015 15:51:29 -0700 Subject: [PATCH] Compile fixes --- libraries/networking/src/LimitedNodeList.h | 8 +++++--- libraries/networking/src/NetworkPacket.h | 2 +- libraries/networking/src/PacketList.h | 12 +++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index ceb0427ef0..fdeaefb80a 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -38,6 +38,7 @@ #include "Node.h" #include "NLPacket.h" #include "PacketHeaders.h" +#include "PacketList.h" #include "UUIDHasher.h" const int MAX_PACKET_SIZE = 1450; @@ -67,6 +68,7 @@ Q_DECLARE_METATYPE(SharedNodePointer) using namespace tbb; typedef std::pair UUIDNodePair; typedef concurrent_unordered_map NodeHash; +using NLPacketList = PacketList; typedef quint8 PingType_t; namespace PingType { @@ -147,8 +149,8 @@ public: qint64 sendUnreliablePacket(NLPacket& packet, const HifiSockAddr& sockAddr) {}; qint64 sendPacket(NLPacket&& packet, const SharedNodePointer& destinationNode) {}; qint64 sendPacket(NLPacket&& packet, const HifiSockAddr& sockAddr) {}; - qint64 sendPacketList(PacketList& packetList, const SharedNodePointer& destinationNode) {}; - qint64 sendPacketList(PacketList& packetList, const HifiSockAddr& sockAddr) {}; + qint64 sendPacketList(NLPacketList& packetList, const SharedNodePointer& destinationNode) {}; + qint64 sendPacketList(NLPacketList& packetList, const HifiSockAddr& sockAddr) {}; void (*linkedDataCreateCallback)(Node *); @@ -173,7 +175,7 @@ public: int updateNodeWithDataFromPacket(const SharedNodePointer& matchingNode, const QByteArray& packet); int findNodeAndUpdateWithDataFromPacket(const QByteArray& packet); - unsigned broadcastToNodes(PacketList& packetList, const NodeSet& destinationNodeTypes) {}; + unsigned broadcastToNodes(NLPacketList& packetList, const NodeSet& destinationNodeTypes) {}; SharedNodePointer soloNodeOfType(char nodeType); void getPacketStats(float &packetsPerSecond, float &bytesPerSecond); diff --git a/libraries/networking/src/NetworkPacket.h b/libraries/networking/src/NetworkPacket.h index c42ad286ae..a4484f31d5 100644 --- a/libraries/networking/src/NetworkPacket.h +++ b/libraries/networking/src/NetworkPacket.h @@ -19,7 +19,7 @@ /// Storage of not-yet processed inbound, or not yet sent outbound generic UDP network packet class NetworkPacket { public: - NetworkPacket() { } + NetworkPacket(); NetworkPacket(const NetworkPacket& packet); // copy constructor NetworkPacket& operator= (const NetworkPacket& other); // copy assignment diff --git a/libraries/networking/src/PacketList.h b/libraries/networking/src/PacketList.h index 1b0905a1c8..86df44a968 100644 --- a/libraries/networking/src/PacketList.h +++ b/libraries/networking/src/PacketList.h @@ -12,7 +12,9 @@ #ifndef hifi_PacketList_h #define hifi_PacketList_h -#pragma once +#include + +#include "PacketHeaders.h" template class PacketList : public QIODevice { public: @@ -20,7 +22,7 @@ public: virtual bool isSequential() const { return true; } - void startSegment() { _segmentStartIndex = currentPacket->payload().pos(); } + void startSegment() { _segmentStartIndex = _currentPacket->payload().pos(); } void endSegment() { _segmentStartIndex = -1; } void closeCurrentPacket(); @@ -28,7 +30,7 @@ public: void setExtendedHeader(const QByteArray& extendedHeader) { _extendedHeader = extendedHeader; } protected: qint64 writeData(const char* data, qint64 maxSize); - qint64 readData(const char* data, qint64 maxSize) { return 0 }; + qint64 readData(const char* data, qint64 maxSize) { return 0; }; private: void createPacketWithExtendedHeader(); @@ -40,7 +42,7 @@ private: int _segmentStartIndex = -1; - QByteArray _extendedHeader = extendedHeader; -} + QByteArray _extendedHeader; +}; #endif // hifi_PacketList_h