diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-22 12:53:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-24 12:39:02 +0100 |
commit | 998860f00ca1c9eb333787595e05e8cb486802c8 (patch) | |
tree | cf1dc15635797fd3283f1ee8e87bc1fd4bb1b693 /src/3rdparty/double-conversion/double-conversion.h | |
parent | 9fb297a54bd0226b4827b5d7ca093a7f9c4922fa (diff) |
Update our double conversion code to the latest release from code.google.com
This fixes AArch64 builds and brings us in sync with upstream commit 2fb03de56faa32bbba5e02222528e7b760f71d77
Task-number: QTBUG-35528
Change-Id: Ib356627e06c1fecaa5b3f66d0a98fb5b30dc87e5
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/double-conversion/double-conversion.h')
-rw-r--r-- | src/3rdparty/double-conversion/double-conversion.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/3rdparty/double-conversion/double-conversion.h b/src/3rdparty/double-conversion/double-conversion.h index f98edae75a..6bdfa8d25d 100644 --- a/src/3rdparty/double-conversion/double-conversion.h +++ b/src/3rdparty/double-conversion/double-conversion.h @@ -415,9 +415,10 @@ class StringToDoubleConverter { // junk, too. // - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of // a double literal. - // - ALLOW_LEADING_SPACES: skip over leading spaces. - // - ALLOW_TRAILING_SPACES: ignore trailing spaces. - // - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign. + // - ALLOW_LEADING_SPACES: skip over leading whitespace, including spaces, + // new-lines, and tabs. + // - ALLOW_TRAILING_SPACES: ignore trailing whitespace. + // - ALLOW_SPACES_AFTER_SIGN: ignore whitespace after the sign. // Ex: StringToDouble("- 123.2") -> -123.2. // StringToDouble("+ 123.2") -> 123.2 // @@ -502,19 +503,24 @@ class StringToDoubleConverter { // in the 'processed_characters_count'. Trailing junk is never included. double StringToDouble(const char* buffer, int length, - int* processed_characters_count) { - return StringToIeee(buffer, length, processed_characters_count, true); - } + int* processed_characters_count) const; + + // Same as StringToDouble above but for 16 bit characters. + double StringToDouble(const uc16* buffer, + int length, + int* processed_characters_count) const; // Same as StringToDouble but reads a float. // Note that this is not equivalent to static_cast<float>(StringToDouble(...)) // due to potential double-rounding. float StringToFloat(const char* buffer, int length, - int* processed_characters_count) { - return static_cast<float>(StringToIeee(buffer, length, - processed_characters_count, false)); - } + int* processed_characters_count) const; + + // Same as StringToFloat above but for 16 bit characters. + float StringToFloat(const uc16* buffer, + int length, + int* processed_characters_count) const; private: const int flags_; @@ -523,10 +529,11 @@ class StringToDoubleConverter { const char* const infinity_symbol_; const char* const nan_symbol_; - double StringToIeee(const char* buffer, + template <class Iterator> + double StringToIeee(Iterator start_pointer, int length, - int* processed_characters_count, - bool read_as_double); + bool read_as_double, + int* processed_characters_count) const; DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); }; |