Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] diffcore.h: be explicit about the signedness of is_binary

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:59

Richard Lowe [off-list ref] writes:
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 <redacted>
---
Looks good; thanks.
quoted hunk
 diffcore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffcore.h b/diffcore.h
index 79de8cf..7c6f391 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -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;
 };
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help