summary refs log tree commit diff
path: root/grep.h
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2020-11-21 19:31:08 +0100
committerJunio C Hamano <gitster@pobox.com>2020-11-21 14:50:33 -0800
commit96313423a75fa8d88b6ecd5a15c21a7fbaf9e9be (patch)
tree19f731ed362d59f349c88f420ac5d41c0f9acc5e /grep.h
parent1d3878799f8260968ea9f6a75a92c4daca1da133 (diff)
grep: use designated initializers for `grep_defaults`
In 15fabd1bbd ("builtin/grep.c: make configuration callback more
reusable", 2012-10-09), we learned to fill a `static struct grep_opt
grep_defaults` which we can use as a blueprint for other such structs.

At the time, we didn't consider designated initializers to be widely
useable, but these days, we do. (See, e.g., cbc0f81d96 ("strbuf: use
designated initializers in STRBUF_INIT", 2017-07-10).)

Use designated initializers to let the compiler set up the struct and so
that we don't need to remember to call `init_grep_defaults()`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
-rw-r--r--grep.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/grep.h b/grep.h
index 1c5478f381..b5c4e223a8 100644
--- a/grep.h
+++ b/grep.h
@@ -170,7 +170,6 @@ struct grep_opt {
 	void *output_priv;
 };
 
-void init_grep_defaults(void);
 int grep_config(const char *var, const char *value, void *);
 void grep_init(struct grep_opt *, struct repository *repo, const char *prefix);
 void grep_destroy(void);