Changeset 165693 in webkit


Ignore:
Timestamp:
Mar 16, 2014 1:27:36 AM (10 years ago)
Author:
ddkilzer@apple.com
Message:

Double values passed to fabsf() in maxScaleFromTransform()
<http://webkit.org/b/130297>

Reviewed by Darin Adler.

Fixes the following build failures using trunk clang:

WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:21: error: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Werror,-Wabsolute-value]

return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));


WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:21: note: use function 'fabs' instead

return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));


fabs

WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:50: error: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Werror,-Wabsolute-value]

return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));


WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:50: note: use function 'fabs' instead

return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));


fabs

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::maxScaleFromTransform): Use static_cast<float>() to
convert float values to double values.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r165689 r165693  
     12014-03-16  David Kilzer  <ddkilzer@apple.com>
     2
     3        Double values passed to fabsf() in maxScaleFromTransform()
     4        <http://webkit.org/b/130297>
     5
     6        Reviewed by Darin Adler.
     7
     8        Fixes the following build failures using trunk clang:
     9
     10            WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:21: error: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Werror,-Wabsolute-value]
     11                return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     12                                ^
     13            WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:21: note: use function 'fabs' instead
     14                return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     15                                ^~~~~
     16                                fabs
     17            WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:50: error: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Werror,-Wabsolute-value]
     18                return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     19                                                             ^
     20            WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:287:50: note: use function 'fabs' instead
     21                return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     22                                                             ^~~~~
     23                                                             fabs
     24
     25        * platform/graphics/ca/GraphicsLayerCA.cpp:
     26        (WebCore::maxScaleFromTransform): Use static_cast<float>() to
     27        convert float values to double values.
     28
    1292014-03-15  Zalan Bujtas  <zalan@apple.com>
    230
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r165676 r165693  
    285285    TransformationMatrix::Decomposed4Type decomposeData;
    286286    t.decompose4(decomposeData);
    287     return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     287    return std::max(fabsf(static_cast<float>(decomposeData.scaleX)), fabsf(static_cast<float>(decomposeData.scaleY)));
    288288}
    289289
Note: See TracChangeset for help on using the changeset viewer.