parse-options: adjust `parse_opt_unknown_cb()`s declared return type
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 13 May 2019 22:43:17 +0000 (15:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 May 2019 07:42:31 +0000 (16:42 +0900)
In f41179f16ba2 (parse-options: avoid magic return codes, 2019-01-27),
the signature of the low-level parse-opt callback function was changed
to return an `enum`.

And while the implementations were changed, one declaration was left
unchanged, still claiming to return `int`.

This can potentially lead to problems, as compilers are free to choose
any integral type for an `enum` as long as it can represent all declared
values.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.h
index bd00cf004900c478a0dfae2f0d311d356a67b3c6..cd756833a9947f101fc3356ebdbb22aef3f98c16 100644 (file)
@@ -286,7 +286,9 @@ int parse_opt_commit(const struct option *, const char *, int);
 int parse_opt_tertiary(const struct option *, const char *, int);
 int parse_opt_string_list(const struct option *, const char *, int);
 int parse_opt_noop_cb(const struct option *, const char *, int);
-int parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx, const struct option *, const char *, int);
+enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
+                                          const struct option *,
+                                          const char *, int);
 int parse_opt_passthru(const struct option *, const char *, int);
 int parse_opt_passthru_argv(const struct option *, const char *, int);