[Webkit-unassigned] [Bug 130947] New: [iOS] Fix remaining misuses of abs() and fabsf()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 30 13:57:10 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=130947

           Summary: [iOS] Fix remaining misuses of abs() and fabsf()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ddkilzer at webkit.org
                CC: darin at apple.com


Compiling WebKit for iOS with trunk clang shows a few more misuses of abs() and fabsf():

WebCore/platform/ios/wak/WKView.mm:251:30: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
                         || (abs(origMarginsTotal) == 1)) {
                             ^
WebCore/platform/ios/wak/WKView.mm:251:30: note: use function 'fabs' instead
                         || (abs(origMarginsTotal) == 1)) {
                             ^~~
                             fabs

WebCore/platform/ios/ScrollAnimatorIOS.mm:125:45: error: using floating point absolute value function 'fabsf' when argument is of integer type [-Werror,-Wabsolute-value]
                    float dragAngle = atanf(fabsf(deltaFromStart.height()) / fabsf(deltaFromStart.width()));
                                            ^
WebCore/platform/ios/ScrollAnimatorIOS.mm:125:45: note: use function 'abs' instead
                    float dragAngle = atanf(fabsf(deltaFromStart.height()) / fabsf(deltaFromStart.width()));
                                            ^~~~~
                                            abs
WebCore/platform/ios/ScrollAnimatorIOS.mm:125:78: error: using floating point absolute value function 'fabsf' when argument is of integer type [-Werror,-Wabsolute-value]
                    float dragAngle = atanf(fabsf(deltaFromStart.height()) / fabsf(deltaFromStart.width()));
                                                                             ^
WebCore/platform/ios/ScrollAnimatorIOS.mm:125:78: note: use function 'abs' instead
                    float dragAngle = atanf(fabsf(deltaFromStart.height()) / fabsf(deltaFromStart.width()));
                                                                             ^~~~~
                                                                             abs
WebCore/platform/ios/ScrollAnimatorIOS.mm:143:114: error: using floating point absolute value function 'fabsf' when argument is of integer type [-Werror,-Wabsolute-value]
        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollLeft : ScrollRight, ScrollByPixel, fabsf(delta));
                                                                                                                 ^
WebCore/platform/ios/ScrollAnimatorIOS.mm:143:114: note: use function 'abs' instead
        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollLeft : ScrollRight, ScrollByPixel, fabsf(delta));
                                                                                                                 ^~~~~
                                                                                                                 abs
WebCore/platform/ios/ScrollAnimatorIOS.mm:149:111: error: using floating point absolute value function 'fabsf' when argument is of integer type [-Werror,-Wabsolute-value]
        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollUp : ScrollDown, ScrollByPixel, fabsf(delta));
                                                                                                              ^
WebCore/platform/ios/ScrollAnimatorIOS.mm:149:111: note: use function 'abs' instead
        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollUp : ScrollDown, ScrollByPixel, fabsf(delta));
                                                                                                              ^~~~~
                                                                                                              abs

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list