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:
parent
6c8160b0dc
commit
95c0b24cd8
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user