diff options
author | Brandon Williams <bmwill@google.com> | 2017-10-31 11:19:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-01 11:50:03 +0900 |
commit | 3b69daed861daec1923c369d59c97e46eb3c3d7b (patch) | |
tree | bc66d274c0b97aa27526320778387e557dc22dbe /diffcore-pickaxe.c | |
parent | 25567af8056d992c9a51815db4b3a3e9417a2969 (diff) | |
download | git-3b69daed861daec1923c369d59c97e46eb3c3d7b.tar.gz |
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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 341529b5a8..6193c07f6f 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(®ex, needle, cflags); regexp = ®ex; - } 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 = ®ex; } 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); |