Kirill K. Smirnov : winhelp: Use HEAP_ZERO_MEMORY instead of setting individual fields to zero.

Alexandre Julliard julliard at winehq.org
Tue Dec 4 13:25:18 CST 2007


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

Author: Kirill K. Smirnov <lich at math.spbu.ru>
Date:   Mon Dec  3 21:28:16 2007 +0400

winhelp: Use HEAP_ZERO_MEMORY instead of setting individual fields to zero.

---

 programs/winhelp/hlpfile.c |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c
index f9a6cc1..7eeec1b 100644
--- a/programs/winhelp/hlpfile.c
+++ b/programs/winhelp/hlpfile.c
@@ -284,31 +284,15 @@ HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath)
         }
     }
 
-    hlpfile = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE) + lstrlen(lpszPath) + 1);
+    hlpfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+                        sizeof(HLPFILE) + lstrlen(lpszPath) + 1);
     if (!hlpfile) return 0;
 
     hlpfile->lpszPath           = (char*)hlpfile + sizeof(HLPFILE);
-    hlpfile->lpszTitle          = NULL;
-    hlpfile->lpszCopyright      = NULL;
-    hlpfile->first_page         = NULL;
-    hlpfile->first_macro        = NULL;
-    hlpfile->Context            = NULL;
-    hlpfile->wMapLen            = 0;
-    hlpfile->Map                = NULL;
     hlpfile->contents_start     = 0xFFFFFFFF;
-    hlpfile->prev               = NULL;
     hlpfile->next               = first_hlpfile;
     hlpfile->wRefCount          = 1;
 
-    hlpfile->numBmps            = 0;
-    hlpfile->bmps               = NULL;
-
-    hlpfile->numFonts           = 0;
-    hlpfile->fonts              = NULL;
-
-    hlpfile->numWindows         = 0;
-    hlpfile->windows            = NULL;
-
     strcpy(hlpfile->lpszPath, lpszPath);
 
     first_hlpfile = hlpfile;




More information about the wine-cvs mailing list