Ignore:
Timestamp:
Feb 13, 2012, 3:38:44 PM (13 years ago)
Author:
[email protected]
Message:

Replace old strtod with new strtod
https://bugs.webkit.org/show_bug.cgi?id=68044

Reviewed by Geoffrey Garen.

  • parser/Lexer.cpp: Added template argument. This version allows junk after numbers.

(JSC::::lex):

  • runtime/JSGlobalObjectFunctions.cpp: Ditto.

(JSC::parseInt):
(JSC::jsStrDecimalLiteral):

  • runtime/LiteralParser.cpp: Ditto.

(JSC::::Lexer::lexNumber):

  • wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter.

It takes a template argument to allow clients to determine statically whether it should allow
junk after the numbers or not.
(WTF):
(WTF::strtod):

  • wtf/dtoa.h:

(WTF):

  • wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers.

(WTF::toDoubleType):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/dtoa.h

    r104900 r107625  
    3636WTF_EXPORT_PRIVATE void dtoaRoundDP(DtoaBuffer result, double dd, int ndigits, bool& sign, int& exponent, unsigned& precision);
    3737
     38enum AllowTrailingJunkTag { DisallowTrailingJunk = 0, AllowTrailingJunk };
     39
    3840// s00: input string. Must not be 0 and must be terminated by 0.
    3941// se: *se will have the last consumed character position + 1.
    40 WTF_EXPORT_PRIVATE double strtod(const char* s00, char** se);
     42template<AllowTrailingJunkTag allowTrailingJunk>
     43double strtod(const char* s00, char** se);
    4144
    4245// Size = 80 for sizeof(DtoaBuffer) + some sign bits, decimal point, 'e', exponent digits.
Note: See TracChangeset for help on using the changeset viewer.