return ret;
}
-qlonglong QLocalePrivate::bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow)
+qlonglong QLocalePrivate::bytearrayToLongLong(const char *num, int base, bool *ok)
{
if (*num == '\0') {
if (ok != Q_NULLPTR)
*ok = false;
- if (overflow != Q_NULLPTR)
- *overflow = false;
return 0;
}
if ((ret == LLONG_MIN || ret == LLONG_MAX) && (errno == ERANGE || errno == EINVAL)) {
if (ok != Q_NULLPTR)
*ok = false;
- if (overflow != Q_NULLPTR) {
- // the only way qstrtoll can fail with *endptr != '\0' on a non-empty
- // input string is overflow
- *overflow = *endptr != '\0';
- }
return 0;
}
// we stopped at a non-digit character after converting some digits
if (ok != Q_NULLPTR)
*ok = false;
- if (overflow != Q_NULLPTR)
- *overflow = false;
return 0;
}
if (ok != Q_NULLPTR)
*ok = true;
- if (overflow != Q_NULLPTR)
- *overflow = false;
return ret;
}
static double bytearrayToDouble(const char *num, bool *ok, bool *overflow = Q_NULLPTR);
- static qint64 bytearrayToLongLong(const char *num, int base, bool *ok, bool *overflow = Q_NULLPTR);
+ static qint64 bytearrayToLongLong(const char *num, int base, bool *ok);
static quint64 bytearrayToUnsLongLong(const char *num, int base, bool *ok);
typedef QVarLengthArray<char, 256> CharBuff;
if (buff.size() == 1 && (buff.at(0) == '+' || buff.at(0) == '-'))
return Intermediate;
- bool ok, overflow;
- qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
- if (overflow || !ok)
+ bool ok;
+ qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok);
+ if (!ok)
return Invalid;
if (entered >= b && entered <= t) {
if (!cl.d()->validateChars(input, QLocalePrivate::IntegerMode, &buff))
return;
}
- bool ok, overflow;
- qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
- if (ok && !overflow)
+ bool ok;
+ qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok);
+ if (ok)
input = locale().toString(entered);
}