I renamed both "flags" and "touched_flags" fields while making this patch to make sure I was aware of how these flags were manipulated (besides DIFF_OPT* macros). So hopefully I didn't miss anything. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> --- builtin/commit.c | 2 +- diff-lib.c | 4 ++-- diff.c | 2 +- diff.h | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 4cbd5ff..95f7296 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -895,7 +895,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, * submodules which were manually staged, which would * be really confusing. */ - int diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG; + diff_flags_t diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG; if (ignore_submodule_arg && !strcmp(ignore_submodule_arg, "all")) diff_flags |= DIFF_OPT_IGNORE_SUBMODULES; diff --git a/diff-lib.c b/diff-lib.c index 241a843..ae09034 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -71,7 +71,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt, { int changed = ce_match_stat(ce, st, ce_option); if (S_ISGITLINK(ce->ce_mode)) { - unsigned orig_flags = diffopt->flags; + diff_flags_t orig_flags = diffopt->flags; if (!DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG)) set_diffopt_flags_from_submodule_config(diffopt, ce->name); if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)) @@ -516,7 +516,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt) return 0; } -int index_differs_from(const char *def, int diff_flags) +int index_differs_from(const char *def, diff_flags_t diff_flags) { struct rev_info rev; struct setup_revision_opt opt; diff --git a/diff.c b/diff.c index 7deac90..2485870 100644 --- a/diff.c +++ b/diff.c @@ -4912,7 +4912,7 @@ int diff_can_quit_early(struct diff_options *opt) static int is_submodule_ignored(const char *path, struct diff_options *options) { int ignored = 0; - unsigned orig_flags = options->flags; + diff_flags_t orig_flags = options->flags; if (!DIFF_OPT_TST(options, OVERRIDE_SUBMODULE_CONFIG)) set_diffopt_flags_from_submodule_config(options, path); if (DIFF_OPT_TST(options, IGNORE_SUBMODULES)) diff --git a/diff.h b/diff.h index f7208ad..4241aa5 100644 --- a/diff.h +++ b/diff.h @@ -110,13 +110,15 @@ enum diff_words_type { DIFF_WORDS_COLOR }; +typedef uint64_t diff_flags_t; + struct diff_options { const char *orderfile; const char *pickaxe; const char *single_follow; const char *a_prefix, *b_prefix; - unsigned flags; - unsigned touched_flags; + diff_flags_t flags; + diff_flags_t touched_flags; /* diff-filter bits */ unsigned int filter; @@ -347,7 +349,7 @@ extern int diff_result_code(struct diff_options *, int); extern void diff_no_index(struct rev_info *, int, const char **, const char *); -extern int index_differs_from(const char *def, int diff_flags); +extern int index_differs_from(const char *def, diff_flags_t diff_flags); extern size_t fill_textconv(struct userdiff_driver *driver, struct diff_filespec *df, -- 2.3.0.rc1.137.g477eb31 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html