| Index: third_party/WebKit/Source/wtf/dtoa.h
|
| diff --git a/third_party/WebKit/Source/wtf/dtoa.h b/third_party/WebKit/Source/wtf/dtoa.h
|
| index fad2f7ba33d1f6c29f55db3a6c18a0e9f9a050fc..4f214b4bdf43d855b1963421badc628cea41bcae 100644
|
| --- a/third_party/WebKit/Source/wtf/dtoa.h
|
| +++ b/third_party/WebKit/Source/wtf/dtoa.h
|
| @@ -34,9 +34,23 @@ extern Mutex* s_dtoaP5Mutex;
|
|
|
| typedef char DtoaBuffer[80];
|
|
|
| -WTF_EXPORT void dtoa(DtoaBuffer result, double dd, bool& sign, int& exponent, unsigned& precision);
|
| -WTF_EXPORT void dtoaRoundSF(DtoaBuffer result, double dd, int ndigits, bool& sign, int& exponent, unsigned& precision);
|
| -WTF_EXPORT void dtoaRoundDP(DtoaBuffer result, double dd, int ndigits, bool& sign, int& exponent, unsigned& precision);
|
| +WTF_EXPORT void dtoa(DtoaBuffer result,
|
| + double dd,
|
| + bool& sign,
|
| + int& exponent,
|
| + unsigned& precision);
|
| +WTF_EXPORT void dtoaRoundSF(DtoaBuffer result,
|
| + double dd,
|
| + int ndigits,
|
| + bool& sign,
|
| + int& exponent,
|
| + unsigned& precision);
|
| +WTF_EXPORT void dtoaRoundDP(DtoaBuffer result,
|
| + double dd,
|
| + int ndigits,
|
| + bool& sign,
|
| + int& exponent,
|
| + unsigned& precision);
|
|
|
| // Size = 80 for sizeof(DtoaBuffer) + some sign bits, decimal point, 'e', exponent digits.
|
| const unsigned NumberToStringBufferLength = 96;
|
| @@ -44,33 +58,49 @@ typedef char NumberToStringBuffer[NumberToStringBufferLength];
|
| typedef LChar NumberToLStringBuffer[NumberToStringBufferLength];
|
|
|
| WTF_EXPORT const char* numberToString(double, NumberToStringBuffer);
|
| -WTF_EXPORT const char* numberToFixedPrecisionString(double, unsigned significantFigures, NumberToStringBuffer, bool truncateTrailingZeros = false);
|
| -WTF_EXPORT const char* numberToFixedWidthString(double, unsigned decimalPlaces, NumberToStringBuffer);
|
| -
|
| -WTF_EXPORT double parseDouble(const LChar* string, size_t length, size_t& parsedLength);
|
| -WTF_EXPORT double parseDouble(const UChar* string, size_t length, size_t& parsedLength);
|
| +WTF_EXPORT const char* numberToFixedPrecisionString(
|
| + double,
|
| + unsigned significantFigures,
|
| + NumberToStringBuffer,
|
| + bool truncateTrailingZeros = false);
|
| +WTF_EXPORT const char* numberToFixedWidthString(double,
|
| + unsigned decimalPlaces,
|
| + NumberToStringBuffer);
|
| +
|
| +WTF_EXPORT double parseDouble(const LChar* string,
|
| + size_t length,
|
| + size_t& parsedLength);
|
| +WTF_EXPORT double parseDouble(const UChar* string,
|
| + size_t length,
|
| + size_t& parsedLength);
|
|
|
| namespace Internal {
|
| - double parseDoubleFromLongString(const UChar* string, size_t length, size_t& parsedLength);
|
| +double parseDoubleFromLongString(const UChar* string,
|
| + size_t length,
|
| + size_t& parsedLength);
|
| }
|
|
|
| -inline double parseDouble(const LChar* string, size_t length, size_t& parsedLength)
|
| -{
|
| - return double_conversion::StringToDoubleConverter::StringToDouble(reinterpret_cast<const char*>(string), length, &parsedLength);
|
| +inline double parseDouble(const LChar* string,
|
| + size_t length,
|
| + size_t& parsedLength) {
|
| + return double_conversion::StringToDoubleConverter::StringToDouble(
|
| + reinterpret_cast<const char*>(string), length, &parsedLength);
|
| }
|
|
|
| -inline double parseDouble(const UChar* string, size_t length, size_t& parsedLength)
|
| -{
|
| - const size_t conversionBufferSize = 64;
|
| - if (length > conversionBufferSize)
|
| - return Internal::parseDoubleFromLongString(string, length, parsedLength);
|
| - LChar conversionBuffer[conversionBufferSize];
|
| - for (size_t i = 0; i < length; ++i)
|
| - conversionBuffer[i] = isASCII(string[i]) ? static_cast<LChar>(string[i]) : 0;
|
| - return parseDouble(conversionBuffer, length, parsedLength);
|
| +inline double parseDouble(const UChar* string,
|
| + size_t length,
|
| + size_t& parsedLength) {
|
| + const size_t conversionBufferSize = 64;
|
| + if (length > conversionBufferSize)
|
| + return Internal::parseDoubleFromLongString(string, length, parsedLength);
|
| + LChar conversionBuffer[conversionBufferSize];
|
| + for (size_t i = 0; i < length; ++i)
|
| + conversionBuffer[i] =
|
| + isASCII(string[i]) ? static_cast<LChar>(string[i]) : 0;
|
| + return parseDouble(conversionBuffer, length, parsedLength);
|
| }
|
|
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|
| using WTF::NumberToStringBuffer;
|
| using WTF::NumberToLStringBuffer;
|
| @@ -79,4 +109,4 @@ using WTF::numberToFixedPrecisionString;
|
| using WTF::numberToFixedWidthString;
|
| using WTF::parseDouble;
|
|
|
| -#endif // WTF_dtoa_h
|
| +#endif // WTF_dtoa_h
|
|
|