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/regexp_nfa.c b/src/regexp_nfa.c
index 67d4af2..26a8f35 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4564,7 +4564,7 @@
// avoid compiler warnings
save_ptr = NULL;
- vim_memset(&save_multipos, 0, sizeof(save_multipos));
+ CLEAR_FIELD(save_multipos);
// Set the position (with "off" added) in the subexpression. Save
// and restore it when it was in use. Otherwise fill any gap.
@@ -4717,7 +4717,7 @@
save_ptr = sub->list.line[subidx].end;
sub->list.line[subidx].end = rex.input + off;
// avoid compiler warnings
- vim_memset(&save_multipos, 0, sizeof(save_multipos));
+ CLEAR_FIELD(save_multipos);
}
subs = addstate(l, state->out, subs, pim, off_arg);