OSDN Git Service

use struct initialization instead of ZeroMemory in process_ctrlc_stub
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Fri, 26 Aug 2011 14:48:00 +0000 (16:48 +0200)
committerJoerg Bornemann <joerg.bornemann@nokia.com>
Fri, 26 Aug 2011 15:02:55 +0000 (17:02 +0200)
Change-Id: I8fa85c7a861e9f3f4067d12c894b0a1d30541eb5
Reviewed-on: http://codereview.qt.nokia.com/3675
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
src/libs/utils/process_ctrlc_stub.cpp

index 0fd2a08..3720bf1 100644 (file)
@@ -70,8 +70,7 @@ int main(int argc, char **)
     SetConsoleCtrlHandler(ctrlHandler, TRUE);
     uiShutDownWindowMessage = RegisterWindowMessage(L"qtcctrlcstub_shutdown");
 
-    WNDCLASSEX wcex;
-    ZeroMemory(&wcex, sizeof(wcex));
+    WNDCLASSEX wcex = {0};
     wcex.cbSize = sizeof(wcex);
     wcex.lpfnWndProc = WndProc;
     wcex.hInstance = GetModuleHandle(0);
@@ -155,13 +154,11 @@ DWORD WINAPI processWatcherThread(LPVOID lpParameter)
 
 bool startProcess(wchar_t *pCommandLine)
 {
-    SECURITY_ATTRIBUTES sa;
-    ZeroMemory(&sa, sizeof(sa));
+    SECURITY_ATTRIBUTES sa = {0};
     sa.nLength = sizeof(sa);
     sa.bInheritHandle = TRUE;
 
-    STARTUPINFO si;
-    ZeroMemory(&si, sizeof(si));
+    STARTUPINFO si = {0};
     si.cb = sizeof(si);
 
     PROCESS_INFORMATION pi;