diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-09-27 14:54:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-27 14:47:59 -0700 |
commit | 9865b6e6a4ca1e895fd473c827cf1822f3bd8249 (patch) | |
tree | a042ff50d16f1a328592aa46a11311ab66585077 /ref-filter.c | |
parent | submodule-config.h: remove unused SUBMODULE_INIT macro (diff) | |
download | tgif-9865b6e6a4ca1e895fd473c827cf1822f3bd8249.tar.xz |
*.[ch] *_INIT macros: use { 0 } for a "zero out" idiom
In C it isn't required to specify that all members of a struct are
zero'd out to 0, NULL or '\0', just providing a "{ 0 }" will
accomplish that.
Let's also change code that provided N zero'd fields to just
provide one, and change e.g. "{ NULL }" to "{ 0 }" for
consistency. I.e. even if the first member is a pointer let's use "0"
instead of "NULL". The point of using "0" consistently is to pick one,
and to not have the reader wonder why we're not using the same pattern
everywhere.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c index 93ce2a6ef2..eee4f9b17c 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -633,7 +633,7 @@ static struct { */ }; -#define REF_FORMATTING_STATE_INIT { 0, NULL } +#define REF_FORMATTING_STATE_INIT { 0 } struct ref_formatting_stack { struct ref_formatting_stack *prev; |