Nikolay Sivov : shell32/autocomplete: Remove redundant memory initialization.
Alexandre Julliard
julliard at winehq.org
Mon Jul 25 11:43:13 CDT 2011
Module: wine
Branch: master
Commit: 46a2ec0209e4dbc47e79d35f5db1ad04a84c7b19
URL: http://source.winehq.org/git/wine.git/?a=commit;h=46a2ec0209e4dbc47e79d35f5db1ad04a84c7b19
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Jul 24 23:18:51 2011 +0400
shell32/autocomplete: Remove redundant memory initialization.
---
dlls/shell32/autocomplete.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index 2c59207..684e990 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -287,7 +287,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
- key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
+ key = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
@@ -301,7 +301,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
- This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
@@ -310,7 +310,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
- This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
@@ -493,7 +493,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
- hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ hwndQCText = HeapAlloc(GetProcessHeap(), 0,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
@@ -536,7 +536,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0);
- msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
@@ -573,8 +573,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
- This->txtbackup = HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
+ This->txtbackup = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
/* Returns if there is no text to search and we doesn't want to display all the entries */
@@ -664,7 +663,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
if (sel < 0)
break;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0);
- msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));
More information about the wine-cvs
mailing list