Compile fixes

This commit is contained in:
Atlante45 2015-07-07 18:17:28 -07:00
parent ca45c3f44d
commit 5d95a5c117
3 changed files with 8 additions and 10 deletions

View file

@ -398,11 +398,11 @@ void NodeList::sendDSPathQuery(const QString& newPath) {
QByteArray pathQueryUTF8 = newPath.toUtf8();
// get the size of the UTF8 representation of the desired path
quint16 numPathBytes = pathQueryUTF8.size();
qint64 numPathBytes = pathQueryUTF8.size();
if (numPathBytes + sizeof(numPathBytes) < pathQueryPacket.size() ) {
if (numPathBytes + (qint64)sizeof(numPathBytes) < pathQueryPacket->bytesAvailable() ) {
// append the size of the path to the query packet
pathQueryPacket->write(&numPathBytes, sizeof(numPathBytes));
pathQueryPacket->write((char*)&pathQueryUTF8, sizeof(numPathBytes));
// append the path itself to the query packet
pathQueryPacket->write(pathQueryUTF8);
@ -423,7 +423,7 @@ void NodeList::handleDSPathQueryResponse(const QByteArray& packet) {
// This is a response to a path query we theoretically made.
// In the future we may want to check that this was actually from our DS and for a query we actually made.
int numHeaderBytes = numBytesForPacketHeaderGivenPacketType(PacketTypeDomainServerPathResponse);
int numHeaderBytes = numBytesForPacketHeaderGivenPacketType(PacketType::DomainServerPathResponse);
const char* startPosition = packet.data() + numHeaderBytes;
const char* currentPosition = startPosition;

View file

@ -49,10 +49,8 @@ PacketSender::~PacketSender() {
void PacketSender::queuePacketForSending(const SharedNodePointer& destinationNode, std::unique_ptr<NLPacket> packet) {
NodePacketPair networkPacket(destinationNode, packet);
lock();
_packets.push_back(networkPacket);
_packets.push_back({destinationNode, std::move(packet)});
unlock();
_totalPacketsQueued++;

View file

@ -25,7 +25,7 @@ void ReceivedPacketProcessor::queueReceivedPacket(const SharedNodePointer& sendi
NodePacketPair networkPacket(sendingNode, NLPacket::create(PacketType::OctreeStats));
lock();
_packets.push_back(networkPacket);
_packets.push_back(std::move(networkPacket));
_nodePacketCounts[sendingNode->getUUID()]++;
unlock();
@ -51,14 +51,14 @@ bool ReceivedPacketProcessor::process() {
currentPackets.swap(_packets);
unlock();
foreach(auto& packetPair, currentPackets) {
for(auto& packetPair : currentPackets) {
// TODO: Replace QByteArray() once NLPacket is coming through on receive side
processPacket(packetPair.first, QByteArray());
midProcess();
}
lock();
foreach(auto& packetPair, currentPackets) {
for(auto& packetPair : currentPackets) {
_nodePacketCounts[packetPair.first->getUUID()]--;
}
unlock();