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>
This commit is contained in:
parent
62e89f4745
commit
7d374b7ba6
@ -6163,11 +6163,7 @@ QString QString::vasprintf(const char *cformat, va_list ap)
|
|||||||
}
|
}
|
||||||
case 'p': {
|
case 'p': {
|
||||||
void *arg = va_arg(ap, void*);
|
void *arg = va_arg(ap, void*);
|
||||||
#ifdef Q_OS_WIN64
|
const quint64 i = reinterpret_cast<quintptr>(arg);
|
||||||
quint64 i = reinterpret_cast<quint64>(arg);
|
|
||||||
#else
|
|
||||||
quint64 i = reinterpret_cast<unsigned long>(arg);
|
|
||||||
#endif
|
|
||||||
flags |= QLocaleData::Alternate;
|
flags |= QLocaleData::Alternate;
|
||||||
subst = QLocaleData::c()->unsLongLongToString(i, precision, 16, width, flags);
|
subst = QLocaleData::c()->unsLongLongToString(i, precision, 16, width, flags);
|
||||||
++c;
|
++c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user