]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-options: const parse_options_concat() parameters
authorRené Scharfe <l.s.r@web.de>
Sun, 9 Feb 2020 15:57:56 +0000 (16:57 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Feb 2020 17:44:58 +0000 (09:44 -0800)
Document the fact that the function doesn't modify the two option arrays
passed to it by adding the keyword const to each parameter.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options-cb.c
parse-options.h

index db6f666ef75baa3d6584eae3c979d94808c00f98..7d56681130a32301ec0ebad3f3dd7e5a36c19708 100644 (file)
@@ -181,7 +181,8 @@ struct option *parse_options_dup(const struct option *o)
        return opts;
 }
 
-struct option *parse_options_concat(struct option *a, struct option *b)
+struct option *parse_options_concat(const struct option *a,
+                                   const struct option *b)
 {
        struct option *ret;
        size_t a_len = parse_options_count(a);
index fdc0c1cb9763ebeddb961067f6ee37feb64a7bd6..1d602058812e3f135ccec0b996394c23a308f213 100644 (file)
@@ -281,7 +281,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
 int parse_options_end(struct parse_opt_ctx_t *ctx);
 
 struct option *parse_options_dup(const struct option *a);
-struct option *parse_options_concat(struct option *a, struct option *b);
+struct option *parse_options_concat(const struct option *a, const struct option *b);
 
 /*----- some often used options -----*/
 int parse_opt_abbrev_cb(const struct option *, const char *, int);