mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
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().
a80faa8930
This commit is contained in:
@@ -4146,8 +4146,8 @@ static wordnode_T *get_wordnode(spellinfo_T *spin)
|
||||
} else {
|
||||
n = spin->si_first_free;
|
||||
spin->si_first_free = n->wn_child;
|
||||
memset(n, 0, sizeof(wordnode_T));
|
||||
--spin->si_free_count;
|
||||
CLEAR_POINTER(n);
|
||||
spin->si_free_count--;
|
||||
}
|
||||
#ifdef SPELL_PRINTTREE
|
||||
if (n != NULL) {
|
||||
@@ -5282,7 +5282,7 @@ static void mkspell(int fcount, char **fnames, bool ascii, bool over_write, bool
|
||||
bool error = false;
|
||||
spellinfo_T spin;
|
||||
|
||||
memset(&spin, 0, sizeof(spin));
|
||||
CLEAR_FIELD(spin);
|
||||
spin.si_verbose = !added_word;
|
||||
spin.si_ascii = ascii;
|
||||
spin.si_followup = true;
|
||||
|
Reference in New Issue
Block a user