comctl32: Avoid using memset on RECTs. (2nd try)
Michael Stefaniuc
mstefani at redhat.de
Fri Jul 29 08:39:57 CDT 2016
Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
Thanks to Alexandre for pointing out how I managed to screw this one
up.
v2 - SetRect / SetRectEmpty already check for NULL RECT pointer.
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;
}
--
2.7.4
More information about the wine-patches
mailing list