Skip to content

Commit

Permalink
declare 1-bit bitfields to be unsigned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Mar 16, 2011
1 parent f577b92 commit 9ddf172
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,13 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
struct pathspec {
const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
int nr;
int has_wildcard:1;
int recursive:1;
unsigned int has_wildcard:1;
unsigned int recursive:1;
int max_depth;
struct pathspec_item {
const char *match;
int len;
int has_wildcard:1;
unsigned int has_wildcard:1;
} *items;
};

Expand Down

0 comments on commit 9ddf172

Please sign in to comment.