Skip to content

Commit c840785

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f904f90 commit c840785

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

parse-options-cb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ struct option *parse_options_dup(const struct option *o)
181181
return opts;
182182
}
183183

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)
185186
{
186187
struct option *ret;
187188
size_t a_len = parse_options_count(a);

parse-options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
281281
int parse_options_end(struct parse_opt_ctx_t *ctx);
282282

283283
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);
285285

286286
/*----- some often used options -----*/
287287
int parse_opt_abbrev_cb(const struct option *, const char *, int);

0 commit comments

Comments
 (0)