git-apply: slightly clean up bitfield usage
This patch fixes a sparse warning about inaccurate_eof being a "dubious one-bit signed bitfield", makes three more binary variables members of this (now unsigned) bitfield and adds a short comment to indicate the nature of two ternary variables. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
Rene Scharfe committed
Nov 18, 2006 at 13:07 UTC
3dad11bfdb9363bade57ca2caadef1883767e9d3
1 file changed
+5
-2
builtin-apply.c
+5
-2
@@ -140,12 +140,15 @@ struct fragment {
140
struct patch {
141
char *new_name, *old_name, *def_name;
142
unsigned int old_mode, new_mode;
143
- int is_rename, is_copy, is_new, is_delete, is_binary;
143
+ int is_new, is_delete; /* -1 = unknown, 0 = false, 1 = true */
144
int rejected;
145
unsigned long deflate_origlen;
146
int lines_added, lines_deleted;
147
int score;
148
- int inaccurate_eof:1;
148
+ unsigned int inaccurate_eof:1;
149
+ unsigned int is_binary:1;
150
+ unsigned int is_copy:1;
151
+ unsigned int is_rename:1;
152
struct fragment *fragments;
153
char *result;
154
unsigned long resultsize;