mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +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:
@@ -199,6 +199,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext()
|
||||
// Size in bytes of the hash used in the undo file.
|
||||
#define UNDO_HASH_SIZE 32
|
||||
|
||||
#define CLEAR_FIELD(field) memset(&(field), 0, sizeof(field))
|
||||
#define CLEAR_POINTER(ptr) memset((ptr), 0, sizeof(*(ptr)))
|
||||
|
||||
// defines to avoid typecasts from (char_u *) to (char *) and back
|
||||
|
Reference in New Issue
Block a user