Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: third_party/WebKit/Source/wtf/dtoa.cpp

Issue 2585673002: Replace ASSERT, ENABLE(ASSERT), and ASSERT_NOT_REACHED in wtf (Closed)
Patch Set: Fix an Asan issue with LinkedHashSetNodeBase::unlink Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 if (buffer[truncatedLength] != '0') 73 if (buffer[truncatedLength] != '0')
74 break; 74 break;
75 } 75 }
76 76
77 // No trailing zeros found to strip. 77 // No trailing zeros found to strip.
78 if (truncatedLength == length - 1) 78 if (truncatedLength == length - 1)
79 return builder.Finalize(); 79 return builder.Finalize();
80 80
81 // If we removed all trailing zeros, remove the decimal point as well. 81 // If we removed all trailing zeros, remove the decimal point as well.
82 if (truncatedLength == decimalPointPosition) { 82 if (truncatedLength == decimalPointPosition) {
83 ASSERT(truncatedLength > 0); 83 DCHECK_GT(truncatedLength, 0u);
84 --truncatedLength; 84 --truncatedLength;
85 } 85 }
86 86
87 // Truncate the StringBuilder, and return the final result. 87 // Truncate the StringBuilder, and return the final result.
88 builder.SetPosition(truncatedLength + 1); 88 builder.SetPosition(truncatedLength + 1);
89 return builder.Finalize(); 89 return builder.Finalize();
90 } 90 }
91 91
92 const char* numberToFixedPrecisionString(double d, 92 const char* numberToFixedPrecisionString(double d,
93 unsigned significantFigures, 93 unsigned significantFigures,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/allocator/Partitions.cpp ('k') | third_party/WebKit/Source/wtf/dtoa/diy-fp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698