Fix the build for QUuid
authorLiang Qi <liang.qi@nokia.com>
Mon, 23 May 2011 07:27:23 +0000 (09:27 +0200)
committerQt Continuous Integration System <qt-info@nokia.com>
Fri, 27 May 2011 11:21:39 +0000 (13:21 +0200)
Add a quint8 specialization for qbswap.

Reviewed-by: Bradley T. Hughes
(cherry picked from commit 32a583b575da1b387955734ccf36b0a93de37670)

Change-Id: I7dae5e47565ed30de960983649e5c214e0303fe3
Reviewed-on: http://codereview.qt.nokia.com/171
Reviewed-by: Liang Qi <liang.qi@nokia.com>
src/corelib/global/qendian.h
src/corelib/plugin/quuid.cpp

index 4e3f4e3..8a17af5 100644 (file)
@@ -363,6 +363,11 @@ template <typename T> inline void qToLittleEndian(T src, uchar *dest)
 
 #endif // Q_BYTE_ORDER == Q_BIG_ENDIAN
 
+template <> inline quint8 qbswap<quint8>(quint8 source)
+{
+    return source;
+}
+
 QT_END_NAMESPACE
 
 QT_END_HEADER
index 7ef8522..e99f87a 100644 (file)
@@ -52,8 +52,7 @@ void _q_toHex(Char *&dst, Integral value)
 {
     static const char digits[] = "0123456789abcdef";
 
-    if (sizeof(Integral) > 1)
-        value = qToBigEndian(value);
+    value = qToBigEndian(value);
 
     const char* p = reinterpret_cast<const char*>(&value);