diff src/os_mswin.c @ 20007:aadd1cae2ff5 v8.2.0559

patch 8.2.0559: clearing a struct is verbose Commit: https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 12 19:37:17 2020 +0200 patch 8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Apr 2020 19:45:05 +0200
parents 1fe99999625c
children d4b2a8675b78
line wrap: on
line diff
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1338,7 +1338,7 @@ mch_print_init(prt_settings_T *psettings
     int			i;
 
     bUserAbort = &(psettings->user_abort);
-    vim_memset(&prt_dlg, 0, sizeof(PRINTDLGW));
+    CLEAR_FIELD(prt_dlg);
     prt_dlg.lStructSize = sizeof(PRINTDLGW);
 # if !defined(FEAT_GUI) || defined(VIMDLL)
 #  ifdef VIMDLL
@@ -1467,7 +1467,7 @@ mch_print_init(prt_settings_T *psettings
     /*
      * Initialise the font according to 'printfont'
      */
-    vim_memset(&fLogFont, 0, sizeof(fLogFont));
+    CLEAR_FIELD(fLogFont);
     if (get_logfont(&fLogFont, p_pfn, prt_dlg.hDC, TRUE) == FAIL)
     {
 	semsg(_("E613: Unknown printer font: %s"), p_pfn);
@@ -1562,7 +1562,7 @@ mch_print_begin(prt_settings_T *psetting
     {
 	DOCINFOW	di;
 
-	vim_memset(&di, 0, sizeof(di));
+	CLEAR_FIELD(di);
 	di.cbSize = sizeof(di);
 	di.lpszDocName = wp;
 	ret = StartDocW(prt_dlg.hDC, &di);
@@ -2881,7 +2881,7 @@ get_logfont(
 # if defined(FEAT_GUI_MSWIN)
 	CHOOSEFONTW	cf;
 	// if name is "*", bring up std font dialog:
-	vim_memset(&cf, 0, sizeof(cf));
+	CLEAR_FIELD(cf);
 	cf.lStructSize = sizeof(cf);
 	cf.hwndOwner = s_hwnd;
 	cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_INITTOLOGFONTSTRUCT;