Ignore:
Timestamp:
Oct 28, 2007, 7:52:04 PM (18 years ago)
Author:
[email protected]
Message:

2007-10-28 Mark Rowe <[email protected]>

Reviewed by Maciej and Tim.

Replace uses of isNaN and isInf with isnan and isinf, and
remove isNaN and isInf.

  • kjs/config.h: Remove unused HAVE_'s
  • kjs/date_object.cpp: (KJS::DateInstance::getTime): (KJS::DateInstance::getUTCTime): (KJS::DateProtoFunc::callAsFunction): (KJS::DateObjectImp::construct): (KJS::DateObjectFuncImp::callAsFunction):
  • kjs/function.cpp: (KJS::GlobalFuncImp::callAsFunction):
  • kjs/math_object.cpp: (MathFuncImp::callAsFunction):
  • kjs/nodes2string.cpp: (KJS::isParserRoundTripNumber):
  • kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
  • kjs/operations.cpp:
  • kjs/operations.h:
  • kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
  • kjs/ustring.cpp: (KJS::UString::from):
  • kjs/value.cpp: (KJS::JSValue::toInteger): (KJS::JSValue::toInt32SlowCase): (KJS::JSValue::toUInt32SlowCase):

2007-10-28 Mark Rowe <[email protected]>

Reviewed by Maciej.

Replace uses of isNaN and isInf with isnan and isinf.

  • bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/operations.cpp

    r26961 r27201  
    2929#include <wtf/MathExtras.h>
    3030
    31 #if HAVE(FUNC_ISINF) && HAVE(IEEEFP_H)
    32 #include <ieeefp.h>
    33 #endif
    34 
    3531#if HAVE(FLOAT_H)
    3632#include <float.h>
     
    3834
    3935namespace KJS {
    40    
    41 #if !PLATFORM(DARWIN)
    42 
    43 // FIXME: Should probably be inlined on non-Darwin platforms too, and controlled exclusively
    44 // by HAVE macros rather than PLATFORM.
    45 
    46 // FIXME: Merge with isnan in MathExtras.h and remove this one entirely.
    47 bool isNaN(double d)
    48 {
    49 #if HAVE(FUNC_ISNAN)
    50     return isnan(d);
    51 #elif HAVE(FLOAT_H)
    52     return _isnan(d) != 0;
    53 #else
    54     return !(d == d);
    55 #endif
    56 }
    57 
    58 // FIXME: Merge with isinf in MathExtras.h and remove this one entirely.
    59 bool isInf(double d)
    60 {
    61     // FIXME: should be HAVE(_FPCLASS)
    62 #if PLATFORM(WIN_OS)
    63     int fpClass = _fpclass(d);
    64     return _FPCLASS_PINF == fpClass || _FPCLASS_NINF == fpClass;
    65 #elif HAVE(FUNC_ISINF)
    66     return isinf(d);
    67 #elif HAVE(FUNC_FINITE)
    68     return finite(d) == 0 && d == d;
    69 #elif HAVE(FUNC__FINITE)
    70     return _finite(d) == 0 && d == d;
    71 #else
    72     return false;
    73 #endif
    74 }
    75 
    76 bool isPosInf(double d)
    77 {
    78     // FIXME: should be HAVE(_FPCLASS)
    79 #if PLATFORM(WIN_OS)
    80     return _FPCLASS_PINF == _fpclass(d);
    81 #elif HAVE(FUNC_ISINF)
    82     return (isinf(d) == 1);
    83 #elif HAVE(FUNC_FINITE)
    84     return !finite(d) && d == d; // ### can we distinguish between + and - ?
    85 #elif HAVE(FUNC__FINITE)
    86     return !_finite(d) && d == d; // ###
    87 #else
    88     return false;
    89 #endif
    90 }
    91 
    92 bool isNegInf(double d)
    93 {
    94     // FIXME: should be HAVE(_FPCLASS)
    95 #if PLATFORM(WIN_OS)
    96     return _FPCLASS_NINF == _fpclass(d);
    97 #elif HAVE(FUNC_ISINF)
    98     return (isinf(d) == -1);
    99 #elif HAVE(FUNC_FINITE)
    100     return finite(d) == 0 && d == d; // ###
    101 #elif HAVE(FUNC__FINITE)
    102     return _finite(d) == 0 && d == d; // ###
    103 #else
    104     return false;
    105 #endif
    106 }
    107 
    108 #endif
    10936
    11037// ECMA 11.9.3
Note: See TracChangeset for help on using the changeset viewer.