summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 11:26:55 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-22 11:26:55 -0700
commit4aaafdc6f14b3ae79cd35158767d842b62eaad08 (patch)
treec0778643086f9b433ae72acfc54d4a21977fe76b
parent2483fba54e9a870e110448cd463c10684d45ed36 (diff)
parent3ce3ffb840a1dfa7fcbafa9309fab37478605d08 (diff)
downloadgit-4aaafdc6f14b3ae79cd35158767d842b62eaad08.tar.gz
Merge branch 'jk/suppress-clang-warning' into maint
* jk/suppress-clang-warning: fix clang -Wtautological-compare with unsigned enum
-rw-r--r--grep.c3
-rw-r--r--grep.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/grep.c b/grep.c
index 4bd1b8b1dd..bb548cae69 100644
--- a/grep.c
+++ b/grep.c
@@ -625,7 +625,8 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
for (p = opt->header_list; p; p = p->next) {
if (p->token != GREP_PATTERN_HEAD)
die("bug: a non-header pattern in grep header list.");
- if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
+ if (p->field < GREP_HEADER_FIELD_MIN ||
+ GREP_HEADER_FIELD_MAX <= p->field)
die("bug: unknown header field %d", p->field);
compile_regexp(p, opt);
}
diff --git a/grep.h b/grep.h
index 8fc854f400..e4a1df56a4 100644
--- a/grep.h
+++ b/grep.h
@@ -28,7 +28,8 @@ enum grep_context {
};
enum grep_header_field {
- GREP_HEADER_AUTHOR = 0,
+ GREP_HEADER_FIELD_MIN = 0,
+ GREP_HEADER_AUTHOR = GREP_HEADER_FIELD_MIN,
GREP_HEADER_COMMITTER,
GREP_HEADER_REFLOG,