Nikolay Sivov : comctl32/tests: Fully initialize message test data ( Coverity).

Alexandre Julliard julliard at winehq.org
Mon May 1 16:38:04 CDT 2017


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Apr 30 21:20:28 2017 +0300

comctl32/tests: Fully initialize message test data (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 faa32a3..fede917 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 3ae83f8..defd635 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 19a5ac0..43de61c 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 &&




More information about the wine-cvs mailing list