summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-10-31 18:19:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-01 02:50:03 (GMT)
commit23dcf77f48feb49c54bad09210f093a799816334 (patch)
treeeff748e83bc0e1bf41b631d77d5c38f82a549ee5 /diff-lib.c
parent3b69daed861daec1923c369d59c97e46eb3c3d7b (diff)
downloadgit-23dcf77f48feb49c54bad09210f093a799816334.zip
git-23dcf77f48feb49c54bad09210f093a799816334.tar.gz
git-23dcf77f48feb49c54bad09210f093a799816334.tar.bz2
diff: remove DIFF_OPT_SET macro
Remove the `DIFF_OPT_SET` macro and instead set the flags directly. This conversion is done using the following semantic patch: @@ expression E; identifier fld; @@ - DIFF_OPT_SET(&E, fld) + E.flags.fld = 1 @@ type T; T *ptr; identifier fld; @@ - DIFF_OPT_SET(ptr, fld) + ptr->flags.fld = 1 Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 456971b..f1cc3fd 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -545,8 +545,8 @@ int index_differs_from(const char *def, const struct diff_flags *flags,
memset(&opt, 0, sizeof(opt));
opt.def = def;
setup_revisions(0, NULL, &rev, &opt);
- DIFF_OPT_SET(&rev.diffopt, QUICK);
- DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
+ rev.diffopt.flags.QUICK = 1;
+ rev.diffopt.flags.EXIT_WITH_STATUS = 1;
if (flags)
diff_flags_or(&rev.diffopt.flags, flags);
rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;