Add "qt_" prefix to asciiToDouble and doubleToAscii functions

Change-Id: Ie01831ddac5446fdbdeefffd154688839acbe838
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2018-07-31 11:47:01 -07:00
parent 6c8160b0dc
commit 95c0b24cd8
4 changed files with 16 additions and 16 deletions

View File

@ -4142,7 +4142,7 @@ double QByteArray::toDouble(bool *ok) const
QByteArray nulled = nulTerminated();
bool nonNullOk = false;
int processed = 0;
double d = asciiToDouble(nulled.constData(), nulled.length(),
double d = qt_asciiToDouble(nulled.constData(), nulled.length(),
nonNullOk, processed, WhitespacesAllowed);
if (ok)
*ok = nonNullOk;

View File

@ -3077,7 +3077,7 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q
QVarLengthArray<char> 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<int>(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;

View File

@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE
QT_CLOCALE_HOLDER
void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize,
void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, int bufSize,
bool &sign, int &length, int &decpt)
{
if (bufSize == 0) {
@ -277,7 +277,7 @@ void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *
--length;
}
double asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
StrayCharacterMode strayCharMode)
{
if (*num == '\0') {
@ -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,7 +564,7 @@ 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,
qt_doubleToAscii(d, QLocaleData::DFSignificantDigits, QLocale::FloatingPointShortest, result,
QLocaleData::DoubleMaxSignificant + 1, nonNullSign, length, nonNullDecpt);
if (sign)

View File

@ -78,9 +78,9 @@ enum StrayCharacterMode {
WhitespacesAllowed
};
double asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
double qt_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,
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);