diffcore.h: be explicit about the signedness of is_binary
authorRichard Lowe <richlowe@richlowe.net>
Mon, 24 Feb 2014 00:54:47 +0000 (19:54 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2014 17:52:44 +0000 (09:52 -0800)
Bitfields need to specify their signedness explicitly or the compiler is
free to default as it sees fit. With compilers that default 'unsigned'
(SUNWspro 12 seems to do this) the tri-state nature of is_binary
vanishes and all files are treated as binary.

Signed-off-by: Richard Lowe <richlowe@richlowe.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore.h
index 79de8cf28dc6919f069ae44f7f036a46264452e9..7c6f3916e8c4ec3c00b47980977e6e9ecc959a56 100644 (file)
@@ -46,7 +46,7 @@ struct diff_filespec {
        unsigned is_stdin : 1;
        unsigned has_more_entries : 1; /* only appear in combined diff */
        /* data should be considered "binary"; -1 means "don't know yet" */
-       int is_binary : 2;
+       signed int is_binary : 2;
        struct userdiff_driver *driver;
 };