Mercurial > vim
diff src/memfile.c @ 20007:aadd1cae2ff5 v8.2.0559
patch 8.2.0559: clearing a struct is verbose
Commit: https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 12 19:37:17 2020 +0200
patch 8.2.0559: clearing a struct is verbose
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Apr 2020 19:45:05 +0200 |
parents | f41b55f9357c |
children | bb3f60b0aca0 |
line wrap: on
line diff
--- a/src/memfile.c +++ b/src/memfile.c @@ -1337,7 +1337,7 @@ mf_do_open( 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 @@ mf_hash_grow(mf_hashtab_T *mht) * 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) {