diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-08 16:55:06 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-09 13:45:26 +0000 |
commit | 7d374b7ba68c29a1b065cb1645789dbbc3d5ac33 (patch) | |
tree | 01ccec97caef2d26505fd5a595faba13d1e90f40 /src/corelib/tools | |
parent | 62e89f474551d6de025cc9d53950199df181de16 (diff) |
QString::vasprintf(): Use quintptr when casting pointer for %p.
Previously, the macro Q_OS_WIN64 was checked, causing warnings:
tools\qstring.cpp(6183): warning C4311: 'reinterpret_cast': pointer truncation from 'void *' to 'unsigned long'
tools\qstring.cpp(6183): warning C4302: 'reinterpret_cast': truncation from 'void *' to 'unsigned long'
when compiling WinRT/64bit, where it is not defined.
Change-Id: Ib9d8405108c85170aba18b13f9c64083136bc5ee
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 9924b606c5..cdf37cca07 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6163,11 +6163,7 @@ QString QString::vasprintf(const char *cformat, va_list ap) } case 'p': { void *arg = va_arg(ap, void*); -#ifdef Q_OS_WIN64 - quint64 i = reinterpret_cast<quint64>(arg); -#else - quint64 i = reinterpret_cast<unsigned long>(arg); -#endif + const quint64 i = reinterpret_cast<quintptr>(arg); flags |= QLocaleData::Alternate; subst = QLocaleData::c()->unsLongLongToString(i, precision, 16, width, flags); ++c; |