⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181851 in webkit


Ignore:
Timestamp:
Mar 23, 2015, 3:05:12 AM (11 years ago)
Author:
zandobersek@gmail.com
Message:

[GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
https://bugs.webkit.org/show_bug.cgi?id=142964

Reviewed by Carlos Garcia Campos.

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
instead of C's abs(). The templated nature of std::abs() ensures the proper
computation that matches the types of the passed-in values, and shuts down
a warning when compiling with Clang.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r181850 r181851  
     12015-03-23  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
     4        https://bugs.webkit.org/show_bug.cgi?id=142964
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     9        (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
     10        instead of C's abs(). The templated nature of std::abs() ensures the proper
     11        computation that matches the types of the passed-in values, and shuts down
     12        a warning when compiling with Clang.
     13
    1142015-03-23  Zan Dobersek  <zdobersek@igalia.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r181847 r181851  
    116116
    117117        if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
    118             || ((abs(buttonEvent->x - previousClickPoint.x()) < doubleClickDistance)
    119                 && (abs(buttonEvent->y - previousClickPoint.y()) < doubleClickDistance)
     118            || ((std::abs(buttonEvent->x - previousClickPoint.x()) < doubleClickDistance)
     119                && (std::abs(buttonEvent->y - previousClickPoint.y()) < doubleClickDistance)
    120120                && (eventTime - previousClickTime < static_cast<unsigned>(doubleClickTime))
    121121                && (buttonEvent->button == previousClickButton)))
Note: See TracChangeset for help on using the changeset viewer.