mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +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:
@@ -86,7 +86,7 @@ void clear_fmark(fmark_T *fm)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
free_fmark(*fm);
|
||||
memset(fm, 0, sizeof(*fm));
|
||||
CLEAR_POINTER(fm);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1741,7 +1741,7 @@ void free_all_marks(void)
|
||||
free_xfmark(namedfm[i]);
|
||||
}
|
||||
}
|
||||
memset(&namedfm[0], 0, sizeof(namedfm));
|
||||
CLEAR_FIELD(namedfm);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user