Ignore:
Timestamp:
Jun 4, 2006, 3:51:57 PM (19 years ago)
Author:
darin
Message:

Reviewed by Anders.

  • changed deleteAllValues so it can work on "const" collections Deleting the values affects the values, not the pointers in the collection, so it's legitimate to do it to a const collection, and a case of that actually came up in the XPath code.
  • wtf/HashMap.h: (WTF::deleteAllPairSeconds): Use const iterators. (WTF::deleteAllValues): Take const HashMap reference as a parameter.
  • wtf/HashSet.h: (WTF::deleteAllValues): Take const HashSet reference as a parameter, and use const iterators.
  • wtf/Vector.h: (WTF::deleteAllValues): Take const Vector reference as a parameter.
  • added more functions that are present in <math.h> on some platforms, but not on others; moved here from various files in WebCore
  • wtf/MathExtras.h: (isinf): Added. (isnan): Added. (lround): Added. (lroundf): Tweaked. (round): Added. (roundf): Tweaked. (signbit): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/MathExtras.h

    r14522 r14728  
    2828#if PLATFORM(WIN)
    2929
    30 inline float roundf(float num)
    31 {
    32     return num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f);
    33 }
     30#include <xmath.h>
    3431
    35 inline long lroundf(float num)
    36 {
    37     return num > 0 ? num + 0.5f : ceilf(num - 0.5f);
    38 }
     32inline bool isinf(double num) { return !_finite(num); }
     33inline bool isnan(double num) { return _isnan(num); }
     34inline long lround(double num) { return num > 0 ? num + 0.5 : ceil(num - 0.5); }
     35inline long lroundf(float num) { return num > 0 ? num + 0.5f : ceilf(num - 0.5f); }
     36inline double round(double num) { return num > 0 ? floor(num + 0.5) : ceil(num - 0.5); }
     37inline float roundf(float num) { return num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f); }
     38inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
    3939
    4040#endif
Note: See TracChangeset for help on using the changeset viewer.