[PATCH] comctl32/tests: Fully initialize message test data (Coverity)

Nikolay Sivov nsivov at codeweavers.com
Sun Apr 30 13:20:28 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/tests/comboex.c  | 2 +-
 dlls/comctl32/tests/header.c   | 5 ++---
 dlls/comctl32/tests/treeview.c | 4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c
index faa32a3727..fede9174a5 100644
--- a/dlls/comctl32/tests/comboex.c
+++ b/dlls/comctl32/tests/comboex.c
@@ -85,8 +85,8 @@ static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wPar
 {
     WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
     static LONG defwndproc_counter = 0;
+    struct message msg = { 0 };
     LRESULT ret;
-    struct message msg;
 
     msg.message = message;
     msg.flags = sent|wparam|lparam;
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index 3ae83f8eee..defd635457 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -383,7 +383,7 @@ static char pszOutOfRangeItem[] = "Out Of Range Item";
 
 static char *str_items[] =
     {pszFirstItem, pszSecondItem, pszThirdItem, pszFourthItem, pszReplaceItem, pszOutOfRangeItem};
-    
+
 static char pszUniTestA[]  = "TST";
 static WCHAR pszUniTestW[] = {'T','S','T',0};
 
@@ -403,15 +403,14 @@ static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wPara
 {
     WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
     static LONG defwndproc_counter = 0;
+    struct message msg = { 0 };
     LRESULT ret;
-    struct message msg;
 
     msg.message = message;
     msg.flags = sent|wparam|lparam;
     if (defwndproc_counter) msg.flags |= defwinproc;
     msg.wParam = wParam;
     msg.lParam = lParam;
-    msg.id = 0;
     add_message(sequences, HEADER_SEQ_INDEX, &msg);
 
     defwndproc_counter++;
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 19a5ac09ba..43de61cc87 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -1098,7 +1098,7 @@ static void test_get_set_unicodeformat(void)
 static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     static LONG defwndproc_counter = 0;
-    struct message msg;
+    struct message msg = { 0 };
     LRESULT ret;
     RECT rect;
     HTREEITEM visibleItem;
@@ -1110,8 +1110,6 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
     msg.lParam = lParam;
     if (message == WM_NOTIFY && lParam)
         msg.id = ((NMHDR*)lParam)->code;
-    else
-        msg.id = 0;
 
     /* log system messages, except for painting */
     if (message < WM_USER &&
-- 
2.11.0




More information about the wine-patches mailing list