]> git.cameronkatri.com Git - cgit.git/commitdiff
Avoid signed bitfields
authorJohn Keeping <john@keeping.me.uk>
Sun, 8 Mar 2015 16:32:17 +0000 (16:32 +0000)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 9 Mar 2015 16:38:46 +0000 (17:38 +0100)
Bitfields are only defined for unsigned types.

Detected by sparse.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-blob.c
ui-diff.c

index a025bca5d8f501ded7e6da6d7ea6965485e3f75f..388a0177a30487959c0fb35d40cff64ce278aedf 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -14,8 +14,8 @@
 struct walk_tree_context {
        const char *match_path;
        unsigned char *matched_sha1;
-       int found_path:1;
-       int file_only:1;
+       unsigned int found_path:1;
+       unsigned int file_only:1;
 };
 
 static int walk_tree(const unsigned char *sha1, struct strbuf *base,
index 8eff178c6e3e8cd33c64c8bf5b21a0c143ce112e..1cf2ce0c8e32b1a600b855c0d9951297d2fdcafa 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -31,7 +31,7 @@ static struct fileinfo {
        unsigned int removed;
        unsigned long old_size;
        unsigned long new_size;
-       int binary:1;
+       unsigned int binary:1;
 } *items;
 
 static int use_ssdiff = 0;