From bc108d7c7ea491bfc8618a8389d4806aea44bfbf Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 3 Jan 2016 14:51:07 -0200 Subject: Work around GCC 6 warning about offset outside bounds of string This is a false positive because the only offset that can be outside the bounds was the last one (-1), which could not be reached in this line because of the qBound on the line before limiting the maximum value. The -1 wasn't generated by the Perl script embedded in the file anyway. qdbuserror.cpp:142:64: error: offset outside bounds of constant string [-Werror] Change-Id: I24a735698d3c4a719fc9ffff1425f8aad5e5978e Reviewed-by: Alex Blasche Reviewed-by: Frederik Gladhorn --- src/dbus/qdbuserror.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 40e97ae483..d6a329cfe8 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -130,11 +130,11 @@ static const int errorMessages_indices[] = { 0, 6, 40, 76, 118, 153, 191, 231, 273, 313, 349, 384, 421, 461, 501, 540, 581, 617, 661, 705, 746, 789, 833, 874, - 916, 961, 1005, -1 + 916, 961, 1005 }; static const int errorMessages_count = sizeof errorMessages_indices / - sizeof errorMessages_indices[0] - 1; + sizeof errorMessages_indices[0]; static inline const char *get(QDBusError::ErrorType code) { -- cgit v1.2.3 From 71c0bb3fd12650f44bb6095d4915e2551fc11e11 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 7 Jan 2016 19:56:41 +0000 Subject: Revert "dbus: Add method serial() and replySerial() to class DBusMessage." This reverts commit 618e2cc081e09d9222418bd933876224675a7530. The original commit has a section of code that I failed to review properly and is of questionable functionality. Change-Id: I61c53d7b8b2aa7c3312292b017a18aba7da11bc5 Reviewed-by: Thiago Macieira --- src/dbus/qdbus_symbols_p.h | 2 -- src/dbus/qdbusmessage.cpp | 41 ----------------------------------------- src/dbus/qdbusmessage.h | 2 -- src/dbus/qdbusmessage_p.h | 2 -- 4 files changed, 47 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index 67680f6b82..1991a462e9 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -286,8 +286,6 @@ DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message), (message), return) DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message), (message), return) -DEFINEFUNC(dbus_uint32_t , dbus_message_get_reply_serial, (DBusMessage *message), - (message), return) DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message), (message), return) DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message), diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 078442f3f1..43a562e92e 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -188,12 +188,7 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB // check if everything is ok if (marshaller.ok) - { - QDBusMessage *m = (QDBusMessage*)&message; - q_dbus_message_ref(msg); - m->d_ptr->msg = msg; return msg; - } // not ok; q_dbus_message_unref(msg); @@ -322,16 +317,6 @@ QDBusMessage QDBusMessagePrivate::makeLocalReply(const QDBusConnectionPrivate &c return QDBusMessage(); // failed } -uint QDBusMessagePrivate::serial() -{ - return msg ? q_dbus_message_get_serial(msg) : reply ? q_dbus_message_get_serial(reply) : 0; -} - -uint QDBusMessagePrivate::replySerial() -{ - return msg ? q_dbus_message_get_reply_serial(msg) : reply ? q_dbus_message_get_reply_serial(reply) : 0; -} - /*! \class QDBusMessage \inmodule QtDBus @@ -647,32 +632,6 @@ QString QDBusMessage::signature() const return d_ptr->signature; } -/*! - Returns the serial of the message or 0 if undefined. - - The serial number is a unique identifier of a message coming from a - given connection. - - The serial is set to a non zero value after the message has been sent - over a D-Bus connection. -*/ -uint QDBusMessage::serial() const -{ - return d_ptr->serial(); -} - -/*! - Returns the serial of the message this is a reply to or 0 if undefined. - - The serial number is a unique identifier of a message coming from a - given connection and D-Bus messages of 'method return' or 'error' type - use them to match the reply to the method call message. -*/ -uint QDBusMessage::replySerial() const -{ - return d_ptr->replySerial(); -} - /*! Returns the flag that indicates if this message should see a reply or not. This is only meaningful for \l {MethodCallMessage}{method diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index f6538bd2cf..e85d600080 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -104,8 +104,6 @@ public: QString errorMessage() const; MessageType type() const; QString signature() const; - uint serial() const; - uint replySerial() const; bool isReplyRequired() const; diff --git a/src/dbus/qdbusmessage_p.h b/src/dbus/qdbusmessage_p.h index 0ad9924cac..5abd490502 100644 --- a/src/dbus/qdbusmessage_p.h +++ b/src/dbus/qdbusmessage_p.h @@ -93,8 +93,6 @@ public: const QDBusMessage &asSent); static QDBusMessage makeLocalReply(const QDBusConnectionPrivate &conn, const QDBusMessage &asSent); - uint serial(); - uint replySerial(); }; QT_END_NAMESPACE -- cgit v1.2.3 From 15b65e7a5f6f5ca962a6688116641502ff41ae00 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 7 Jan 2016 19:56:35 +0000 Subject: Revert "dbus: Print out 'serial' and 'serial reply to' with DBusMessage operator<<." This reverts commit d3fe4f066f70bc8e4aef06b963444ecdbc3dd00f. Required to revert the parent commit. Change-Id: I1039e2ee65c0cd2c3209ea18bd3bd2d84a8daef3 Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 4 ++-- src/dbus/qdbusmessage.cpp | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 0c0109b6b6..f6221d51b6 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1819,8 +1819,8 @@ bool QDBusConnectionPrivate::send(const QDBusMessage& message) } q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything - emit messageNeedsSending(Q_NULLPTR, msg); qDBusDebug() << this << "sending message (no reply):" << message; + emit messageNeedsSending(Q_NULLPTR, msg); return true; } @@ -2019,8 +2019,8 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM lastError = error; processFinishedCall(pcall); } else { - emit messageNeedsSending(pcall, msg, timeout); qDBusDebug() << this << "sending message:" << message; + emit messageNeedsSending(pcall, msg, timeout); } return pcall; } diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 43a562e92e..32b7787514 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -820,16 +820,10 @@ QDebug operator<<(QDebug dbg, const QDBusMessage &msg) msg.type() == QDBusMessage::SignalMessage) dbg.nospace() << ", path=" << msg.path() << ", interface=" << msg.interface() - << ", member=" << msg.member() - << ", serial=" << msg.serial(); + << ", member=" << msg.member(); if (msg.type() == QDBusMessage::ErrorMessage) dbg.nospace() << ", error name=" << msg.errorName() - << ", error message=" << msg.errorMessage() - << ", serial=" << msg.serial() - << ", reply serial=" << msg.replySerial(); - else if (msg.type() == QDBusMessage::ReplyMessage) - dbg.nospace() << ", serial=" << msg.serial() - << ", reply serial=" << msg.replySerial(); + << ", error message=" << msg.errorMessage(); dbg.nospace() << ", signature=" << msg.signature() << ", contents=("; debugVariantList(dbg, msg.arguments()); -- cgit v1.2.3