From 95c0b24cd824321e59ae31d5bd78bae62566499b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 31 Jul 2018 11:47:01 -0700 Subject: Add "qt_" prefix to asciiToDouble and doubleToAscii functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie01831ddac5446fdbdeefffd154688839acbe838 Reviewed-by: André Hartmann Reviewed-by: Edward Welbourne --- src/corelib/tools/qbytearray.cpp | 4 ++-- src/corelib/tools/qlocale.cpp | 6 +++--- src/corelib/tools/qlocale_tools.cpp | 14 +++++++------- src/corelib/tools/qlocale_tools_p.h | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index eb360bcad7..3560b21653 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -4142,8 +4142,8 @@ double QByteArray::toDouble(bool *ok) const QByteArray nulled = nulTerminated(); bool nonNullOk = false; int processed = 0; - double d = asciiToDouble(nulled.constData(), nulled.length(), - nonNullOk, processed, WhitespacesAllowed); + double d = qt_asciiToDouble(nulled.constData(), nulled.length(), + nonNullOk, processed, WhitespacesAllowed); if (ok) *ok = nonNullOk; return d; diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 36e2dd52bf..7341d196cb 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3077,7 +3077,7 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q QVarLengthArray buf(bufSize); int length; - doubleToAscii(d, form, precision, buf.data(), bufSize, negative, length, decpt); + qt_doubleToAscii(d, form, precision, buf.data(), bufSize, negative, length, decpt); if (qstrncmp(buf.data(), "inf", 3) == 0 || qstrncmp(buf.data(), "nan", 3) == 0) { num_str = QString::fromLatin1(buf.data(), length); @@ -3587,7 +3587,7 @@ double QLocaleData::stringToDouble(QStringView str, bool *ok, } int processed = 0; bool nonNullOk = false; - double d = asciiToDouble(buff.constData(), buff.length() - 1, nonNullOk, processed); + double d = qt_asciiToDouble(buff.constData(), buff.length() - 1, nonNullOk, processed); if (ok != nullptr) *ok = nonNullOk; return d; @@ -3625,7 +3625,7 @@ double QLocaleData::bytearrayToDouble(const char *num, bool *ok) int len = static_cast(strlen(num)); Q_ASSERT(len >= 0); int processed = 0; - double d = asciiToDouble(num, len, nonNullOk, processed); + double d = qt_asciiToDouble(num, len, nonNullOk, processed); if (ok != nullptr) *ok = nonNullOk; return d; diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index baa4da37f4..bde52a20b9 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -75,8 +75,8 @@ QT_BEGIN_NAMESPACE QT_CLOCALE_HOLDER -void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize, - bool &sign, int &length, int &decpt) +void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize, + bool &sign, int &length, int &decpt) { if (bufSize == 0) { decpt = 0; @@ -277,8 +277,8 @@ void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char * --length; } -double asciiToDouble(const char *num, int numLen, bool &ok, int &processed, - StrayCharacterMode strayCharMode) +double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed, + StrayCharacterMode strayCharMode) { if (*num == '\0') { ok = false; @@ -548,7 +548,7 @@ double qstrntod(const char *s00, int len, const char **se, bool *ok) { int processed = 0; bool nonNullOk = false; - double d = asciiToDouble(s00, len, nonNullOk, processed, TrailingJunkAllowed); + double d = qt_asciiToDouble(s00, len, nonNullOk, processed, TrailingJunkAllowed); if (se) *se = s00 + processed; if (ok) @@ -564,8 +564,8 @@ QString qdtoa(qreal d, int *decpt, int *sign) // Some versions of libdouble-conversion like an extra digit, probably for '\0' char result[QLocaleData::DoubleMaxSignificant + 1]; - doubleToAscii(d, QLocaleData::DFSignificantDigits, QLocale::FloatingPointShortest, result, - QLocaleData::DoubleMaxSignificant + 1, nonNullSign, length, nonNullDecpt); + qt_doubleToAscii(d, QLocaleData::DFSignificantDigits, QLocale::FloatingPointShortest, result, + QLocaleData::DoubleMaxSignificant + 1, nonNullSign, length, nonNullDecpt); if (sign) *sign = nonNullSign ? 1 : 0; diff --git a/src/corelib/tools/qlocale_tools_p.h b/src/corelib/tools/qlocale_tools_p.h index c8ea25b504..594331ae37 100644 --- a/src/corelib/tools/qlocale_tools_p.h +++ b/src/corelib/tools/qlocale_tools_p.h @@ -78,10 +78,10 @@ enum StrayCharacterMode { WhitespacesAllowed }; -double asciiToDouble(const char *num, int numLen, bool &ok, int &processed, - StrayCharacterMode strayCharMode = TrailingJunkProhibited); -void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize, - bool &sign, int &length, int &decpt); +double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed, + StrayCharacterMode strayCharMode = TrailingJunkProhibited); +void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize, + bool &sign, int &length, int &decpt); QString qulltoa(qulonglong l, int base, const QChar _zero); Q_CORE_EXPORT QString qdtoa(qreal d, int *decpt, int *sign); -- cgit v1.2.3