diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-12 19:37:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-12 19:37:17 +0200 |
commit | a80faa8930ed5a554beeb2727762538873135e83 (patch) | |
tree | e797605e0c781214543fcba103cffede7af611cd /src/quickfix.c | |
parent | 82de464f763d6e6d89229be03ce7c6d02fd5fb59 (diff) | |
download | vim-git-a80faa8930ed5a554beeb2727762538873135e83.tar.gz |
patch 8.2.0559: clearing a struct is verbosev8.2.0559
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 5c24babdf..4b3f16400 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -1667,8 +1667,8 @@ qf_init_ext( // Do not used the cached buffer, it may have been wiped out. VIM_CLEAR(qf_last_bufname); - vim_memset(&state, 0, sizeof(state)); - vim_memset(&fields, 0, sizeof(fields)); + CLEAR_FIELD(state); + CLEAR_FIELD(fields); if ((qf_alloc_fields(&fields) == FAIL) || (qf_setup_state(&state, enc, efile, tv, buf, lnumfirst, lnumlast) == FAIL)) @@ -1867,7 +1867,7 @@ qf_new_list(qf_info_T *qi, char_u *qf_title) else qi->qf_curlist = qi->qf_listcount++; qfl = qf_get_curlist(qi); - vim_memset(qfl, 0, (size_t)(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; @@ -5794,7 +5794,7 @@ vgr_jump_to_match( { exarg_T ea; - vim_memset(&ea, 0, sizeof(ea)); + CLEAR_FIELD(ea); ea.arg = target_dir; ea.cmdidx = CMD_lcd; ex_cd(&ea); @@ -6151,7 +6151,7 @@ restore_start_dir(char_u *dirname_start) // appropriate ex command and executing it. exarg_T ea; - vim_memset(&ea, 0, sizeof(ea)); + CLEAR_FIELD(ea); ea.arg = dirname_start; ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd; ex_cd(&ea); |