From d079ca342932c54b03de90efbf54ddb1b7afb830 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Jan 2023 10:42:03 -0800 Subject: [PATCH 1/3] QCborValue: fix build with GCC 13: extended FP support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qcborvalue.cpp:892:32: error: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank [-Werror] Pick-to: 6.5 Change-Id: Ide4dbd0777a44ed0870efffd173906b7cf7c1619 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/serialization/qcborvalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 2ce64d854a1..25fab828688 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -889,7 +889,7 @@ static void writeDoubleToCbor(QCborStreamWriter &writer, double d, QCborValue::E // no data loss, we could use float #ifndef QT_BOOTSTRAPPED if ((opt & QCborValue::UseFloat16) == QCborValue::UseFloat16) { - qfloat16 f16 = f; + qfloat16 f16 = qfloat16(f); if (f16 == f) return writer.append(f16); } From a67e7e3bb71cb6693b806692440f94a7012e90cb Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 16 Jan 2023 23:55:27 +0200 Subject: [PATCH 2/3] QLocale: add unittests for qstrtod of "NaN" and "nan" The tests pass. Drive-by change: Amend qstrntod API docs, the addition is heavily inspired by cppreference's strtod docs. Change-Id: Ic8e138e117a3249c752ae5ef2a8a21feb010befa Task-number: QTBUG-74325 Pick-to: 6.5 Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale_tools.cpp | 4 +++- tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/text/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp index a123714f7f3..53e70ac984a 100644 --- a/src/corelib/text/qlocale_tools.cpp +++ b/src/corelib/text/qlocale_tools.cpp @@ -552,7 +552,9 @@ QString qulltoa(qulonglong number, int base, const QStringView zero) /*! \internal - Converts the initial portion of the string pointed to by \a s00 to a double, using the 'C' locale. + Converts the initial portion of the string pointed to by \a s00 to a double, + using the 'C' locale. The function sets the pointer pointed to by \a se to + point to the character past the last character converted. */ double qstrntod(const char *s00, qsizetype len, const char **se, bool *ok) { diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 3fb9831705f..52be69e30a3 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1322,6 +1322,10 @@ void tst_QLocale::strtod_data() QTest::newRow("1e2000 cruft") << QString("1e2000 cruft") << qInf() << 6 << false; QTest::newRow("-1e2000 cruft") << QString("-1e2000 cruft") << -qInf() << 7 << false; + // NaN and nan + QTest::newRow("NaN") << QString("NaN") << qQNaN() << 3 << true; + QTest::newRow("nan") << QString("nan") << qQNaN() << 3 << true; + // Underflow, ends with cruft - fails but reports right length: QTest::newRow("1e-2000 cruft") << QString("1e-2000 cruft") << 0.0 << 7 << false; QTest::newRow("-1e-2000 cruft") << QString("-1e-2000 cruft") << 0.0 << 8 << false; From a7c3b747dbe4609b015de9c6e6fc9cdce8f386a0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 17 Jan 2023 07:54:01 -0800 Subject: [PATCH 3/3] tst_QHostInfo: use python3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because Python 2 reached end of life. I wonder how this even works on macOS, as my Monterey doesn't even have "python" any more. Pick-to: 6.2 6.4 6.5 Change-Id: Ibddb9b0ada5a4bbaa64bfffd173b239c6c4b66f3 Reviewed-by: Tor Arne Vestbø --- tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index 3564e52917d..48925343625 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -373,7 +373,7 @@ static QStringList reverseLookupHelper(const QString &ip) QList lines; QProcess python; python.setProcessChannelMode(QProcess::ForwardedErrorChannel); - python.start("python", QStringList() << QString("-c") << pythonCode << ip); + python.start("python3", QStringList() << QString("-c") << pythonCode << ip); if (python.waitForFinished()) { if (python.exitStatus() == QProcess::NormalExit && python.exitCode() == 0) lines = python.readAllStandardOutput().split('\n');