fix clang -Wtautological-compare with unsigned enum

Create a GREP_HEADER_FIELD_MIN so we can check that the field value is
sane and silence the clang warning.

Clang warning happens because the enum is unsigned (this is
implementation-defined, and there is no negative fields) and the check
is then tautological.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Antoine Pelisse
2013-02-03 14:37:09 +00:00
committed by Junio C Hamano
parent 5ded807f7c
commit 3ce3ffb840
2 changed files with 4 additions and 2 deletions

3
grep.h
View File

@ -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,