OLD | NEW |
1 /**************************************************************** | 1 /**************************************************************** |
2 * | 2 * |
3 * The author of this software is David M. Gay. | 3 * The author of this software is David M. Gay. |
4 * | 4 * |
5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. | 5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. |
6 * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. | 6 * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * | 8 * |
9 * Permission to use, copy, modify, and distribute this software for any | 9 * Permission to use, copy, modify, and distribute this software for any |
10 * purpose without fee is hereby granted, provided that this entire notice | 10 * purpose without fee is hereby granted, provided that this entire notice |
(...skipping 17 matching lines...) Expand all Loading... |
28 * of) Intel 80x87 arithmetic, the call | 28 * of) Intel 80x87 arithmetic, the call |
29 * _control87(PC_53, MCW_PC); | 29 * _control87(PC_53, MCW_PC); |
30 * does this with many compilers. Whether this or another call is | 30 * does this with many compilers. Whether this or another call is |
31 * appropriate depends on the compiler; for this to work, it may be | 31 * appropriate depends on the compiler; for this to work, it may be |
32 * necessary to #include "float.h" or another system-dependent header | 32 * necessary to #include "float.h" or another system-dependent header |
33 * file. | 33 * file. |
34 */ | 34 */ |
35 | 35 |
36 #include "wtf/dtoa.h" | 36 #include "wtf/dtoa.h" |
37 | 37 |
| 38 #include <string.h> |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 #include <string.h> | |
40 | 40 |
41 namespace WTF { | 41 namespace WTF { |
42 | 42 |
43 const char* numberToString(double d, NumberToStringBuffer buffer) { | 43 const char* numberToString(double d, NumberToStringBuffer buffer) { |
44 double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength); | 44 double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength); |
45 const double_conversion::DoubleToStringConverter& converter = | 45 const double_conversion::DoubleToStringConverter& converter = |
46 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); | 46 double_conversion::DoubleToStringConverter::EcmaScriptConverter(); |
47 converter.ToShortest(d, &builder); | 47 converter.ToShortest(d, &builder); |
48 return builder.Finalize(); | 48 return builder.Finalize(); |
49 } | 49 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 size_t& parsedLength) { | 138 size_t& parsedLength) { |
139 Vector<LChar> conversionBuffer(length); | 139 Vector<LChar> conversionBuffer(length); |
140 for (size_t i = 0; i < length; ++i) | 140 for (size_t i = 0; i < length; ++i) |
141 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; | 141 conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; |
142 return parseDouble(conversionBuffer.data(), length, parsedLength); | 142 return parseDouble(conversionBuffer.data(), length, parsedLength); |
143 } | 143 } |
144 | 144 |
145 } // namespace Internal | 145 } // namespace Internal |
146 | 146 |
147 } // namespace WTF | 147 } // namespace WTF |
OLD | NEW |