From b209f943d2611fa4ac2dd9c64b1a014182b59a3d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 20 Mar 2023 12:33:02 +0100 Subject: Replace {add,sub,mul}_overload with q{Add,Sub,Mul}Overload These APIs started out as private APIs in qnumeric_p.h, but have since been made pseudo-public in qnumeric.h. The qnumeric_p.h versions just forward to the qnumeric.h ones, so just use the latter. This is in preparation of removing the {add,sub,mul}_overflow versions, which, despite being defined in the unnamed namespace, don't sport the q prefix, so potentially clash with global symbols. The change is a simple textual search and replace, manually excluding qnumeric_p.h. Picking to 6.5 to avoid cherry-pick conflicts going forward. Pick-to: 6.6 6.5 Change-Id: Ic0f7c92f7c47923317109e8a9dc06fa66bdff2c2 Reviewed-by: Fabian Kosmale --- src/corelib/io/qurlidna.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib/io/qurlidna.cpp') diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index da592eb81b1..bb14e1cdf7d 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -132,7 +132,7 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output) // delta = delta + (m - n) * (h + 1), fail on overflow uint tmp; - if (mul_overflow(m - n, h + 1, &tmp) || add_overflow(delta, tmp, &delta)) { + if (qMulOverflow(m - n, h + 1, &tmp) || qAddOverflow(delta, tmp, &delta)) { output->truncate(outLen); return; // punycode_overflow } @@ -144,7 +144,7 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(QStringView in, QString *output) // increase delta until we reach the character processed in this iteration; // fail if delta overflows. if (c < n) { - if (add_overflow(delta, 1, &delta)) { + if (qAddOverflow(delta, 1, &delta)) { output->truncate(outLen); return; // punycode_overflow } @@ -219,7 +219,7 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc) // i = i + digit * w, fail on overflow uint tmp; - if (mul_overflow(digit, w, &tmp) || add_overflow(i, tmp, &i)) + if (qMulOverflow(digit, w, &tmp) || qAddOverflow(i, tmp, &i)) return QString(); // detect threshold to stop reading delta digits @@ -231,7 +231,7 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc) if (digit < t) break; // w = w * (base - t), fail on overflow - if (mul_overflow(w, base - t, &w)) + if (qMulOverflow(w, base - t, &w)) return QString(); } @@ -241,7 +241,7 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc) bias = adapt(i - oldi, outputLength + 1, oldi == 0); // n = n + i div (length(output) + 1), fail on overflow - if (add_overflow(n, i / (outputLength + 1), &n)) + if (qAddOverflow(n, i / (outputLength + 1), &n)) return QString(); // allow the deltas to wrap around -- cgit v1.2.3