JavaScriptCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2007 16:43:01 +0000 (16:43 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2007 16:43:01 +0000 (16:43 +0000)
        Reviewed by Darin.

        First pass at fixing implicit 64-32 bit conversion errors.
        <rdar://problem/5292262>

        - Add 'f' suffix where necessary.

        * kjs/testkjs.cpp:
        (StopWatch::getElapsedMS):

WebCore:

        Reviewed by Darin.

        First pass at fixing implicit 64-32 bit conversion errors.
        <rdar://problem/5292262>

        - Add 'f' suffix where necessary.

        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject accessibilityAttributeValue:forParameter:]):
        * css/csshelper.h:
        * css/cssstyleselector.cpp:
        (WebCore::):
        (WebCore::CSSStyleSelector::largerFontSize):
        (WebCore::CSSStyleSelector::smallerFontSize):
        * html/CanvasGradient.cpp:
        (WebCore::CanvasGradient::addColorStop):
        * html/CanvasPattern.cpp:
        (WebCore::CanvasPattern::createPattern):
        * ksvg2/css/SVGCSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applySVGProperty):
        * ksvg2/css/SVGRenderStyle.h:
        * ksvg2/events/SVGZoomEvent.cpp:
        (WebCore::SVGZoomEvent::SVGZoomEvent):
        * ksvg2/svg/SVGLength.cpp:
        (WebCore::SVGLength::SVGLength):
        (WebCore::SVGLength::value):
        (WebCore::SVGLength::setValue):
        (WebCore::SVGLength::valueAsPercentage):
        (WebCore::SVGLength::PercentageOfViewport):
        * ksvg2/svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::pixelUnitToMillimeterX):
        (WebCore::SVGSVGElement::pixelUnitToMillimeterY):
        (WebCore::SVGSVGElement::getScreenCTM):
        * ksvg2/svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::getComputedTextLength):
        (WebCore::SVGTextContentElement::getSubStringLength):
        (WebCore::SVGTextContentElement::getRotationOfChar):
        * ksvg2/svg/SVGTransformDistance.cpp:
        (WebCore::SVGTransformDistance::SVGTransformDistance):
        (WebCore::SVGTransformDistance::distance):
        * page/InspectorController.cpp:
        (WebCore::InspectorResource::InspectorResource):
        * platform/graphics/FloatPoint3D.cpp:
        (WebCore::FloatPoint3D::normalize):
        * platform/graphics/Path.cpp:
        (WebCore::pathLengthApplierFunction):
        (WebCore::Path::createRoundedRectangle):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::drawLine):
        (WebCore::GraphicsContext::strokeArc):
        * platform/graphics/cg/ImageCG.cpp:
        (WebCore::FrameData::clear):
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::frameDurationAtIndex):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::setCurrentPage):
        * platform/graphics/svg/SVGPaintServerPattern.cpp:
        (WebCore::SVGPaintServerPattern::externalRepresentation):
        * platform/graphics/svg/SVGPaintServerRadialGradient.cpp:
        (WebCore::SVGPaintServerRadialGradient::SVGPaintServerRadialGradient):
        * platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp:
        (WebCore::cgGradientCallback):
        (WebCore::CGShadingRefForRadialGradient):
        (WebCore::SVGPaintServerGradient::updateQuartzGradientStopsCache):
        * platform/mac/FontDataMac.mm:
        (WebCore::webFallbackFontFamily):
        * platform/mac/PopupMenuMac.mm:
        (WebCore::PopupMenu::show):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxesHorizontally):
        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::setValueForPosition):
        (WebCore::RenderSlider::setPositionFromValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23816 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/testkjs.cpp
WebCore/ChangeLog
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/css/csshelper.h
WebCore/css/cssstyleselector.cpp
WebCore/html/CanvasGradient.cpp
WebCore/html/CanvasPattern.cpp
WebCore/ksvg2/css/SVGCSSStyleSelector.cpp
WebCore/ksvg2/css/SVGRenderStyle.h
WebCore/ksvg2/events/SVGZoomEvent.cpp
WebCore/ksvg2/svg/SVGLength.cpp
WebCore/ksvg2/svg/SVGSVGElement.cpp
WebCore/ksvg2/svg/SVGTextContentElement.cpp
WebCore/ksvg2/svg/SVGTransformDistance.cpp
WebCore/page/InspectorController.cpp
WebCore/platform/graphics/FloatPoint3D.cpp
WebCore/platform/graphics/Path.cpp
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/cg/ImageCG.cpp
WebCore/platform/graphics/cg/ImageSourceCG.cpp
WebCore/platform/graphics/cg/PDFDocumentImage.cpp
WebCore/platform/graphics/svg/SVGPaintServerPattern.cpp
WebCore/platform/graphics/svg/SVGPaintServerRadialGradient.cpp
WebCore/platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp
WebCore/platform/mac/FontDataMac.mm
WebCore/platform/mac/PopupMenuMac.mm
WebCore/rendering/InlineFlowBox.cpp
WebCore/rendering/RenderSlider.cpp

index d4fd59b..f725914 100644 (file)
@@ -1,3 +1,15 @@
+2007-06-27  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin.
+
+        First pass at fixing implicit 64-32 bit conversion errors.
+        <rdar://problem/5292262>
+
+        - Add 'f' suffix where necessary.
+
+        * kjs/testkjs.cpp:
+        (StopWatch::getElapsedMS):
+
 2007-06-26  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Maciej Stachowiak.
index 69531ff..e4be696 100644 (file)
@@ -95,7 +95,7 @@ long StopWatch::getElapsedMS()
     timeval elapsedTime;
     timersub(&m_stopTime, &m_startTime, &elapsedTime);
     
-    return elapsedTime.tv_sec * 1000 + lroundf(elapsedTime.tv_usec / 1000.0);
+    return elapsedTime.tv_sec * 1000 + lroundf(elapsedTime.tv_usec / 1000.0f);
 #endif
 }
 
index 80d0620..b9d5384 100644 (file)
@@ -1,3 +1,79 @@
+2007-06-27  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin.
+
+        First pass at fixing implicit 64-32 bit conversion errors.
+        <rdar://problem/5292262>
+
+        - Add 'f' suffix where necessary.
+
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject accessibilityAttributeValue:forParameter:]):
+        * css/csshelper.h:
+        * css/cssstyleselector.cpp:
+        (WebCore::):
+        (WebCore::CSSStyleSelector::largerFontSize):
+        (WebCore::CSSStyleSelector::smallerFontSize):
+        * html/CanvasGradient.cpp:
+        (WebCore::CanvasGradient::addColorStop):
+        * html/CanvasPattern.cpp:
+        (WebCore::CanvasPattern::createPattern):
+        * ksvg2/css/SVGCSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applySVGProperty):
+        * ksvg2/css/SVGRenderStyle.h:
+        * ksvg2/events/SVGZoomEvent.cpp:
+        (WebCore::SVGZoomEvent::SVGZoomEvent):
+        * ksvg2/svg/SVGLength.cpp:
+        (WebCore::SVGLength::SVGLength):
+        (WebCore::SVGLength::value):
+        (WebCore::SVGLength::setValue):
+        (WebCore::SVGLength::valueAsPercentage):
+        (WebCore::SVGLength::PercentageOfViewport):
+        * ksvg2/svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::pixelUnitToMillimeterX):
+        (WebCore::SVGSVGElement::pixelUnitToMillimeterY):
+        (WebCore::SVGSVGElement::getScreenCTM):
+        * ksvg2/svg/SVGTextContentElement.cpp:
+        (WebCore::SVGTextContentElement::getComputedTextLength):
+        (WebCore::SVGTextContentElement::getSubStringLength):
+        (WebCore::SVGTextContentElement::getRotationOfChar):
+        * ksvg2/svg/SVGTransformDistance.cpp:
+        (WebCore::SVGTransformDistance::SVGTransformDistance):
+        (WebCore::SVGTransformDistance::distance):
+        * page/InspectorController.cpp:
+        (WebCore::InspectorResource::InspectorResource):
+        * platform/graphics/FloatPoint3D.cpp:
+        (WebCore::FloatPoint3D::normalize):
+        * platform/graphics/Path.cpp:
+        (WebCore::pathLengthApplierFunction):
+        (WebCore::Path::createRoundedRectangle):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::drawLine):
+        (WebCore::GraphicsContext::strokeArc):
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::FrameData::clear):
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::frameDurationAtIndex):
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::setCurrentPage):
+        * platform/graphics/svg/SVGPaintServerPattern.cpp:
+        (WebCore::SVGPaintServerPattern::externalRepresentation):
+        * platform/graphics/svg/SVGPaintServerRadialGradient.cpp:
+        (WebCore::SVGPaintServerRadialGradient::SVGPaintServerRadialGradient):
+        * platform/graphics/svg/cg/SVGPaintServerGradientCg.cpp:
+        (WebCore::cgGradientCallback):
+        (WebCore::CGShadingRefForRadialGradient):
+        (WebCore::SVGPaintServerGradient::updateQuartzGradientStopsCache):
+        * platform/mac/FontDataMac.mm:
+        (WebCore::webFallbackFontFamily):
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenu::show):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::placeBoxesHorizontally):
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::setValueForPosition):
+        (WebCore::RenderSlider::setPositionFromValue):
+
 2007-06-27  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Geoff.
index 3652fea..883d22c 100644 (file)
@@ -2328,7 +2328,7 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
     NSNumber*               number = nil;
     NSArray*                array = nil;
     WebCoreAXObject*        uiElement = nil;
-    NSPoint                 point = {0.0, 0.0};
+    NSPoint                 point = NSZeroPoint;
     bool                    pointSet = false;
     NSRange                 range = {0, 0};
     bool                    rangeSet = false;
index b3592d8..d38f698 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
     // We always assume 96 CSS pixels in a CSS inch. This is the cold hard truth of the Web.
     // At high DPI, we may scale a CSS pixel, but the ratio of the CSS pixel to the so-called
     // "absolute" CSS length units like inch and pt is always fixed and never changes.
-    const double cssPixelsPerInch = 96.0;
+    const float cssPixelsPerInch = 96.0f;
 } // namespace WebCore
 
 #endif // csshelper_h
index c8b15e9..3f928b8 100644 (file)
@@ -4780,7 +4780,7 @@ static const int strictFontSizeTable[fontSizeTableMax - fontSizeTableMin + 1][to
 
 // For values outside the range of the table, we use Todd Fahrner's suggested scale
 // factors for each keyword value.
-static const float fontSizeFactors[totalKeywords] = { 0.60, 0.75, 0.89, 1.0, 1.2, 1.5, 2.0, 3.0 };
+static const float fontSizeFactors[totalKeywords] = { 0.60f, 0.75f, 0.89f, 1.0f, 1.2f, 1.5f, 2.0f, 3.0f };
 
 float CSSStyleSelector::fontSizeForKeyword(int keyword, bool quirksMode, bool fixed) const
 {
@@ -4805,14 +4805,14 @@ float CSSStyleSelector::largerFontSize(float size, bool quirksMode) const
 {
     // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
     // the next size level.  
-    return size*1.2;
+    return size * 1.2f;
 }
 
 float CSSStyleSelector::smallerFontSize(float size, bool quirksMode) const
 {
     // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
     // the next size level. 
-    return size/1.2;
+    return size / 1.2f;
 }
 
 // color mapping code
index 82d6b05..db85553 100644 (file)
@@ -61,10 +61,10 @@ void CanvasGradient::addColorStop(float value, const String& color)
 {
     RGBA32 rgba = CSSParser::parseColor(color);
     m_stops.append(ColorStop(value,
-        ((rgba >> 16) & 0xFF) / 255.0,
-        ((rgba >> 8) & 0xFF) / 255.0,
-        (rgba & 0xFF) / 255.0,
-        ((rgba >> 24) & 0xFF) / 255.0));
+        ((rgba >> 16) & 0xFF) / 255.0f,
+        ((rgba >> 8) & 0xFF) / 255.0f,
+        (rgba & 0xFF) / 255.0f,
+        ((rgba >> 24) & 0xFF) / 255.0f));
 
     m_stopsSorted = false;
 
index f0382f7..730a2d2 100644 (file)
@@ -159,7 +159,7 @@ CGPatternRef CanvasPattern::createPattern(const CGAffineTransform& transform)
     // INT_MAX is almost correct, but there seems to be some number wrapping occuring making the fill
     // pattern is not filled correctly. 
     // So, just pick a really large number that works. 
-    float yStep = m_repeatY ? rect.size.height : (100000000.0);
+    float yStep = m_repeatY ? rect.size.height : (100000000.0f);
 
     const CGPatternCallbacks patternCallbacks = { 0, patternCallback, patternReleaseCallback };
     ref();
index fd9bb3f..37587eb 100644 (file)
@@ -459,7 +459,7 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             if (!primitiveValue)
                 return;
         
-            float f = 0.0;    
+            float f = 0.0f;    
             int type = primitiveValue->primitiveType();
             if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 f = primitiveValue->getFloatValue() / 100.;
@@ -477,7 +477,7 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             if (!primitiveValue)
                 return;
         
-            float f = 0.0;    
+            float f = 0.0f;    
             int type = primitiveValue->primitiveType();
             if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 f = primitiveValue->getFloatValue() / 100.;
@@ -495,7 +495,7 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             if (!primitiveValue)
                 return;
         
-            float f = 0.0;    
+            float f = 0.0f;    
             int type = primitiveValue->primitiveType();
             if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 f = primitiveValue->getFloatValue() / 100.;
@@ -583,7 +583,7 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             if (!primitiveValue)
                 return;
 
-            float f = 0.0;
+            float f = 0.0f;
             int type = primitiveValue->primitiveType();
             if (type == CSSPrimitiveValue::CSS_NUMBER)
                 f = primitiveValue->getFloatValue();
@@ -712,7 +712,7 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             if (!primitiveValue)
                 return;
 
-            float f = 0.0;    
+            float f = 0.0f;
             int type = primitiveValue->primitiveType();
             if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 f = primitiveValue->getFloatValue() / 100.;
index ff5aa3d..5e75f26 100644 (file)
@@ -72,20 +72,20 @@ namespace WebCore {
         SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EWritingMode, WritingMode, writingMode, WM_LRTB)
  
         // SVG CSS Properties (using DataRef's)
-        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, fill, opacity, FillOpacity, fillOpacity, 1.0)
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, fill, opacity, FillOpacity, fillOpacity, 1.0f)
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(SVGPaint, fill, paint, FillPaint, fillPaint, SVGPaint::defaultFill())
 
-        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, opacity, StrokeOpacity, strokeOpacity, 1.0)
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, opacity, StrokeOpacity, strokeOpacity, 1.0f)
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(SVGPaint, stroke, paint, StrokePaint, strokePaint, SVGPaint::defaultStroke())
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValueList, stroke, dashArray, StrokeDashArray, strokeDashArray, 0)
-        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, miterLimit, StrokeMiterLimit, strokeMiterLimit, 4.0)
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stroke, miterLimit, StrokeMiterLimit, strokeMiterLimit, 4.0f)
         
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, stroke, width, StrokeWidth, strokeWidth, 0)
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, stroke, dashOffset, StrokeDashOffset, strokeDashOffset, 0);
 
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, text, kerning, Kerning, kerning, 0)
 
-        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stops, opacity, StopOpacity, stopOpacity, 1.0)
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stops, opacity, StopOpacity, stopOpacity, 1.0f)
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, stops, color, StopColor, stopColor, Color(0, 0, 0))    
         
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, clip, clipPath, ClipPath, clipPath, String())
@@ -95,7 +95,7 @@ namespace WebCore {
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, markers, endMarker, EndMarker, endMarker, String())
 
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, misc, filter, Filter, filter, String())
-        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, misc, floodOpacity, FloodOpacity, floodOpacity, 1.0)
+        SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, misc, floodOpacity, FloodOpacity, floodOpacity, 1.0f)
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, floodColor, FloodColor, floodColor, Color(0, 0, 0))
         SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, misc, baselineShiftValue, BaselineShiftValue, baselineShiftValue, 0)
 
index 24ed1a9..3062b56 100644 (file)
@@ -28,8 +28,8 @@
 namespace WebCore {
 
 SVGZoomEvent::SVGZoomEvent()
-    : m_newScale(0.0)
-    , m_previousScale(0.0)
+    : m_newScale(0.0f)
+    , m_previousScale(0.0f)
 {
 }
 
index 3543863..40ae087 100644 (file)
@@ -115,7 +115,7 @@ inline SVGLengthType stringToLengthType(const String& string)
 }
 
 SVGLength::SVGLength(const SVGStyledElement* context, SVGLengthMode mode, const String& valueAsString)
-    : m_valueInSpecifiedUnits(0.0)
+    : m_valueInSpecifiedUnits(0.0f)
     , m_unit(storeUnit(mode, LengthTypeNumber))
     , m_context(context)
 {
@@ -131,13 +131,13 @@ float SVGLength::value() const
 {
     SVGLengthType type = extractType(m_unit);
     if (type == LengthTypeUnknown)
-        return 0.0;
+        return 0.0f;
 
     switch (type) {
     case LengthTypeNumber:
         return m_valueInSpecifiedUnits;
     case LengthTypePercentage:
-        return SVGLength::PercentageOfViewport(m_valueInSpecifiedUnits / 100.0, m_context, extractMode(m_unit));
+        return SVGLength::PercentageOfViewport(m_valueInSpecifiedUnits / 100.0f, m_context, extractMode(m_unit));
     case LengthTypeEMS:
     case LengthTypeEXS:
     {
@@ -153,29 +153,29 @@ float SVGLength::value() const
                 float xHeight = style->font().xHeight();
                 // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
                 // if this causes problems in real world cases maybe it would be best to remove this
-                return m_valueInSpecifiedUnits * ceil(xHeight);
+                return m_valueInSpecifiedUnits * ceilf(xHeight);
             }
         }
-        return 0.0;
+        return 0.0f;
     }
     case LengthTypePX:
         return m_valueInSpecifiedUnits;
     case LengthTypeCM:
-        return m_valueInSpecifiedUnits / 2.54 * cssPixelsPerInch;
+        return m_valueInSpecifiedUnits / 2.54f * cssPixelsPerInch;
     case LengthTypeMM:
-        return m_valueInSpecifiedUnits / 25.4 * cssPixelsPerInch;
+        return m_valueInSpecifiedUnits / 25.4f * cssPixelsPerInch;
     case LengthTypeIN:
         return m_valueInSpecifiedUnits * cssPixelsPerInch;
     case LengthTypePT:
-        return m_valueInSpecifiedUnits / 72.0 * cssPixelsPerInch;
+        return m_valueInSpecifiedUnits / 72.0f * cssPixelsPerInch;
     case LengthTypePC:
-        return m_valueInSpecifiedUnits / 6.0 * cssPixelsPerInch;
+        return m_valueInSpecifiedUnits / 6.0f * cssPixelsPerInch;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return 0.0;
+    return 0.0f;
 }
 
 void SVGLength::setValue(float value)
@@ -196,19 +196,19 @@ void SVGLength::setValue(float value)
         m_valueInSpecifiedUnits = value;
         break;
     case LengthTypeCM:
-        m_valueInSpecifiedUnits = value * 2.54 / cssPixelsPerInch;
+        m_valueInSpecifiedUnits = value * 2.54f / cssPixelsPerInch;
         break;
     case LengthTypeMM:
-        m_valueInSpecifiedUnits = value * 25.4 / cssPixelsPerInch;
+        m_valueInSpecifiedUnits = value * 25.4f / cssPixelsPerInch;
         break;
     case LengthTypeIN:
         m_valueInSpecifiedUnits = value / cssPixelsPerInch;
         break;
     case LengthTypePT:
-        m_valueInSpecifiedUnits = value * 72.0 / cssPixelsPerInch;
+        m_valueInSpecifiedUnits = value * 72.0f / cssPixelsPerInch;
         break;
     case LengthTypePC:
-        m_valueInSpecifiedUnits = value / 6.0 * cssPixelsPerInch;
+        m_valueInSpecifiedUnits = value / 6.0f * cssPixelsPerInch;
         break;
     default:
         break;
@@ -229,7 +229,7 @@ float SVGLength::valueAsPercentage() const
 {
     // 100% = 100.0 instead of 1.0 for historical reasons, this could eventually be changed
     if (extractType(m_unit) == LengthTypePercentage)
-        return valueInSpecifiedUnits() / 100.0;
+        return valueInSpecifiedUnits() / 100.0f;
 
     return valueInSpecifiedUnits();
 }
@@ -306,9 +306,9 @@ float SVGLength::PercentageOfViewport(float value, const SVGStyledElement* conte
     else if (mode == LengthModeHeight)
         return value * height;
     else if (mode == LengthModeOther)
-        return value * sqrt(pow(double(width), 2) + pow(double(height), 2)) / sqrt(2.0);
+        return value * sqrtf(powf(width, 2) + powf(height, 2)) / sqrtf(2.0f);
 
-    return 0.0;
+    return 0.0f;
 }
 
 }
index 5cb7bfc..f72a218 100644 (file)
@@ -127,13 +127,13 @@ FloatRect SVGSVGElement::viewport() const
 float SVGSVGElement::pixelUnitToMillimeterX() const
 {
     // FIXME: Implement me (see bug 11273)
-    return .28;
+    return .28f;
 }
 
 float SVGSVGElement::pixelUnitToMillimeterY() const
 {
     // FIXME: Implement me (see bug 11273)
-    return .28;
+    return .28f;
 }
 
 float SVGSVGElement::screenPixelToMillimeterX() const
@@ -352,8 +352,8 @@ AffineTransform SVGSVGElement::getScreenCTM() const
     // FIXME: This assumes that any <svg> element not immediately descending from another SVGElement 
     // has *no* svg ancestors
     document()->updateLayoutIgnorePendingStylesheets();
-    float rootX = 0.0;
-    float rootY = 0.0;
+    float rootX = 0.0f;
+    float rootY = 0.0f;
     
     if (RenderObject* renderer = this->renderer()) {
         renderer = renderer->parent();
index d5d7fdd..d663021 100644 (file)
@@ -59,12 +59,12 @@ long SVGTextContentElement::getNumberOfChars() const
 
 float SVGTextContentElement::getComputedTextLength() const
 {
-    return 0.;
+    return 0.0f;
 }
 
 float SVGTextContentElement::getSubStringLength(unsigned long charnum, unsigned long nchars, ExceptionCode&) const
 {
-    return 0.;
+    return 0.0f;
 }
 
 FloatPoint SVGTextContentElement::getStartPositionOfChar(unsigned long charnum, ExceptionCode&) const
@@ -84,7 +84,7 @@ FloatRect SVGTextContentElement::getExtentOfChar(unsigned long charnum, Exceptio
 
 float SVGTextContentElement::getRotationOfChar(unsigned long charnum, ExceptionCode&) const
 {
-    return 0.;
+    return 0.0f;
 }
 
 long SVGTextContentElement::getCharNumAtPosition(const FloatPoint& point) const
index 82028ea..d149e53 100644 (file)
@@ -76,8 +76,8 @@ SVGTransformDistance::SVGTransformDistance(const SVGTransform& fromSVGTransform,
     }
     case SVGTransform::SVG_TRANSFORM_SCALE:
     {
-        float scaleX = fromSVGTransform.scale().width() != 0 ? toSVGTransform.scale().width() / fromSVGTransform.scale().width() : toSVGTransform.scale().width() / 0.00001;
-        float scaleY = fromSVGTransform.scale().height() != 0 ? toSVGTransform.scale().height() / fromSVGTransform.scale().height() : toSVGTransform.scale().height() / 0.00001;
+        float scaleX = fromSVGTransform.scale().width() != 0 ? toSVGTransform.scale().width() / fromSVGTransform.scale().width() : toSVGTransform.scale().width() / 0.00001f;
+        float scaleY = fromSVGTransform.scale().height() != 0 ? toSVGTransform.scale().height() / fromSVGTransform.scale().height() : toSVGTransform.scale().height() / 0.00001f;
         m_transform.scale(scaleX, scaleY);
         return;
     }
@@ -253,11 +253,11 @@ float SVGTransformDistance::distance() const
 {
     switch (m_type) {
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
-        return 0;
+        return 0.0f;
     case SVGTransform::SVG_TRANSFORM_ROTATE:
         return sqrtf(m_angle * m_angle + m_cx * m_cx + m_cy * m_cy);
     case SVGTransform::SVG_TRANSFORM_MATRIX:
-        return 0; // I'm not quite sure yet what distance between two matrices means.
+        return 0.0f; // I'm not quite sure yet what distance between two matrices means.
     case SVGTransform::SVG_TRANSFORM_SCALE:
         return sqrtf(m_transform.a() * m_transform.a() + m_transform.d() * m_transform.d());
     case SVGTransform::SVG_TRANSFORM_TRANSLATE:
@@ -267,7 +267,7 @@ float SVGTransformDistance::distance() const
         return m_angle;
     }
     ASSERT_NOT_REACHED();
-    return 0;
+    return 0.0f;
 }
 
 }
index abec918..81c992b 100644 (file)
@@ -88,7 +88,7 @@ struct InspectorResource : public Shared<InspectorResource> {
         Other
     };
 
-    InspectorResource(unsigned long identifier, DocumentLoader* documentLoader, Frame* frame)
+    InspectorResource(long long identifier, DocumentLoader* documentLoader, Frame* frame)
         : identifier(identifier)
         , loader(documentLoader)
         , frame(frame)
@@ -160,7 +160,7 @@ struct InspectorResource : public Shared<InspectorResource> {
             JSValueProtect(context, newScriptObject);
     }
 
-    unsigned long identifier;
+    long long identifier;
     RefPtr<DocumentLoader> loader;
     RefPtr<Frame> frame;
     ResourceRequest request;
index 7b6766c..59b0067 100644 (file)
@@ -75,7 +75,7 @@ void FloatPoint3D::setZ(float z)
 
 void FloatPoint3D::normalize()
 {
-    float length = sqrt(m_x * m_x + m_y * m_y + m_z * m_z);
+    float length = sqrtf(m_x * m_x + m_y * m_y + m_z * m_z);
 
     m_x /= length;
     m_y /= length;
index d0e124b..322963d 100644 (file)
@@ -69,13 +69,13 @@ void pathLengthApplierFunction(void* info, const PathElement* element)
          traversalState.m_action == PathTraversalState::TraversalNormalAngleAtLength) &&
         (traversalState.m_totalLength >= traversalState.m_desiredLength)) {
         FloatSize change = traversalState.m_current - traversalState.m_previous;
-        float slope = atan2(change.height(), change.width());
+        float slope = atan2f(change.height(), change.width());
 
         if (traversalState.m_action == PathTraversalState::TraversalPointAtLength) {
             float offset = traversalState.m_desiredLength - traversalState.m_totalLength;
-            traversalState.m_current.move(offset * cos(slope), offset * sin(slope));
+            traversalState.m_current.move(offset * cosf(slope), offset * sinf(slope));
         } else {
-            static float rad2deg = 180.0 / M_PI;
+            static const float rad2deg = 180.0f / M_PI;
             traversalState.m_normalAngle = slope * rad2deg;
         }
 
@@ -117,7 +117,7 @@ Path Path::createRoundedRectangle(const FloatRect& rectangle, const FloatSize& r
     double height = rectangle.height();
     double rx = roundingRadii.width();
     double ry = roundingRadii.height();
-    if (width <= 0.0 || height <= 0.0)
+    if (width <= 0.0f || height <= 0.0f)
         return path;
 
     double dx = rx, dy = ry;
index 0d55b5e..9008623 100644 (file)
@@ -167,12 +167,12 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
     if (((int)width) % 2) {
         if (isVerticalLine) {
             // We're a vertical line.  Adjust our x.
-            p1.move(0.5, 0);
-            p2.move(0.5, 0);
+            p1.move(0.5f, 0.0f);
+            p2.move(0.5f, 0.0f);
         } else {
             // We're a horizontal line. Adjust our y.
-            p1.move(0, 0.5);
-            p2.move(0, 0.5);
+            p1.move(0.0f, 0.5f);
+            p2.move(0.0f, 0.5f);
         }
     }
     
@@ -214,10 +214,10 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
         int coverage = distance - remainder;
         int numSegments = coverage / patWidth;
 
-        float patternOffset = 0;
+        float patternOffset = 0.0f;
         // Special case 1px dotted borders for speed.
         if (patWidth == 1)
-            patternOffset = 1.0;
+            patternOffset = 1.0f;
         else {
             bool evenNumberOfSegments = numSegments % 2 == 0;
             if (remainder)
@@ -299,8 +299,8 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
     float vRadius = h / 2;
     float fa = startAngle;
     float falen =  fa + angleSpan;
-    float start = -fa * M_PI/180;
-    float end = -falen * M_PI/180;
+    float start = -fa * M_PI / 180.0f;
+    float end = -falen * M_PI / 180.0f;
     CGContextAddArc(context, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, start, end, true);
 
     if (w != h)
@@ -337,10 +337,10 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
         int coverage = distance - remainder;
         int numSegments = coverage / patWidth;
 
-        float patternOffset = 0;
+        float patternOffset = 0.0f;
         // Special case 1px dotted borders for speed.
         if (patWidth == 1)
-            patternOffset = 1.0;
+            patternOffset = 1.0f;
         else {
             bool evenNumberOfSegments = numSegments % 2 == 0;
             if (remainder)
@@ -348,12 +348,12 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
             if (evenNumberOfSegments) {
                 if (remainder) {
                     patternOffset += patWidth - remainder;
-                    patternOffset += remainder / 2;
+                    patternOffset += remainder / 2.0f;
                 } else
-                    patternOffset = patWidth / 2;
+                    patternOffset = patWidth / 2.0f;
             } else {
                 if (remainder)
-                    patternOffset = (patWidth - remainder) / 2;
+                    patternOffset = (patWidth - remainder) / 2.0f;
             }
         }
     
index cb419ec..f7c0f2e 100644 (file)
@@ -43,7 +43,7 @@ void FrameData::clear()
     if (m_frame) {
         CGImageRelease(m_frame);
         m_frame = 0;
-        m_duration = 0.;
+        m_duration = 0.0f;
         m_hasAlpha = true;
     }
 }
index 1e9fcb3..4ca0118 100644 (file)
@@ -179,8 +179,8 @@ float ImageSource::frameDurationAtIndex(size_t index)
     // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
     // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
     // a duration of <= 10 ms. See gfxImageFrame::GetTimeout in Gecko or Radar 4051389 for more.
-    if (duration <= 0.010)
-        return 0.100;
+    if (duration <= 0.010f)
+        return 0.100f;
     return duration;
 }
 
index 0da2593..5aaff90 100644 (file)
@@ -131,7 +131,7 @@ void PDFDocumentImage::setCurrentPage(int page)
         m_cropBox = m_mediaBox;
 
     // get page rotation angle
-    m_rotation = CGPDFPageGetRotationAngle(cgPage) * M_PI / 180.0; // to radians
+    m_rotation = CGPDFPageGetRotationAngle(cgPage) * M_PI / 180.0f; // to radians
 }
 
 int PDFDocumentImage::pageCount() const
index c885a97..c0e5b07 100644 (file)
@@ -87,7 +87,7 @@ void SVGPaintServerPattern::setPatternTransform(const AffineTransform& transform
 TextStream& SVGPaintServerPattern::externalRepresentation(TextStream& ts) const
 {
     // Gradients/patterns aren't setup, until they are used for painting. Work around that fact.
-    m_ownerElement->buildPattern(FloatRect(0.0, 0.0, 1.0, 1.0));
+    m_ownerElement->buildPattern(FloatRect(0.0f, 0.0f, 1.0f, 1.0f));
 
     ts << "[type=PATTERN]"
         << " [bbox=" << patternBoundaries() << "]";
index 7b2f7ba..a795ab5 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 SVGPaintServerRadialGradient::SVGPaintServerRadialGradient(const SVGGradientElement* owner)
     : SVGPaintServerGradient(owner)
-    , m_radius(0.0)
+    , m_radius(0.0f)
 {
 }
 
index 38ddc4d..916e7bc 100644 (file)
@@ -69,10 +69,10 @@ static void cgGradientCallback(void* info, const CGFloat* inValues, CGFloat* out
         CGFloat diffFromPrevious = inValue - stops[nextStopIndex - 1].offset;
         CGFloat percent = diffFromPrevious * stops[nextStopIndex].previousDeltaInverse;
 
-        outColor[0] = ((1.0 - percent) * previousColorArray[0] + percent * nextColorArray[0]);
-        outColor[1] = ((1.0 - percent) * previousColorArray[1] + percent * nextColorArray[1]);
-        outColor[2] = ((1.0 - percent) * previousColorArray[2] + percent * nextColorArray[2]);
-        outColor[3] = ((1.0 - percent) * previousColorArray[3] + percent * nextColorArray[3]);
+        outColor[0] = ((1.0f - percent) * previousColorArray[0] + percent * nextColorArray[0]);
+        outColor[1] = ((1.0f - percent) * previousColorArray[1] + percent * nextColorArray[1]);
+        outColor[2] = ((1.0f - percent) * previousColorArray[2] + percent * nextColorArray[2]);
+        outColor[3] = ((1.0f - percent) * previousColorArray[3] + percent * nextColorArray[3]);
     }
     // FIXME: have to handle the spreadMethod()s here SPREADMETHOD_REPEAT, etc.
 }
@@ -105,7 +105,7 @@ static CGShadingRef CGShadingRefForRadialGradient(const SVGPaintServerRadialGrad
 
     // Spec: If (fx, fy) lies outside the circle defined by (cx, cy) and r, set (fx, fy)
     // to the point of intersection of the line through (fx, fy) and the circle.
-    if (sqrtf(fdx * fdx + fdy * fdy) > radius) { 
+    if (sqrt(fdx * fdx + fdy * fdy) > radius) { 
         double angle = atan2(focus.y * 100.0, focus.x * 100.0);
         focus.x = cos(angle) * radius;
         focus.y = sin(angle) * radius;
@@ -134,7 +134,7 @@ void SVGPaintServerGradient::updateQuartzGradientStopsCache(const Vector<SVGGrad
     for (unsigned i = 0; i < stops.size(); ++i) {
         CGFloat currOffset = min(max(stops[i].first, previousOffset), static_cast<CGFloat>(1.0));
         m_stopsCache[i].offset = currOffset;
-        m_stopsCache[i].previousDeltaInverse = 1.0 / (currOffset - previousOffset);
+        m_stopsCache[i].previousDeltaInverse = 1.0f / (currOffset - previousOffset);
         previousOffset = currOffset;
         CGFloat* ca = m_stopsCache[i].colorArray;
         stops[i].second.getRGBA(ca[0], ca[1], ca[2], ca[3]);
index 7359c80..a9d8c9a 100644 (file)
@@ -87,7 +87,7 @@ static NSString *webFallbackFontFamily(void)
 {
     static RetainPtr<NSString> webFallbackFontFamily = nil;
     if (!webFallbackFontFamily)
-        webFallbackFontFamily = [[NSFont systemFontOfSize:16.0] familyName];
+        webFallbackFontFamily = [[NSFont systemFontOfSize:16.0f] familyName];
     return webFallbackFontFamily.get();
 }
 
index 5cd7eef..0682b92 100644 (file)
@@ -133,7 +133,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
         // Adjust for fonts other than the system font.
         NSFont* defaultFont = [NSFont systemFontOfSize:[font pointSize]];
         vertOffset += [font descender] - [defaultFont descender];
-        vertOffset = fmin(NSHeight(r), vertOffset);
+        vertOffset = fminf(NSHeight(r), vertOffset);
     
         location = NSMakePoint(NSMinX(r) + popOverHorizontalAdjust, NSMaxY(r) - vertOffset);
     } else
index d16af5b..ad4d4d2 100644 (file)
@@ -269,7 +269,7 @@ int InlineFlowBox::placeBoxesHorizontally(int x, int& leftPosition, int& rightPo
             }
             text->setXPos(x);
             
-            int strokeOverflow = static_cast<int>(ceilf(rt->style()->textStrokeWidth() / 2.0));
+            int strokeOverflow = static_cast<int>(ceilf(rt->style()->textStrokeWidth() / 2.0f));
             
             // If letter-spacing is negative, we should factor that into right overflow. (Even in RTL, letter-spacing is
             // applied to the right, so this is not an issue with left overflow.
index 92b3889..8a33c1a 100644 (file)
@@ -284,7 +284,7 @@ void RenderSlider::setValueForPosition(int position)
 
     // Force integer value if not float.
     if (!equalIgnoringCase(precision, "float"))
-        val = lroundf(val);
+        val = lround(val);
 
     static_cast<HTMLInputElement*>(node())->setValueFromRenderer(String::number(val));
     
@@ -314,7 +314,7 @@ double RenderSlider::setPositionFromValue(bool inLayout)
         
     // Force integer value if not float.
     if (!equalIgnoringCase(precision, "float"))
-        val = lroundf(val);
+        val = lround(val);
 
     // Calculate the new position based on the value
     double factor = (val - minVal) / (maxVal - minVal);