double-conversion: Update to 3.2.1
Retrieved from/changelog here: https://github.com/google/double-conversion/releases/tag/v3.2.1 Task-number: QTBUG-110333 Change-Id: I3e1af9adca37d89ce91812d594e9dd222d35ba8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 132de92c1b4f9cd64cd1c21e9b378a6c452384e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5d2bcf3f3d
commit
2ea02032b3
@ -56,7 +56,7 @@ bool DoubleToStringConverter::HandleSpecialValues(
|
||||
StringBuilder* result_builder) const {
|
||||
Double double_inspect(value);
|
||||
if (double_inspect.IsInfinite()) {
|
||||
if (infinity_symbol_ == NULL) return false;
|
||||
if (infinity_symbol_ == DOUBLE_CONVERSION_NULLPTR) return false;
|
||||
if (value < 0) {
|
||||
result_builder->AddCharacter('-');
|
||||
}
|
||||
@ -64,7 +64,7 @@ bool DoubleToStringConverter::HandleSpecialValues(
|
||||
return true;
|
||||
}
|
||||
if (double_inspect.IsNan()) {
|
||||
if (nan_symbol_ == NULL) return false;
|
||||
if (nan_symbol_ == DOUBLE_CONVERSION_NULLPTR) return false;
|
||||
result_builder->AddString(nan_symbol_);
|
||||
return true;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ double StringToDoubleConverter::StringToIeee(
|
||||
current = next_non_space;
|
||||
}
|
||||
|
||||
if (infinity_symbol_ != NULL) {
|
||||
if (infinity_symbol_ != DOUBLE_CONVERSION_NULLPTR) {
|
||||
if (ConsumeFirstCharacter(*current, infinity_symbol_, allow_case_insensitivity)) {
|
||||
if (!ConsumeSubString(¤t, end, infinity_symbol_, allow_case_insensitivity)) {
|
||||
return junk_string_value_;
|
||||
@ -492,7 +492,7 @@ double StringToDoubleConverter::StringToIeee(
|
||||
}
|
||||
}
|
||||
|
||||
if (nan_symbol_ != NULL) {
|
||||
if (nan_symbol_ != DOUBLE_CONVERSION_NULLPTR) {
|
||||
if (ConsumeFirstCharacter(*current, nan_symbol_, allow_case_insensitivity)) {
|
||||
if (!ConsumeSubString(¤t, end, nan_symbol_, allow_case_insensitivity)) {
|
||||
return junk_string_value_;
|
||||
|
@ -34,6 +34,13 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
// For pre-C++11 compatibility
|
||||
#if __cplusplus >= 201103L
|
||||
#define DOUBLE_CONVERSION_NULLPTR nullptr
|
||||
#else
|
||||
#define DOUBLE_CONVERSION_NULLPTR NULL
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#ifndef DOUBLE_CONVERSION_ASSERT
|
||||
#define DOUBLE_CONVERSION_ASSERT(condition) \
|
||||
@ -241,9 +248,9 @@ inline int StrLength(const char* string) {
|
||||
template <typename T>
|
||||
class Vector {
|
||||
public:
|
||||
Vector() : start_(NULL), length_(0) {}
|
||||
Vector() : start_(DOUBLE_CONVERSION_NULLPTR), length_(0) {}
|
||||
Vector(T* data, int len) : start_(data), length_(len) {
|
||||
DOUBLE_CONVERSION_ASSERT(len == 0 || (len > 0 && data != NULL));
|
||||
DOUBLE_CONVERSION_ASSERT(len == 0 || (len > 0 && data != DOUBLE_CONVERSION_NULLPTR));
|
||||
}
|
||||
|
||||
// Returns a vector using the same backing storage as this one,
|
||||
@ -326,7 +333,7 @@ class StringBuilder {
|
||||
void AddSubstring(const char* s, int n) {
|
||||
DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ + n < buffer_.length());
|
||||
DOUBLE_CONVERSION_ASSERT(static_cast<size_t>(n) <= strlen(s));
|
||||
memmove(&buffer_[position_], s, n);
|
||||
memmove(&buffer_[position_], s, static_cast<size_t>(n));
|
||||
position_ += n;
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
"QtUsage": "Used in Qt Core. Configure with -system-doubleconversion or -no-doubleconversion to avoid.",
|
||||
|
||||
"Homepage": "https://github.com/google/double-conversion",
|
||||
"Version": "3.2.0+e634f265db5d296bd7a780f9813d6b8573f5bd90",
|
||||
"DownloadLocation": "https://github.com/google/double-conversion/commit/e634f265db5d296bd7a780f9813d6b8573f5bd90",
|
||||
"Version": "3.2.1",
|
||||
"DownloadLocation": "https://github.com/google/double-conversion/releases/tag/v3.2.1",
|
||||
"License": "BSD 3-clause \"New\" or \"Revised\" License",
|
||||
"LicenseId": "BSD-3-Clause",
|
||||
"LicenseFile": "LICENSE",
|
||||
|
Loading…
x
Reference in New Issue
Block a user