summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-01-12 10:24:47 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-01-20 16:15:06 +0100
commit463c559962ad480c69fdbe6ebcf741a4b2bd6eee (patch)
treeb35b1cf78b747fecd6fae94d64f828b369ef1ede /src/corelib/io/qdebug.cpp
parenta373ffcda9b2e7b38509dcb2e772b86d67a72c80 (diff)
MSVC: Silence warning about right shift by too large amount
Silence the MSVC warning that got introduced in commit 62b752b3a2c9: warning C4333: '>>' : right shift by too large amount, data loss qdebug.cpp(316) : see reference to function template instantiation 'void putEscapedString<uchar>(QTextStreamPrivate *,const Char *,int,bool)' being compiled with [ Char=uchar ] qdebug.cpp(270) : warning C4333: '>>' : right shift by too large amount, data loss Change-Id: If1ee20b741feae3287a8d6a11c202b4296d429fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r--src/corelib/io/qdebug.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 9ed29c38af..ad61621a93 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2014 Intel Corporation.
** Contact: http://www.qt-project.org/legal
**
@@ -263,12 +263,8 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, in
// improperly-paired surrogates, fall through
}
buf[1] = 'u';
- if (sizeof(Char) == 1) {
- buf[2] = buf[3] = '0';
- } else {
- buf[2] = toHexUpper(*p >> 12);
- buf[3] = toHexUpper(*p >> 8);
- }
+ buf[2] = toHexUpper(ushort(*p) >> 12);
+ buf[3] = toHexUpper(ushort(*p) >> 8);
buf[4] = toHexUpper(*p >> 4);
buf[5] = toHexUpper(*p);
buflen = 6;