Tiny optimizations of bit testing operations

Dmitry Timoshkov dmitry at baikal.ru
Wed Oct 20 05:48:05 CDT 2004


Hello,

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Tiny optimizations of bit testing operations.

--- cvs/hq/wine/windows/nonclient.c	2004-10-20 17:06:44.000000000 +0900
+++ wine/windows/nonclient.c	2004-10-20 19:39:16.000000000 +0900
@@ -549,8 +549,7 @@ static LONG NC_DoNCHitTest (WND *wndPtr,
             rect.top += GetSystemMetrics(SM_CYCAPTION) - 1;
         if (!PtInRect( &rect, pt ))
         {
-            BOOL min_or_max_box = (wndPtr->dwStyle & WS_MAXIMIZEBOX) ||
-                                  (wndPtr->dwStyle & WS_MINIMIZEBOX);
+            BOOL min_or_max_box = wndPtr->dwStyle & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
             /* Check system menu */
             if ((wndPtr->dwStyle & WS_SYSMENU) && !(wndPtr->dwExStyle & WS_EX_TOOLWINDOW))
             {
@@ -584,7 +583,7 @@ static LONG NC_DoNCHitTest (WND *wndPtr,
 
     if (wndPtr->dwStyle & WS_VSCROLL)
     {
-        if((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) != 0)
+        if (wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR)
             rcClient.left -= GetSystemMetrics(SM_CXVSCROLL);
         else
             rcClient.right += GetSystemMetrics(SM_CXVSCROLL);
@@ -600,8 +599,8 @@ static LONG NC_DoNCHitTest (WND *wndPtr,
         {
             /* Check size box */
             if ((wndPtr->dwStyle & WS_VSCROLL) &&
-                ((((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) != 0) && (ptClient.x <= rcClient.left + GetSystemMetrics(SM_CXVSCROLL))) ||
-                (((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) == 0) && (ptClient.x >= rcClient.right - GetSystemMetrics(SM_CXVSCROLL)))))
+                (((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) && (ptClient.x <= rcClient.left + GetSystemMetrics(SM_CXVSCROLL))) ||
+                (!(wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) && (ptClient.x >= rcClient.right - GetSystemMetrics(SM_CXVSCROLL)))))
                 return HTSIZE;
             return HTHSCROLL;
         }






More information about the wine-patches mailing list