Commit 3b900a47 authored by aroben@apple.com's avatar aroben@apple.com

Windows build fix

        In MSVC, sqrt() has three overloads: float, double, and long
        double. In GCC, sqrt() is only for doubles. Both MSVC and GCC have
        sqrtf() to operate explicitly on floats.

        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::calculateDistance): Changed to use
        sqrtf and removed narrowPrecisionToFloat.
        * svg/SVGAnimateTransformElement.cpp:
        (WebCore::SVGAnimateTransformElement::calculateDistance): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83465b85
2008-04-18 Adam Roben <aroben@apple.com>
Windows build fix
In MSVC, sqrt() has three overloads: float, double, and long
double. In GCC, sqrt() is only for doubles. Both MSVC and GCC have
sqrtf() to operate explicitly on floats.
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::calculateDistance): Changed to use
sqrtf and removed narrowPrecisionToFloat.
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::calculateDistance): Ditto.
2008-04-18 Simon Hausmann <hausmann@webkit.org>
Fix the build without Database support (fixes the Qt/win build).
......@@ -25,7 +25,6 @@
#if ENABLE(SVG) && ENABLE(SVG_ANIMATION)
#include "SVGAnimateMotionElement.h"
#include "FloatConversion.h"
#include "RenderObject.h"
#include "SVGMPathElement.h"
#include "SVGParserUtilities.h"
......@@ -200,7 +199,7 @@ float SVGAnimateMotionElement::calculateDistance(const String& fromString, const
if (!parsePoint(toString, to))
return -1.f;
FloatSize diff = to - from;
return narrowPrecisionToFloat(sqrt(diff.width() * diff.width() + diff.height() * diff.height()));
return sqrtf(diff.width() * diff.width() + diff.height() * diff.height());
}
}
......
......@@ -192,13 +192,13 @@ float SVGAnimateTransformElement::calculateDistance(const String& fromString, co
return -1.f;
if (to.type() == SVGTransform::SVG_TRANSFORM_TRANSLATE) {
FloatSize diff = to.translate() - from.translate();
return narrowPrecisionToFloat(sqrt(diff.width() * diff.width() + diff.height() * diff.height()));
return sqrtf(diff.width() * diff.width() + diff.height() * diff.height());
}
if (to.type() == SVGTransform::SVG_TRANSFORM_ROTATE)
return narrowPrecisionToFloat(fabs(to.angle() - from.angle()));
if (to.type() == SVGTransform::SVG_TRANSFORM_SCALE) {
FloatSize diff = to.scale() - from.scale();
return narrowPrecisionToFloat(sqrt(diff.width() * diff.width() + diff.height() * diff.height()));
return sqrtf(diff.width() * diff.width() + diff.height() * diff.height());
}
return -1.f;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment