summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-07-05 15:11:43 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-07-06 10:34:38 +0000
commita91d0dd369313dfa8865f99e590b868146cb4388 (patch)
tree6830b4503933f074bddcbde78cd73762710f0a56
parent4927fdb389b9fbc0d5118437274d4fa3c59fc839 (diff)
Q_(U)INT64_C is not a type, so don't use it as if it was
These expressions only work because they contain no non-parenthesized commas and an int literal is last. Fix by wrapping only the integer literal in Q_(U)INT64_C. Change-Id: I6b8e508b6c7c022f4b3342f65c26aab89ce17702 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 92d8779cab..1b9c0de6e1 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -1272,10 +1272,10 @@ static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx,
// 369 years, 89 leap years
// ((369 * 365) + 89) * 24 * 3600 = 11644473600
- time = Q_UINT64_C(currentTime.toTime_t() + 11644473600);
+ time = currentTime.toTime_t() + Q_UINT64_C(11644473600);
// represented as 100 nano seconds
- time = Q_UINT64_C(time * 10000000);
+ time = time * Q_UINT64_C(10000000);
ds << time;
}
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index 77fc6ad6ae..c978761266 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -189,9 +189,9 @@ void tst_QRingBuffer::free()
ringBuffer.append(QByteArray("01234", 5));
ringBuffer.free(1);
- QCOMPARE(ringBuffer.size(), Q_INT64_C(4095 + 2048 + 5));
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4095) + 2048 + 5);
ringBuffer.free(4096);
- QCOMPARE(ringBuffer.size(), Q_INT64_C(2047 + 5));
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(2047) + 5);
ringBuffer.free(48);
ringBuffer.free(2000);
QCOMPARE(ringBuffer.size(), Q_INT64_C(4));
@@ -251,9 +251,9 @@ void tst_QRingBuffer::chop()
ringBuffer.reserve(4096);
ringBuffer.chop(1);
- QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2048 + 4095));
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5) + 2048 + 4095);
ringBuffer.chop(4096);
- QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2047));
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5) + 2047);
ringBuffer.chop(48);
ringBuffer.chop(2000);
QCOMPARE(ringBuffer.size(), Q_INT64_C(4));