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

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

Issue 2940933003: DO NOT SUBMIT results of new clang-format (Closed)
Patch Set: Created 3 years, 6 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 "platform/wtf/text/StringToNumber.h" 5 #include "platform/wtf/text/StringToNumber.h"
6 6
7 #include <type_traits>
7 #include "platform/wtf/ASCIICType.h" 8 #include "platform/wtf/ASCIICType.h"
8 #include "platform/wtf/dtoa.h" 9 #include "platform/wtf/dtoa.h"
9 #include "platform/wtf/text/StringImpl.h" 10 #include "platform/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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 float CharactersToFloat(const UChar* data, 314 float CharactersToFloat(const UChar* data,
315 size_t length, 315 size_t length,
316 size_t& parsed_length) { 316 size_t& parsed_length) {
317 // FIXME: This will return ok even when the string fits into a double but 317 // FIXME: This will return ok even when the string fits into a double but
318 // not a float. 318 // not a float.
319 return static_cast<float>( 319 return static_cast<float>(
320 ToDoubleType<UChar, kAllowTrailingJunk>(data, length, 0, parsed_length)); 320 ToDoubleType<UChar, kAllowTrailingJunk>(data, length, 0, parsed_length));
321 } 321 }
322 322
323 } // namespace WTF 323 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698