Skip to content
Permalink
Browse files
Stop placing std::isfinite and std::signbit inside the global scope
https://bugs.webkit.org/show_bug.cgi?id=109817

Reviewed by Darin Adler.

Prefix calls to the isfinite and signbit methods with std:: as the two
methods are no longer being imported into the global scope.

Source/JavaScriptCore:

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::shouldBlindDouble):
* offlineasm/cloop.rb:
* runtime/BigInteger.h:
(JSC::BigInteger::BigInteger):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/DatePrototype.cpp:
(JSC::fillStructuresUsingTimeArgs):
(JSC::fillStructuresUsingDateArgs):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncSetYear):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::JSValue):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncIsFinite):
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):
* runtime/MathObject.cpp:
(JSC::mathProtoFuncMax): Also include an opportunistic style fix.
(JSC::mathProtoFuncMin): Ditto.
* runtime/NumberPrototype.cpp:
(JSC::toStringWithRadix):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):
* runtime/Uint16WithFraction.h:
(JSC::Uint16WithFraction::Uint16WithFraction):

Source/WebCore:

No new tests as there's no change in functionality.

* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsDateOrNull):
* bindings/js/JSDOMBinding.h:
(WebCore::finiteInt32Value):
* bindings/v8/V8Binding.h:
(WebCore::v8DateOrNull):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::parseToNumber):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValueAsNumber):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::setMin):
(WebCore::HTMLMeterElement::setMax):
(WebCore::HTMLMeterElement::setValue):
(WebCore::HTMLMeterElement::setLow):
(WebCore::HTMLMeterElement::setHigh):
(WebCore::HTMLMeterElement::setOptimum):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::value):
(WebCore::HTMLProgressElement::setValue):
(WebCore::HTMLProgressElement::max):
(WebCore::HTMLProgressElement::setMax):
* html/MonthInputType.cpp:
(WebCore::MonthInputType::valueAsDate):
(WebCore::MonthInputType::defaultValueForStepUp):
(WebCore::MonthInputType::parseToNumber):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::typeMismatchFor):
(WebCore::NumberInputType::sanitizeValue):
(WebCore::NumberInputType::hasBadInput):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::typeMismatchFor):
* html/TimeInputType.cpp:
(WebCore::TimeInputType::defaultValueForStepUp):
* html/canvas/CanvasPathMethods.cpp:
(WebCore::CanvasPathMethods::moveTo):
(WebCore::CanvasPathMethods::lineTo):
(WebCore::CanvasPathMethods::quadraticCurveTo):
(WebCore::CanvasPathMethods::bezierCurveTo):
(WebCore::CanvasPathMethods::arcTo):
(WebCore::CanvasPathMethods::arc):
(WebCore::CanvasPathMethods::rect):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setLineWidth):
(WebCore::CanvasRenderingContext2D::setMiterLimit):
(WebCore::CanvasRenderingContext2D::setShadowOffsetX):
(WebCore::CanvasRenderingContext2D::setShadowOffsetY):
(WebCore::CanvasRenderingContext2D::setShadowBlur):
(WebCore::lineDashSequenceIsValid):
(WebCore::CanvasRenderingContext2D::setLineDashOffset):
(WebCore::CanvasRenderingContext2D::scale):
(WebCore::CanvasRenderingContext2D::rotate):
(WebCore::CanvasRenderingContext2D::translate):
(WebCore::CanvasRenderingContext2D::transform):
(WebCore::CanvasRenderingContext2D::setTransform):
(WebCore::validateRectForCanvas):
(WebCore::CanvasRenderingContext2D::isPointInPath):
(WebCore::CanvasRenderingContext2D::isPointInStroke):
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::CanvasRenderingContext2D::createLinearGradient):
(WebCore::CanvasRenderingContext2D::createRadialGradient):
(WebCore::CanvasRenderingContext2D::createImageData):
(WebCore::CanvasRenderingContext2D::getImageData):
(WebCore::CanvasRenderingContext2D::putImageData):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseToDoubleForNumberType):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::setDuration):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::reset):
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::reset):
* html/shadow/MediaControlsBlackBerry.cpp:
(WebCore::MediaControlFullscreenTimelineElement::setDuration):
(WebCore::MediaControlsBlackBerry::reset):
* inspector/InspectorValues.cpp:
(WebCore::InspectorBasicValue::writeJSON):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::currentAge):
(WebCore::CachedResource::freshnessLifetime):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::adjustWindowRect):
* platform/DateComponents.cpp:
(WebCore::DateComponents::setMillisecondsSinceEpochForDate):
(WebCore::DateComponents::setMillisecondsSinceEpochForDateTime):
(WebCore::DateComponents::setMillisecondsSinceEpochForMonth):
(WebCore::DateComponents::setMillisecondsSinceMidnight):
(WebCore::DateComponents::setMonthsSinceEpoch):
(WebCore::DateComponents::setMillisecondsSinceEpochForWeek):
* platform/Decimal.cpp:
(WebCore::Decimal::fromDouble):
* platform/FileSystem.h:
(WebCore::isValidFileTime):
* platform/LocalizedStrings.cpp:
(WebCore::localizedMediaTimeDescription):
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::addArc):
(WebCore::Path::contains):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::addArc):
* platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp:
(WebCore::FullscreenVideoControllerGStreamer::timeToString):
* platform/graphics/openvg/PathOpenVG.cpp:
(WebCore::Path::addArc):
* platform/graphics/skia/SkiaUtils.h:
(WebCore::WebCoreFloatToSkScalar):
(WebCore::WebCoreDoubleToSkScalar):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::maxTimeSeekable):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::localizedMediaTimeDescription):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(timeToString):
* platform/network/ResourceResponseBase.cpp:
(WebCore::parseDateValueInHeader):
* platform/qt/LocalizedStringsQt.cpp:
(WebCore::localizedMediaTimeDescription):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
* rendering/RenderMediaControlsChromium.cpp:
(WebCore::formatChromiumMediaControlsTime):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontSize):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::decomposeArcToCubic):
* xml/XPathFunctions.cpp:
(WebCore::XPath::FunRound::round):
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toString):

Source/WebKit/win:

* FullscreenVideoController.cpp:
(timeToString):

Source/WTF:

On Solaris and OpenBSD platforms or when using Visual C++ the two methods
are now defined (as incompatibility workarounds) inside the std namespace.

* wtf/DateMath.cpp:
(WTF::timeClip):
* wtf/DecimalNumber.h:
(WTF::DecimalNumber::DecimalNumber):
* wtf/MathExtras.h:
(std):
(std::isfinite):
(std::signbit):
(lrint):
(wtf_pow):
(decomposeDouble):
* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):
* wtf/dtoa.cpp:
(WTF::dtoa):


Canonical link: https://commits.webkit.org/128430@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
zdobersek committed Feb 18, 2013
1 parent 9a5c05d commit 146b383420a9c5148cec7b3ad310bc2e6191cd9e
Showing 66 changed files with 400 additions and 169 deletions.
@@ -1,3 +1,43 @@
2013-02-18 Zan Dobersek <zdobersek@igalia.com>

Stop placing std::isfinite and std::signbit inside the global scope
https://bugs.webkit.org/show_bug.cgi?id=109817

Reviewed by Darin Adler.

Prefix calls to the isfinite and signbit methods with std:: as the two
methods are no longer being imported into the global scope.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::shouldBlindDouble):
* offlineasm/cloop.rb:
* runtime/BigInteger.h:
(JSC::BigInteger::BigInteger):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/DatePrototype.cpp:
(JSC::fillStructuresUsingTimeArgs):
(JSC::fillStructuresUsingDateArgs):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncSetYear):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::JSValue):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncIsFinite):
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):
* runtime/MathObject.cpp:
(JSC::mathProtoFuncMax): Also include an opportunistic style fix.
(JSC::mathProtoFuncMin): Ditto.
* runtime/NumberPrototype.cpp:
(JSC::toStringWithRadix):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):
* runtime/Uint16WithFraction.h:
(JSC::Uint16WithFraction::Uint16WithFraction):

2013-02-18 Ádám Kallai <kadam@inf.u-szeged.hu>

[Qt] Mountain Lion buildfix after r143147.
@@ -847,7 +847,7 @@ class MacroAssembler : public MacroAssemblerBase {
bool shouldBlindDouble(double value)
{
// Don't trust NaN or +/-Infinity
if (!isfinite(value))
if (!std::isfinite(value))
return shouldConsiderBlinding();

// Try to force normalisation, and check that there's no change
@@ -709,7 +709,7 @@ def lowerC_LOOP
$asm.putc "{"
$asm.putc " double d = #{operands[0].clValue(:double)};"
$asm.putc " const int32_t asInt32 = int32_t(d);"
$asm.putc " if (asInt32 != d || (!asInt32 && signbit(d))) // true for -0.0"
$asm.putc " if (asInt32 != d || (!asInt32 && std::signbit(d))) // true for -0.0"
$asm.putc " goto #{operands[2].cLabel};"
$asm.putc " #{operands[1].clValue} = asInt32;"
$asm.putc " #{operands[1].clDump}.clearHighWord();"
@@ -35,7 +35,7 @@ class BigInteger {
public:
BigInteger(double number)
{
ASSERT(isfinite(number) && !signbit(number));
ASSERT(std::isfinite(number) && !std::signbit(number));
ASSERT(number == floor(number));

bool sign;
@@ -125,13 +125,13 @@ JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const Arg
args.at(5).toNumber(exec),
args.at(6).toNumber(exec)
};
if (!isfinite(doubleArguments[0])
|| !isfinite(doubleArguments[1])
|| (numArgs >= 3 && !isfinite(doubleArguments[2]))
|| (numArgs >= 4 && !isfinite(doubleArguments[3]))
|| (numArgs >= 5 && !isfinite(doubleArguments[4]))
|| (numArgs >= 6 && !isfinite(doubleArguments[5]))
|| (numArgs >= 7 && !isfinite(doubleArguments[6])))
if (!std::isfinite(doubleArguments[0])
|| !std::isfinite(doubleArguments[1])
|| (numArgs >= 3 && !std::isfinite(doubleArguments[2]))
|| (numArgs >= 4 && !std::isfinite(doubleArguments[3]))
|| (numArgs >= 5 && !std::isfinite(doubleArguments[4]))
|| (numArgs >= 6 && !std::isfinite(doubleArguments[5]))
|| (numArgs >= 7 && !std::isfinite(doubleArguments[6])))
value = QNaN;
else {
GregorianDateTime t;
@@ -375,23 +375,23 @@ static bool fillStructuresUsingTimeArgs(ExecState* exec, int maxArgs, double* ms
if (maxArgs >= 4 && idx < numArgs) {
t->setHour(0);
double hours = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(hours);
ok = std::isfinite(hours);
milliseconds += hours * msPerHour;
}

// minutes
if (maxArgs >= 3 && idx < numArgs && ok) {
t->setMinute(0);
double minutes = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(minutes);
ok = std::isfinite(minutes);
milliseconds += minutes * msPerMinute;
}

// seconds
if (maxArgs >= 2 && idx < numArgs && ok) {
t->setSecond(0);
double seconds = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(seconds);
ok = std::isfinite(seconds);
milliseconds += seconds * msPerSecond;
}

@@ -401,7 +401,7 @@ static bool fillStructuresUsingTimeArgs(ExecState* exec, int maxArgs, double* ms
// milliseconds
if (idx < numArgs) {
double millis = exec->argument(idx).toIntegerPreserveNaN(exec);
ok = isfinite(millis);
ok = std::isfinite(millis);
milliseconds += millis;
} else
milliseconds += *ms;
@@ -427,19 +427,19 @@ static bool fillStructuresUsingDateArgs(ExecState *exec, int maxArgs, double *ms
// years
if (maxArgs >= 3 && idx < numArgs) {
double years = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(years);
ok = std::isfinite(years);
t->setYear(toInt32(years));
}
// months
if (maxArgs >= 2 && idx < numArgs && ok) {
double months = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(months);
ok = std::isfinite(months);
t->setMonth(toInt32(months));
}
// days
if (idx < numArgs && ok) {
double days = exec->argument(idx++).toIntegerPreserveNaN(exec);
ok = isfinite(days);
ok = std::isfinite(days);
t->setMonthDay(0);
*ms += days * msPerDay;
}
@@ -546,7 +546,7 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec)
return throwVMTypeError(exec);

DateInstance* thisDateObj = asDateInstance(thisValue);
if (!isfinite(thisDateObj->internalNumber()))
if (!std::isfinite(thisDateObj->internalNumber()))
return throwVMError(exec, createRangeError(exec, ASCIILiteral("Invalid Date")));

const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
@@ -1076,7 +1076,7 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec)
}

double year = exec->argument(0).toIntegerPreserveNaN(exec);
if (!isfinite(year)) {
if (!std::isfinite(year)) {
JSValue result = jsNaN();
thisDateObj->setInternalValue(exec->globalData(), result);
return JSValue::encode(result);
@@ -136,7 +136,7 @@ inline JSValue::JSValue(unsigned long long i)
inline JSValue::JSValue(double d)
{
const int32_t asInt32 = static_cast<int32_t>(d);
if (asInt32 != d || (!asInt32 && signbit(d))) { // true for -0.0
if (asInt32 != d || (!asInt32 && std::signbit(d))) { // true for -0.0
*this = JSValue(EncodeAsDouble, d);
return;
}
@@ -566,7 +566,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncIsNaN(ExecState* exec)
EncodedJSValue JSC_HOST_CALL globalFuncIsFinite(ExecState* exec)
{
double n = exec->argument(0).toNumber(exec);
return JSValue::encode(jsBoolean(isfinite(n)));
return JSValue::encode(jsBoolean(std::isfinite(n)));
}

EncodedJSValue JSC_HOST_CALL globalFuncDecodeURI(ExecState* exec)
@@ -387,7 +387,7 @@ Stringifier::StringifyResult Stringifier::appendStringifiedValue(StringBuilder&

if (value.isNumber()) {
double number = value.asNumber();
if (!isfinite(number))
if (!std::isfinite(number))
builder.appendLiteral("null");
else
builder.append(String::numberToStringECMAScript(number));
@@ -178,7 +178,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState* exec)
result = QNaN;
break;
}
if (val > result || (val == 0 && result == 0 && !signbit(val)))
if (val > result || (!val && !result && !std::signbit(val)))
result = val;
}
return JSValue::encode(jsNumber(result));
@@ -194,7 +194,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState* exec)
result = QNaN;
break;
}
if (val < result || (val == 0 && result == 0 && signbit(val)))
if (val < result || (!val && !result && std::signbit(val)))
result = val;
}
return JSValue::encode(jsNumber(result));
@@ -151,7 +151,7 @@ static const char radixDigits[] = "0123456789abcdefghijklmnopqrstuvwxyz";

static char* toStringWithRadix(RadixBuffer& buffer, double number, unsigned radix)
{
ASSERT(isfinite(number));
ASSERT(std::isfinite(number));
ASSERT(radix >= 2 && radix <= 36);

// Position the decimal point at the center of the string, set
@@ -161,7 +161,7 @@ static char* toStringWithRadix(RadixBuffer& buffer, double number, unsigned radi

// Extract the sign.
bool isNegative = number < 0;
if (signbit(number))
if (std::signbit(number))
number = -number;
double integerPart = floor(number);

@@ -198,12 +198,12 @@ static char* toStringWithRadix(RadixBuffer& buffer, double number, unsigned radi
// Calculate the delta from the current number to the next & previous possible IEEE numbers.
double nextNumber = nextafter(number, std::numeric_limits<double>::infinity());
double lastNumber = nextafter(number, -std::numeric_limits<double>::infinity());
ASSERT(isfinite(nextNumber) && !signbit(nextNumber));
ASSERT(isfinite(lastNumber) && !signbit(lastNumber));
ASSERT(std::isfinite(nextNumber) && !std::signbit(nextNumber));
ASSERT(std::isfinite(lastNumber) && !std::signbit(lastNumber));
double deltaNextDouble = nextNumber - number;
double deltaLastDouble = number - lastNumber;
ASSERT(isfinite(deltaNextDouble) && !signbit(deltaNextDouble));
ASSERT(isfinite(deltaLastDouble) && !signbit(deltaLastDouble));
ASSERT(std::isfinite(deltaNextDouble) && !std::signbit(deltaNextDouble));
ASSERT(std::isfinite(deltaLastDouble) && !std::signbit(deltaLastDouble));

// We track the delta from the current value to the next, to track how many digits of the
// fraction we need to write. For example, if the value we are converting is precisely
@@ -380,7 +380,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToExponential(ExecState* exec)
return throwVMError(exec, createRangeError(exec, ASCIILiteral("toExponential() argument must be between 0 and 20")));

// Handle NaN and Infinity.
if (!isfinite(x))
if (!std::isfinite(x))
return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));

// Round if the argument is not undefined, always format as exponential.
@@ -418,7 +418,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToFixed(ExecState* exec)

// The check above will return false for NaN or Infinity, these will be
// handled by numberToString.
ASSERT(isfinite(x));
ASSERT(std::isfinite(x));

NumberToStringBuffer buffer;
return JSValue::encode(jsString(exec, String(numberToFixedWidthString(x, decimalPlaces, buffer))));
@@ -448,7 +448,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState* exec)
return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));

// Handle NaN and Infinity.
if (!isfinite(x))
if (!std::isfinite(x))
return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));

NumberToStringBuffer buffer;
@@ -507,7 +507,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToString(ExecState* exec)
return JSValue::encode(jsString(globalData, globalData->numericStrings.add(doubleValue)));
}

if (!isfinite(doubleValue))
if (!std::isfinite(doubleValue))
return JSValue::encode(jsString(exec, String::numberToStringECMAScript(doubleValue)));

RadixBuffer s;
@@ -41,7 +41,7 @@ class Uint16WithFraction {
public:
explicit Uint16WithFraction(double number, uint16_t divideByExponent = 0)
{
ASSERT(number && isfinite(number) && !signbit(number));
ASSERT(number && std::isfinite(number) && !std::signbit(number));

// Check for values out of uint16_t range.
if (number >= oneGreaterThanMaxUInt16) {
@@ -1,3 +1,33 @@
2013-02-18 Zan Dobersek <zdobersek@igalia.com>

Stop placing std::isfinite and std::signbit inside the global scope
https://bugs.webkit.org/show_bug.cgi?id=109817

Reviewed by Darin Adler.

Prefix calls to the isfinite and signbit methods with std:: as the two
methods are no longer being imported into the global scope.

On Solaris and OpenBSD platforms or when using Visual C++ the two methods
are now defined (as incompatibility workarounds) inside the std namespace.

* wtf/DateMath.cpp:
(WTF::timeClip):
* wtf/DecimalNumber.h:
(WTF::DecimalNumber::DecimalNumber):
* wtf/MathExtras.h:
(std):
(std::isfinite):
(std::signbit):
(lrint):
(wtf_pow):
(decomposeDouble):
* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):
* wtf/dtoa.cpp:
(WTF::dtoa):

2013-02-18 Laszlo Gombos <l.gombos@samsung.com>

Move ENABLE macros for WebCore out from Platform.h
@@ -1072,7 +1072,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString)

double timeClip(double t)
{
if (!isfinite(t))
if (!std::isfinite(t))
return std::numeric_limits<double>::quiet_NaN();
if (fabs(t) > maxECMAScriptTime)
return std::numeric_limits<double>::quiet_NaN();
@@ -40,7 +40,7 @@ class DecimalNumber {
public:
DecimalNumber(double d)
{
ASSERT(isfinite(d));
ASSERT(std::isfinite(d));
dtoa(m_significand, d, m_sign, m_exponent, m_precision);

ASSERT(m_precision);
@@ -54,7 +54,7 @@ class DecimalNumber {

DecimalNumber(double d, RoundingSignificantFiguresType, unsigned significantFigures)
{
ASSERT(isfinite(d));
ASSERT(std::isfinite(d));
dtoaRoundSF(m_significand, d, significantFigures, m_sign, m_exponent, m_precision);

ASSERT_WITH_SECURITY_IMPLICATION(significantFigures && significantFigures <= sizeof(DtoaBuffer));
@@ -68,7 +68,7 @@ class DecimalNumber {

DecimalNumber(double d, RoundingDecimalPlacesType, unsigned decimalPlaces)
{
ASSERT(isfinite(d));
ASSERT(std::isfinite(d));
dtoaRoundDP(m_significand, d, decimalPlaces, m_sign, m_exponent, m_precision);

unsigned significantFigures = 1 + m_exponent + decimalPlaces;

0 comments on commit 146b383

Please sign in to comment.