From: Ævar Arnfjörð Bjarmason Date: Tue, 5 Jun 2018 14:40:44 +0000 (+0000) Subject: checkout.c: introduce an *_INIT macro X-Git-Tag: v2.19.0-rc0~107^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e417151b24bcf1277a48fc6e9a5c184998402428 checkout.c: introduce an *_INIT macro Add an *_INIT macro for the tracking_name_data similar to what exists elsewhere in the codebase, e.g. OID_ARRAY_INIT in sha1-array.h. This will make it more idiomatic in later changes to add more fields to the struct & its initialization macro. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- diff --git a/checkout.c b/checkout.c index bdefc888ba..80e430cda8 100644 --- a/checkout.c +++ b/checkout.c @@ -10,6 +10,8 @@ struct tracking_name_data { int unique; }; +#define TRACKING_NAME_DATA_INIT { NULL, NULL, NULL, 1 } + static int check_tracking_name(struct remote *remote, void *cb_data) { struct tracking_name_data *cb = cb_data; @@ -32,7 +34,7 @@ static int check_tracking_name(struct remote *remote, void *cb_data) const char *unique_tracking_name(const char *name, struct object_id *oid) { - struct tracking_name_data cb_data = { NULL, NULL, NULL, 1 }; + struct tracking_name_data cb_data = TRACKING_NAME_DATA_INIT; cb_data.src_ref = xstrfmt("refs/heads/%s", name); cb_data.dst_oid = oid; for_each_remote(check_tracking_name, &cb_data);