0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0559: clearing a struct is verbose

Problem:    Clearing a struct is verbose.
Solution:   Define and use CLEAR_FIELD() and CLEAR_POINTER().
This commit is contained in:
Bram Moolenaar
2020-04-12 19:37:17 +02:00
parent 82de464f76
commit a80faa8930
55 changed files with 170 additions and 169 deletions

View File

@@ -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)