Bug 1111242 - Use std::abs instead of fabsf in nsChildView.mm; r=josh

clang gives the following warning on these fabs usages:
absolute value function 'fabsf' given an argument of type 'CGFloat' (aka 'double') but has parameter of type 'float' which may cause truncation of value [-Wabsolute-value]

--HG--
extra : amend_source : 1c2352555626c0b412bdd5c383074726f84e2c7b
This commit is contained in:
Ehsan Akhgari 2014-12-14 14:58:56 -05:00
parent 4261267599
commit 0e6e105e69

View File

@ -4199,7 +4199,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
// tolerating a small vertical element to a true horizontal swipe. The number
// '8' was arrived at by trial and error.
if (anOverflowX != 0.0 && deltaX != 0.0 &&
fabsf(deltaX) > fabsf(deltaY) * 8) {
std::abs(deltaX) > std::abs(deltaY) * 8) {
// Only initiate horizontal tracking for gestures that have just begun --
// otherwise a scroll to one side of the page can have a swipe tacked on
// to it.
@ -4217,7 +4217,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
// at least two times larger than its horizontal element. This minimizes
// performance problems. The number '2' was arrived at by trial and error.
else if (anOverflowY != 0.0 && deltaY != 0.0 &&
fabsf(deltaY) > fabsf(deltaX) * 2) {
std::abs(deltaY) > std::abs(deltaX) * 2) {
if (deltaY < 0.0) {
direction = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
} else {