Fix Qt 5.12.3 type errors

This commit is contained in:
David Rowe 2021-12-30 13:04:10 +13:00 committed by Julian Groß
parent 2275c61f9c
commit 058b9032cc
4 changed files with 14 additions and 14 deletions

View file

@ -51,12 +51,12 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
dataStream >> newHeader.lastPingTimestamp;
SocketType publicSocketType, localSocketType;
quint8 publicSocketType, localSocketType;
dataStream >> newHeader.nodeType
>> publicSocketType >> newHeader.publicSockAddr >> localSocketType >> newHeader.localSockAddr
>> newHeader.interestList >> newHeader.placeName;
newHeader.publicSockAddr.setType(publicSocketType);
newHeader.localSockAddr.setType(localSocketType);
newHeader.publicSockAddr.setType((SocketType)publicSocketType);
newHeader.localSockAddr.setType((SocketType)localSocketType);
// For WebRTC connections, the user client's signaling channel WebSocket address is used instead of the actual data
// channel's address.

View file

@ -196,9 +196,9 @@ bool Node::isIgnoringNodeWithID(const QUuid& nodeID) const {
QDataStream& operator<<(QDataStream& out, const Node& node) {
out << node._type;
out << node._uuid;
out << node._publicSocket.getType();
out << (quint8)node._publicSocket.getType();
out << node._publicSocket;
out << node._localSocket.getType();
out << (quint8)node._localSocket.getType();
out << node._localSocket;
out << node._permissions;
out << node._isReplicated;
@ -207,15 +207,15 @@ QDataStream& operator<<(QDataStream& out, const Node& node) {
}
QDataStream& operator>>(QDataStream& in, Node& node) {
SocketType publicSocketType, localSocketType;
quint8 publicSocketType, localSocketType;
in >> node._type;
in >> node._uuid;
in >> publicSocketType;
in >> node._publicSocket;
node._publicSocket.setType(publicSocketType);
node._publicSocket.setType((SocketType)publicSocketType);
in >> localSocketType;
in >> node._localSocket;
node._localSocket.setType(localSocketType);
node._localSocket.setType((SocketType)localSocketType);
in >> node._permissions;
in >> node._isReplicated;
in >> node._localID;

View file

@ -496,8 +496,8 @@ void NodeList::sendDomainServerCheckIn() {
// pack our data to send to the domain-server including
// the hostname information (so the domain-server can see which place name we came in on)
packetStream << _ownerType.load() << publicSockAddr.getType() << publicSockAddr << localSockAddr.getType()
<< localSockAddr << _nodeTypesOfInterest.toList();
packetStream << _ownerType.load() << (quint8)publicSockAddr.getType() << publicSockAddr
<< (quint8)localSockAddr.getType() << localSockAddr << _nodeTypesOfInterest.toList();
packetStream << DependencyManager::get<AddressManager>()->getPlaceName();
if (!domainIsConnected) {
@ -882,7 +882,7 @@ void NodeList::processDomainServerRemovedNode(QSharedPointer<ReceivedMessage> me
void NodeList::parseNodeFromPacketStream(QDataStream& packetStream) {
NewNodeInfo info;
SocketType publicSocketType, localSocketType;
quint8 publicSocketType, localSocketType;
packetStream >> info.type
>> info.uuid
>> publicSocketType
@ -893,8 +893,8 @@ void NodeList::parseNodeFromPacketStream(QDataStream& packetStream) {
>> info.isReplicated
>> info.sessionLocalID
>> info.connectionSecretUUID;
info.publicSocket.setType(publicSocketType);
info.localSocket.setType(localSocketType);
info.publicSocket.setType((SocketType)publicSocketType);
info.localSocket.setType((SocketType)localSocketType);
// if the public socket address is 0 then it's reachable at the same IP
// as the domain server

View file

@ -19,7 +19,7 @@
/// @brief The types of network socket.
enum class SocketType : uint8_t {
enum class SocketType : quint8 {
Unknown, ///< Socket type unknown or not set.
UDP, ///< UDP socket.
WebRTC ///< WebRTC socket. A WebRTC data channel presented as a UDP-style socket.