patch 8.2.0559: clearing a struct is verbose
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
diff --git a/src/memfile.c b/src/memfile.c
index 0d167e6..4fe3294 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -1337,7 +1337,7 @@
static void
mf_hash_init(mf_hashtab_T *mht)
{
- vim_memset(mht, 0, sizeof(mf_hashtab_T));
+ CLEAR_POINTER(mht);
mht->mht_buckets = mht->mht_small_buckets;
mht->mht_mask = MHT_INIT_SIZE - 1;
}
@@ -1480,7 +1480,7 @@
* a power of two.
*/
- vim_memset(tails, 0, sizeof(tails));
+ CLEAR_FIELD(tails);
for (mhi = mht->mht_buckets[i]; mhi != NULL; mhi = mhi->mhi_next)
{