Michael Stefaniuc : comctl32: Avoid using memset on RECTs.

Alexandre Julliard julliard at winehq.org
Fri Jul 29 10:17:08 CDT 2016


Module: wine
Branch: master
Commit: 2ea72e87174f6db962ab079e37b8269a72952477
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2ea72e87174f6db962ab079e37b8269a72952477

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Jul 29 15:39:57 2016 +0200

comctl32: Avoid using memset on RECTs.

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/status.c |  4 ++--
 dlls/comctl32/tab.c    | 10 ++--------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c
index 738c33b..08ca158 100644
--- a/dlls/comctl32/status.c
+++ b/dlls/comctl32/status.c
@@ -127,8 +127,8 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
          * textHeight pixels large */
         HDC hdc = GetDC(infoPtr->Self);
         RECT r;
-        memset (&r, 0, sizeof (r));
-        r.bottom = max(infoPtr->minHeight, tm.tmHeight);
+
+        SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
         if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
         {
             height = r.bottom - r.top;
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index 0ed9152..f8a5493 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -371,14 +371,8 @@ static BOOL TAB_InternalGetItemRect(
          (itemIndex < infoPtr->leftmostVisible)))
     {
         TRACE("Not Visible\n");
-        /* need to initialize these to empty rects */
-        if (itemRect)
-        {
-            memset(itemRect,0,sizeof(RECT));
-            itemRect->bottom = infoPtr->tabHeight;
-        }
-        if (selectedRect)
-            memset(selectedRect,0,sizeof(RECT));
+        SetRect(itemRect, 0, 0, 0, infoPtr->tabHeight);
+        SetRectEmpty(selectedRect);
         return FALSE;
     }
 




More information about the wine-cvs mailing list