aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-11 15:44:55 +0800
committerGitHub <noreply@github.com>2022-08-11 15:44:55 +0800
commit94c317647845b92d675548a481f664a6a1808426 (patch)
tree5d14079cbf334b1148fbc6927793bc1df72934c5 /src/nvim/quickfix.c
parent252dea5927906208ab60f68d70891a82ab9ddd18 (diff)
downloadrneovim-94c317647845b92d675548a481f664a6a1808426.tar.gz
rneovim-94c317647845b92d675548a481f664a6a1808426.tar.bz2
rneovim-94c317647845b92d675548a481f664a6a1808426.zip
refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)
vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 99129bd15e..b7a8717ff2 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1224,7 +1224,7 @@ static void qf_new_list(qf_info_T *qi, const char *qf_title)
qi->qf_curlist = qi->qf_listcount++;
}
qf_list_T *qfl = qf_get_curlist(qi);
- memset(qfl, 0, sizeof(qf_list_T));
+ CLEAR_POINTER(qfl);
qf_store_title(qfl, qf_title);
qfl->qfl_type = qi->qfl_type;
qfl->qf_id = ++last_qf_id;
@@ -5299,7 +5299,7 @@ static bool existing_swapfile(const buf_T *buf)
/// :{count}vimgrep /{pattern}/[g][j] {file} ...
static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
{
- memset(args, 0, sizeof(*args));
+ CLEAR_POINTER(args);
args->regmatch.regprog = NULL;
args->qf_title = xstrdup(qf_cmdtitle(*eap->cmdlinep));