summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-07-01 17:49:26 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-07-02 16:38:39 +0000
commit3b5db8f3a6663fd65d74da875a6d22c430c2e4f7 (patch)
treef622fdb6f03e687cf7d958da64056cd82e278041
parent946c1a578a7c1e6acc95ef8095fa8a6ff026334b (diff)
Examples: Fix stringification of the Qt version
(QT_VERSION % 0xffff00) is useless for now, as QT_VERSION < 0x1000000 (for now). The author of this code probably meant to use bitwise-AND. But even that is unnecessary as the right shift discards the lower 8 bits anyway. Change-Id: Ie585843cfb684bc3b6e3fffd145d533b05288dfc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r--examples/network/torrent/connectionmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/network/torrent/connectionmanager.cpp b/examples/network/torrent/connectionmanager.cpp
index fa10251749..0e15c226b8 100644
--- a/examples/network/torrent/connectionmanager.cpp
+++ b/examples/network/torrent/connectionmanager.cpp
@@ -78,7 +78,7 @@ QByteArray ConnectionManager::clientId() const
// Generate peer id
int startupTime = int(QDateTime::currentDateTime().toTime_t());
- id += QString::asprintf("-QT%04x-", (QT_VERSION % 0xffff00) >> 8).toLatin1();
+ id += QString::asprintf("-QT%04x-", QT_VERSION >> 8).toLatin1();
id += QByteArray::number(startupTime, 10);
id += QByteArray(20 - id.size(), '-');
}