From 9865b6e6a4ca1e895fd473c827cf1822f3bd8249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 27 Sep 2021 14:54:25 +0200 Subject: *.[ch] *_INIT macros: use { 0 } for a "zero out" idiom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'checkout.c') diff --git a/checkout.c b/checkout.c index 6586e30ca5..2e39dae684 100644 --- a/checkout.c +++ b/checkout.c @@ -14,7 +14,7 @@ struct tracking_name_data { struct object_id *default_dst_oid; }; -#define TRACKING_NAME_DATA_INIT { NULL, NULL, NULL, 0, NULL, NULL, NULL } +#define TRACKING_NAME_DATA_INIT { 0 } static int check_tracking_name(struct remote *remote, void *cb_data) { -- cgit v1.2.3