declare 1-bit bitfields to be unsigned
As "gcc -pedantic" notices, a two's complement 1-bit signed integer cannot represent the value '1'. dir.c: In function 'init_pathspec': dir.c:1291:4: warning: overflow in implicit constant conversion [-Woverflow] In the spirit of v1.7.1-rc1~10 (2010-04-06), 'unsigned' is what was intended, so let's make the flags unsigned. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Mar 15, 2011 at 22:42 UTC
9ddf17268c632967abf2dadf9fa2b9d11dcc1867
1 file changed
+3
-3
cache.h
+3
-3
@@ -503,13 +503,13 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
503
struct pathspec {
504
const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
505
int nr;
506
- int has_wildcard:1;
507
- int recursive:1;
506
+ unsigned int has_wildcard:1;
507
+ unsigned int recursive:1;
508
int max_depth;
509
struct pathspec_item {
510
const char *match;
511
int len;
512
- int has_wildcard:1;
512
+ unsigned int has_wildcard:1;
513
} *items;
514
};
515