OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2008, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 inline double parseDouble(const UChar* string, size_t length, size_t& parsedLeng
th) | 62 inline double parseDouble(const UChar* string, size_t length, size_t& parsedLeng
th) |
63 { | 63 { |
64 const size_t conversionBufferSize = 64; | 64 const size_t conversionBufferSize = 64; |
65 if (length > conversionBufferSize) | 65 if (length > conversionBufferSize) |
66 return Internal::parseDoubleFromLongString(string, length, parsedLength)
; | 66 return Internal::parseDoubleFromLongString(string, length, parsedLength)
; |
67 LChar conversionBuffer[conversionBufferSize]; | 67 LChar conversionBuffer[conversionBufferSize]; |
68 for (int i = 0; i < static_cast<int>(length); ++i) | 68 for (int i = 0; i < static_cast<int>(length); ++i) |
69 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; | 69 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; |
70 return parseDouble(conversionBuffer, length, parsedLength); | 70 return parseDouble(conversionBuffer, length, parsedLength); |
71 } | 71 } |
72 | 72 |
73 } // namespace WTF | 73 } // namespace WTF |
74 | 74 |
75 using WTF::NumberToStringBuffer; | 75 using WTF::NumberToStringBuffer; |
76 using WTF::NumberToLStringBuffer; | 76 using WTF::NumberToLStringBuffer; |
77 using WTF::numberToString; | 77 using WTF::numberToString; |
78 using WTF::numberToFixedPrecisionString; | 78 using WTF::numberToFixedPrecisionString; |
79 using WTF::numberToFixedWidthString; | 79 using WTF::numberToFixedWidthString; |
80 using WTF::parseDouble; | 80 using WTF::parseDouble; |
81 | 81 |
82 #endif // WTF_dtoa_h | 82 #endif // WTF_dtoa_h |
OLD | NEW |