From: Richard Lowe <richlowe@richlowe.net>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: [PATCH] diffcore.h: be explicit about the signedness of is_binary
Date: Sun, 23 Feb 2014 19:54:47 -0500 [thread overview]
Message-ID: <m2ob1xba94.fsf@richlowe.net> (raw)
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>
---
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;
};
--
1.8.5.5
next reply other threads:[~2014-02-24 1:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 0:54 Richard Lowe [this message]
2014-02-24 2:09 ` [PATCH] diffcore.h: be explicit about the signedness of is_binary Jeff King
2014-02-24 17:55 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2ob1xba94.fsf@richlowe.net \
--to=richlowe@richlowe.net \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).