Michael Stefaniuc : comctl32/tests: Avoid using memset() on RECTs.

Alexandre Julliard julliard at winehq.org
Mon Aug 1 16:48:56 CDT 2016


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Sat Jul 30 21:55:12 2016 +0200

comctl32/tests: 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/tests/listview.c | 11 ++++-------
 dlls/comctl32/tests/trackbar.c |  4 ++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 1444a9f..549dc21 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -890,8 +890,7 @@ static void test_images(void)
     r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
     ok(r == 0, "should not fail\n");
 
-    memset(&r1, 0, sizeof r1);
-    r1.left = LVIR_ICON;
+    SetRect(&r1, LVIR_ICON, 0, 0, 0);
     r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r1);
     expect(1, r);
 
@@ -903,8 +902,7 @@ static void test_images(void)
     r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
     ok(r == 0, "should not fail\n");
 
-    memset(&r2, 0, sizeof r2);
-    r2.left = LVIR_ICON;
+    SetRect(&r2, LVIR_ICON, 0, 0, 0);
     r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r2);
     expect(1, r);
 
@@ -3605,8 +3603,7 @@ static void test_hittest(void)
     r = SendMessageA(hwnd, LVM_SETCOLUMNWIDTH, 1, MAKELPARAM(100, 0));
     expect(TRUE, r);
 
-    memset(&bounds, 0, sizeof(bounds));
-    bounds.left = LVIR_BOUNDS;
+    SetRect(&bounds, LVIR_BOUNDS, 0, 0, 0);
     r = SendMessageA(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&bounds);
     expect(1, r);
     ok(bounds.bottom - bounds.top > 0, "Expected non zero item height\n");
@@ -3834,7 +3831,7 @@ static void test_getitemposition(void)
     expect(TRUE, r);
     ok_sequence(sequences, LISTVIEW_SEQ_INDEX, getitemposition_seq2, "get item position 2", TRUE);
 
-    memset(&rect, 0, sizeof(rect));
+    SetRectEmpty(&rect);
     SendMessageA(header, HDM_GETITEMRECT, 0, (LPARAM)&rect);
     /* some padding? */
     expect(2, pt.x);
diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c
index 918cf1a..28af8c5 100644
--- a/dlls/comctl32/tests/trackbar.c
+++ b/dlls/comctl32/tests/trackbar.c
@@ -655,8 +655,8 @@ static void test_position(void)
     oldproc = (WNDPROC)SetWindowLongPtrA(hWndTrackbar, GWLP_WNDPROC, (LONG_PTR)trackbar_no_wmpaint_proc);
     SetWindowLongPtrA(hWndTrackbar, GWLP_USERDATA, (LONG_PTR)oldproc);
 
-    memset(&rect, 0, sizeof(rect));
-    memset(&rect2, 0, sizeof(rect2));
+    SetRectEmpty(&rect);
+    SetRectEmpty(&rect2);
 
     SendMessageA(hWndTrackbar, TBM_GETTHUMBRECT, 0, (LPARAM)&rect);
 




More information about the wine-cvs mailing list