Port to std::(v)snprinf() and mark the module q(v)snprinf-free
Pick-to: 6.8 Change-Id: I682ddfae8d6132ee2d5f8e763e2af2d76ed4bb4c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
1fca1477eb
commit
819c32e3c2
|
@ -4,3 +4,4 @@ set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
|
|||
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1")
|
||||
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
|
||||
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
|
||||
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_QSNPRINTF=1")
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
#include <config.h>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <qdebug.h>
|
||||
#include <qbytearray.h> // qvsnprintf
|
||||
#include <FilePrintStream.h>
|
||||
|
||||
#if ENABLE(ASSEMBLER) && CPU(X86) && !OS(MAC_OS_X)
|
||||
|
@ -58,7 +60,7 @@ FilePrintStream& dataFile()
|
|||
void dataLogFV(const char* format, va_list args)
|
||||
{
|
||||
char buffer[1024];
|
||||
qvsnprintf(buffer, sizeof(buffer), format, args);
|
||||
std::vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
qDebug().nospace().noquote() << buffer;
|
||||
}
|
||||
|
||||
|
@ -67,7 +69,7 @@ void dataLogF(const char* format, ...)
|
|||
char buffer[1024];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
qvsnprintf(buffer, sizeof(buffer), format, args);
|
||||
std::vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
va_end(args);
|
||||
qDebug().nospace().noquote() << buffer;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include <assembler/LinkBuffer.h>
|
||||
#include <WTFStubs.h>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#if QT_CONFIG(qml_jit)
|
||||
|
||||
#undef ENABLE_ALL_ASSEMBLERS_FOR_REFACTORING_PURPOSES
|
||||
|
@ -44,7 +46,7 @@ public:
|
|||
|
||||
void vprintf(const char* format, va_list argList) override WTF_ATTRIBUTE_PRINTF(2, 0)
|
||||
{
|
||||
const int printed = qvsnprintf(buf.data(), buf.size(), format, argList);
|
||||
const int printed = std::vsnprintf(buf.data(), buf.size(), format, argList);
|
||||
Q_ASSERT(printed <= buf.size());
|
||||
|
||||
qint64 written = 0;
|
||||
|
|
Loading…
Reference in New Issue