mirror of
https://github.com/vim/vim.git
synced 2025-10-12 06:44:06 -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:
@@ -2977,7 +2977,7 @@ f_get(typval_T *argvars, typval_T *rettv)
|
||||
pt = argvars[0].vval.v_partial;
|
||||
else
|
||||
{
|
||||
vim_memset(&fref_pt, 0, sizeof(fref_pt));
|
||||
CLEAR_FIELD(fref_pt);
|
||||
fref_pt.pt_name = argvars[0].vval.v_string;
|
||||
pt = &fref_pt;
|
||||
}
|
||||
@@ -6530,7 +6530,7 @@ search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
|
||||
}
|
||||
|
||||
pos = save_cursor = curwin->w_cursor;
|
||||
vim_memset(&sia, 0, sizeof(sia));
|
||||
CLEAR_FIELD(sia);
|
||||
sia.sa_stop_lnum = (linenr_T)lnum_stop;
|
||||
#ifdef FEAT_RELTIME
|
||||
sia.sa_tm = &tm;
|
||||
@@ -6978,7 +6978,7 @@ do_searchpair(
|
||||
{
|
||||
searchit_arg_T sia;
|
||||
|
||||
vim_memset(&sia, 0, sizeof(sia));
|
||||
CLEAR_FIELD(sia);
|
||||
sia.sa_stop_lnum = lnum_stop;
|
||||
#ifdef FEAT_RELTIME
|
||||
sia.sa_tm = &tm;
|
||||
@@ -8401,7 +8401,7 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
lnum = tv_get_lnum(argvars); // -1 on type error
|
||||
col = (colnr_T)tv_get_number(&argvars[1]) - 1; // -1 on type error
|
||||
|
||||
vim_memset(str, NUL, sizeof(str));
|
||||
CLEAR_FIELD(str);
|
||||
|
||||
if (rettv_list_alloc(rettv) != FAIL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user