summaryrefslogtreecommitdiffstats
path: root/diffcore-pickaxe.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-10-31 11:19:08 -0700
committerJunio C Hamano <gitster@pobox.com>2017-11-01 11:50:03 +0900
commit3b69daed861daec1923c369d59c97e46eb3c3d7b (patch)
treebc66d274c0b97aa27526320778387e557dc22dbe /diffcore-pickaxe.c
parent25567af8056d992c9a51815db4b3a3e9417a2969 (diff)
downloadgit-3b69daed861daec1923c369d59c97e46eb3c3d7b.tar.gz
git-3b69daed861daec1923c369d59c97e46eb3c3d7b.tar.xz
diff: remove DIFF_OPT_TST macro
Remove the `DIFF_OPT_TST` macro and instead access the flags directly. This conversion is done using the following semantic patch: @@ expression E; identifier fld; @@ - DIFF_OPT_TST(&E, fld) + E.flags.fld @@ type T; T *ptr; identifier fld; @@ - DIFF_OPT_TST(ptr, fld) + ptr->flags.fld Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-pickaxe.c')
-rw-r--r--diffcore-pickaxe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 341529b5a..6193c07f6 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -131,7 +131,7 @@ static int pickaxe_match(struct diff_filepair *p, struct diff_options *o,
if (!DIFF_FILE_VALID(p->one) && !DIFF_FILE_VALID(p->two))
return 0;
- if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) {
+ if (o->flags.ALLOW_TEXTCONV) {
textconv_one = get_textconv(p->one);
textconv_two = get_textconv(p->two);
}
@@ -222,11 +222,11 @@ void diffcore_pickaxe(struct diff_options *o)
if (opts & (DIFF_PICKAXE_REGEX | DIFF_PICKAXE_KIND_G)) {
int cflags = REG_EXTENDED | REG_NEWLINE;
- if (DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE))
+ if (o->flags.PICKAXE_IGNORE_CASE)
cflags |= REG_ICASE;
regcomp_or_die(&regex, needle, cflags);
regexp = &regex;
- } else if (DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE) &&
+ } else if (o->flags.PICKAXE_IGNORE_CASE &&
has_non_ascii(needle)) {
struct strbuf sb = STRBUF_INIT;
int cflags = REG_NEWLINE | REG_ICASE;
@@ -236,7 +236,7 @@ void diffcore_pickaxe(struct diff_options *o)
strbuf_release(&sb);
regexp = &regex;
} else {
- kws = kwsalloc(DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE)
+ kws = kwsalloc(o->flags.PICKAXE_IGNORE_CASE
? tolower_trans_tbl : NULL);
kwsincr(kws, needle, strlen(needle));
kwsprep(kws);