summaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-01-17 01:25:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-17 18:50:14 (GMT)
commitcbfe47b67fc1072998c73e6d43cf6ad061a436f5 (patch)
tree6f1a19e2f892c7539214a399f1849b8e48c84893 /diffcore.h
parentb38f70a82b9628d80f5a9bc938a8861ee4dcf49e (diff)
downloadgit-cbfe47b67fc1072998c73e6d43cf6ad061a436f5.zip
git-cbfe47b67fc1072998c73e6d43cf6ad061a436f5.tar.gz
git-cbfe47b67fc1072998c73e6d43cf6ad061a436f5.tar.bz2
diff_filespec: use only 2 bits for is_binary flag
The is_binary flag needs only three values: -1, 0, and 1. However, we use a whole 32-bit int for it on most systems (both 32- and 64- bit). Instead, we can mark it to use only 2 bits. On 32-bit systems, this lets it end up as part of the bitfield above (saving 4 bytes). On 64-bit systems, we don't see any change (because the savings end up as padding), but it does leave room for another "free" 32-bit value to be added later. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h
index d911bf0..79de8cf 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;
+ int is_binary : 2;
struct userdiff_driver *driver;
};