Ignore:
Timestamp:
Feb 13, 2013, 3:01:21 PM (13 years ago)
Author:
[email protected]
Message:

The 'global isinf/isnan' compiler quirk required when using clang with libstdc++
https://bugs.webkit.org/show_bug.cgi?id=109325

Reviewed by Anders Carlsson.

Prefix calls to the isinf and isnan methods with std::, declaring we want to use the
two methods as they're provided by the C++ standard library being used.

Source/JavaScriptCore:

  • API/JSValueRef.cpp:

(JSValueMakeNumber):

  • JSCTypedArrayStubs.h:

(JSC):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitLoad):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::constantNaN):

  • offlineasm/cloop.rb:
  • runtime/DateConstructor.cpp:

(JSC::dateUTC): Also include an opportunistic style fix.

  • runtime/DateInstance.cpp:

(JSC::DateInstance::calculateGregorianDateTime):
(JSC::DateInstance::calculateGregorianDateTimeUTC):

  • runtime/DatePrototype.cpp:

(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::toInteger):

  • runtime/JSDateMath.cpp:

(JSC::getUTCOffset):
(JSC::parseDateFromNullTerminatedCharacters):
(JSC::parseDate):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncIsNaN):

  • runtime/MathObject.cpp:

(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):
(JSC::mathProtoFuncPow):

  • runtime/PropertyDescriptor.cpp:

(JSC::sameValue):

Source/WebCore:

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

  • Modules/mediasource/MediaSource.cpp:

(WebCore::MediaSource::setDuration):

  • Modules/webaudio/AudioBufferSourceNode.cpp:

(WebCore::AudioBufferSourceNode::totalPitchRate):

  • Modules/webaudio/AudioParam.cpp:

(WebCore::AudioParam::setValue):

  • Modules/webaudio/AudioParamTimeline.cpp:

(WebCore::isValidNumber):

  • Modules/webaudio/PannerNode.cpp:

(WebCore::fixNANs):

  • bindings/js/IDBBindingUtilities.cpp:

(WebCore::createIDBKeyFromValue):

  • bindings/js/JSDataViewCustom.cpp:

(WebCore::getDataViewMember):

  • bindings/js/JSGeolocationCustom.cpp:

(WebCore::setTimeout):
(WebCore::setMaximumAge):

  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:

(WebCore::JSHTMLOptionsCollection::setLength):

  • bindings/js/JSWebKitPointCustom.cpp:

(WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):
(GenerateParametersCheck):

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateParametersCheck):

  • bindings/scripts/test/JS/JSFloat64Array.cpp:

(WebCore::JSFloat64Array::getByIndex):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):

  • bindings/scripts/test/V8/V8TestObj.cpp:

(WebCore::TestObjV8Internal::classMethodWithClampCallback):

  • bindings/v8/IDBBindingUtilities.cpp:

(WebCore::createIDBKeyFromValue):

  • bindings/v8/V8Binding.cpp:

(WebCore::toInt32):
(WebCore::toUInt32):

  • bindings/v8/custom/V8GeolocationCustom.cpp:

(WebCore::createPositionOptions):

  • bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:

(WebCore::V8HTMLOptionsCollection::lengthAccessorSetter):

  • bindings/v8/custom/V8WebKitPointCustom.cpp:

(WebCore::V8WebKitPoint::constructorCallbackCustom):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::convertValueToQVariant):

  • css/WebKitCSSMatrix.cpp:

(WebCore::WebKitCSSMatrix::translate):
(WebCore::WebKitCSSMatrix::scale):
(WebCore::WebKitCSSMatrix::rotate):
(WebCore::WebKitCSSMatrix::rotateAxisAngle):
(WebCore::WebKitCSSMatrix::skewX):
(WebCore::WebKitCSSMatrix::skewY):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::percentLoaded):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::endedPlayback):

  • html/MediaController.cpp:

(MediaController::duration):

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore):
(WebCore::WebGLRenderingContext::clearColor):

  • html/track/TextTrack.cpp:

(WebCore::TextTrack::addCue):

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::setStartTime):
(WebCore::TextTrackCue::setEndTime):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::adjustWindowRect):

  • page/WindowFeatures.cpp:

(WebCore::WindowFeatures::floatFeature): Also include an opportunistic style fix.

  • platform/CalculationValue.cpp:

(WebCore::CalculationValue::evaluate):

  • platform/Decimal.cpp:

(WebCore::Decimal::fromDouble):

  • platform/Length.cpp:

(WebCore::Length::nonNanCalculatedValue):

  • platform/audio/AudioResampler.cpp:

(WebCore::AudioResampler::setRate):

  • platform/audio/DynamicsCompressorKernel.cpp:

(WebCore::DynamicsCompressorKernel::process):

  • platform/audio/Reverb.cpp:

(WebCore::calculateNormalizationScale):

  • platform/graphics/Font.cpp:

(WebCore::Font::width):

  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

(WebCore::MediaPlayerPrivateAVFoundation::isLiveStream):

  • platform/graphics/gpu/LoopBlinnMathUtils.cpp:

(LoopBlinnMathUtils):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::buffered):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):

  • platform/graphics/mac/MediaPlayerPrivateQTKit.mm:

(WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable):

  • platform/graphics/opentype/OpenTypeVerticalData.cpp:

(WebCore::OpenTypeVerticalData::getVerticalTranslationsForGlyphs):

  • platform/graphics/transforms/TransformationMatrix.cpp:

(WebCore::clampEdgeValue):
(WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad):

  • platform/network/ResourceResponseBase.cpp:

(WebCore::ResourceResponseBase::parseCacheControlDirectives):

  • rendering/RenderMediaControlsChromium.cpp:

(WebCore::paintMediaSlider):
(WebCore::paintMediaVolumeSlider):

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::paintMediaSliderTrack):

  • svg/SVGAnimationElement.cpp:

(WebCore::SVGAnimationElement::beginElementAt):
(WebCore::SVGAnimationElement::endElementAt):

  • svg/SVGSVGElement.cpp:

(WebCore::SVGSVGElement::setCurrentTime):

  • svg/animation/SMILTime.h:

(WebCore::SMILTime::SMILTime):

  • svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::addBeginTime):
(WebCore::SVGSMILElement::addEndTime):

  • xml/XPathFunctions.cpp:

(WebCore::XPath::FunSubstring::evaluate):
(WebCore::XPath::FunRound::round):

  • xml/XPathValue.cpp:

(WebCore::XPath::Value::toBoolean): Also include an opportunistic style fix.
(WebCore::XPath::Value::toString):

Source/WebKit/chromium:

  • tests/DecimalTest.cpp:

(TEST_F):

Source/WebKit/mac:

  • tests/DecimalTest.cpp:

(TEST_F):

Source/WTF:

  • wtf/Compiler.h: Remove the global isinf/isnan compiler quirk definitions. They're not required anymore.
  • wtf/DateMath.cpp: Move the workaround for isinf on Solaris into the std namespace. Ditto for isinf and isnan

when using MSVC. Stop bringing the isinf and isnan methods into the global scope when using other configurations.
(WTF::parseDateFromNullTerminatedCharacters):

  • wtf/IntegralTypedArrayBase.h:

(WTF::IntegralTypedArrayBase::set):

  • wtf/MathExtras.h:

(std):
(std::isinf):
(wtf_fmod):
(wtf_pow):
(doubleToInteger):

  • wtf/MediaTime.cpp:

(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):

  • wtf/Uint8ClampedArray.h:

(WTF::Uint8ClampedArray::set):

Tools:

  • DumpRenderTree/TestRunner.cpp:

(setAppCacheMaximumSizeCallback):
(setApplicationCacheOriginQuotaCallback):
(setDatabaseQuotaCallback):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/WebKitCSSMatrix.cpp

    r121289 r142810  
    109109PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::translate(double x, double y, double z) const
    110110{
    111     if (isnan(x))
     111    if (std::isnan(x))
    112112        x = 0;
    113     if (isnan(y))
     113    if (std::isnan(y))
    114114        y = 0;
    115     if (isnan(z))
     115    if (std::isnan(z))
    116116        z = 0;
    117117    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).translate3d(x, y, z));
     
    120120PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::scale(double scaleX, double scaleY, double scaleZ) const
    121121{
    122     if (isnan(scaleX))
     122    if (std::isnan(scaleX))
    123123        scaleX = 1;
    124     if (isnan(scaleY))
     124    if (std::isnan(scaleY))
    125125        scaleY = scaleX;
    126     if (isnan(scaleZ))
     126    if (std::isnan(scaleZ))
    127127        scaleZ = 1;
    128128    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).scale3d(scaleX, scaleY, scaleZ));
     
    131131PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotate(double rotX, double rotY, double rotZ) const
    132132{
    133     if (isnan(rotX))
     133    if (std::isnan(rotX))
    134134        rotX = 0;
    135135
    136     if (isnan(rotY) && isnan(rotZ)) {
     136    if (std::isnan(rotY) && std::isnan(rotZ)) {
    137137        rotZ = rotX;
    138138        rotX = 0;
     
    140140    }
    141141
    142     if (isnan(rotY))
     142    if (std::isnan(rotY))
    143143        rotY = 0;
    144     if (isnan(rotZ))
     144    if (std::isnan(rotZ))
    145145        rotZ = 0;
    146146    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(rotX, rotY, rotZ));
     
    149149PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::rotateAxisAngle(double x, double y, double z, double angle) const
    150150{
    151     if (isnan(x))
     151    if (std::isnan(x))
    152152        x = 0;
    153     if (isnan(y))
     153    if (std::isnan(y))
    154154        y = 0;
    155     if (isnan(z))
     155    if (std::isnan(z))
    156156        z = 0;
    157     if (isnan(angle))
     157    if (std::isnan(angle))
    158158        angle = 0;
    159159    if (x == 0 && y == 0 && z == 0)
     
    164164PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::skewX(double angle) const
    165165{
    166     if (isnan(angle))
     166    if (std::isnan(angle))
    167167        angle = 0;
    168168    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewX(angle));
     
    171171PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::skewY(double angle) const
    172172{
    173     if (isnan(angle))
     173    if (std::isnan(angle))
    174174        angle = 0;
    175175    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewY(angle));
Note: See TracChangeset for help on using the changeset viewer.