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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringToNumber.cpp

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 months 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "wtf/text/StringToNumber.h" 5 #include "wtf/text/StringToNumber.h"
6 6
7 #include <type_traits>
7 #include "wtf/ASCIICType.h" 8 #include "wtf/ASCIICType.h"
8 #include "wtf/dtoa.h" 9 #include "wtf/dtoa.h"
9 #include "wtf/text/StringImpl.h" 10 #include "wtf/text/StringImpl.h"
10 #include <type_traits>
11 11
12 namespace WTF { 12 namespace WTF {
13 13
14 static bool isCharacterAllowedInBase(UChar c, int base) { 14 static bool isCharacterAllowedInBase(UChar c, int base) {
15 if (c > 0x7F) 15 if (c > 0x7F)
16 return false; 16 return false;
17 if (isASCIIDigit(c)) 17 if (isASCIIDigit(c))
18 return c - '0' < base; 18 return c - '0' < base;
19 if (isASCIIAlpha(c)) { 19 if (isASCIIAlpha(c)) {
20 if (base > 36) 20 if (base > 36)
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 float charactersToFloat(const UChar* data, 313 float charactersToFloat(const UChar* data,
314 size_t length, 314 size_t length,
315 size_t& parsedLength) { 315 size_t& parsedLength) {
316 // FIXME: This will return ok even when the string fits into a double but 316 // FIXME: This will return ok even when the string fits into a double but
317 // not a float. 317 // not a float.
318 return static_cast<float>( 318 return static_cast<float>(
319 toDoubleType<UChar, AllowTrailingJunk>(data, length, 0, parsedLength)); 319 toDoubleType<UChar, AllowTrailingJunk>(data, length, 0, parsedLength));
320 } 320 }
321 321
322 } // namespace WTF 322 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImplCF.cpp ('k') | third_party/WebKit/Source/wtf/text/StringToNumberTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698