diff src/normal.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 e21c22c58e2b
children b790d00d5ccb
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -500,7 +500,7 @@ normal_cmd(
     int		set_prevcount = FALSE;
 #endif
 
-    vim_memset(&ca, 0, sizeof(ca));	// also resets ca.retval
+    CLEAR_FIELD(ca);	// also resets ca.retval
     ca.oap = oap;
 
     // Use a count remembered from before entering an operator.  After typing
@@ -3480,7 +3480,7 @@ do_nv_ident(int c1, int c2)
     cmdarg_T	ca;
 
     clear_oparg(&oa);
-    vim_memset(&ca, 0, sizeof(ca));
+    CLEAR_FIELD(ca);
     ca.oap = &oa;
     ca.cmdchar = c1;
     ca.nchar = c2;
@@ -4308,7 +4308,7 @@ normal_search(
     cap->oap->use_reg_one = TRUE;
     curwin->w_set_curswant = TRUE;
 
-    vim_memset(&sia, 0, sizeof(sia));
+    CLEAR_FIELD(sia);
     i = do_search(cap->oap, dir, dir, pat, cap->count1,
 			    opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG, &sia);
     if (wrapped != NULL)