parse-options: const parse_options_concat() parameters
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>
René Scharfe committed
Feb 9, 2020 at 16:57 UTC
c84078573e9dc4b817d8270268583251eed7cff9
2 files changed
+3
-2
parse-options-cb.c
+2
-1
@@ -181,7 +181,8 @@ struct option *parse_options_dup(const struct option *o)
181
return opts;
182
}
183
184
-struct option *parse_options_concat(struct option *a, struct option *b)
184
+struct option *parse_options_concat(const struct option *a,
185
+ const struct option *b)
186
{
187
struct option *ret;
188
size_t a_len = parse_options_count(a);
parse-options.h
+1
-1
@@ -281,7 +281,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
281
int parse_options_end(struct parse_opt_ctx_t *ctx);
282
283
struct option *parse_options_dup(const struct option *a);
284
-struct option *parse_options_concat(struct option *a, struct option *b);
284
+struct option *parse_options_concat(const struct option *a, const struct option *b);
285
286
/*----- some often used options -----*/
287
int parse_opt_abbrev_cb(const struct option *, const char *, int);