[PATCH 0/3] Fix code issues spotted by clang
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:52:23
This series fixes some of the code issues raised by clang. This leaves
the following warnings that I haven't addressed:
revision.c:766:25: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967279 to 134217711
[-Wconstant-conversion]
p->item->object.flags &= ~TMP_MARK;
^ ~~~~~~~~~
revision.c:768:25: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967279 to 134217711
[-Wconstant-conversion]
p->item->object.flags &= ~TMP_MARK;
^ ~~~~~~~~~
revision.c:1875:25: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967279 to 134217711
[-Wconstant-conversion]
p->item->object.flags &= ~TMP_MARK;
^ ~~~~~~~~~
revision.c:2202:25: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967158 to 134217590
[-Wconstant-conversion]
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
^ ~~~~~~~~~~~~~~~~~~~~~~~
upload-pack.c:115:12: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967293 to 134217725
[-Wconstant-conversion]
o->flags &= ~UNINTERESTING;
^ ~~~~~~~~~~~~~~
upload-pack.c:689:19: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294705151 to 133955583
[-Wconstant-conversion]
object->flags &= ~CLIENT_SHALLOW;
^ ~~~~~~~~~~~~~~~
builtin/checkout.c:676:16: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294967293 to 134217725
[-Wconstant-conversion]
object->flags &= ~UNINTERESTING;
^ ~~~~~~~~~~~~~~
builtin/reflog.c:173:32: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294965247 to 134215679
[-Wconstant-conversion]
found.objects[i].item->flags &= ~STUDYING;
^ ~~~~~~~~~
builtin/reflog.c:232:31: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294963199 to 134213631
[-Wconstant-conversion]
pending->item->object.flags &= ~REACHABLE;
^ ~~~~~~~~~~
bisect.c:66:24: warning: implicit truncation from 'unsigned int' to bitfield changes value from 4294901759 to 134152191
[-Wconstant-conversion]
commit->object.flags &= ~COUNTED;
^ ~~~~~~~~
Ævar Arnfjörð Bjarmason (3):
apply: get rid of useless x < 0 comparison on a size_t type
diff/apply: cast variable in call to free()
grep: get rid of useless x < 0 comparison on an enum member
builtin/apply.c | 3 ---
builtin/diff.c | 2 +-
grep.c | 2 +-
submodule.c | 2 +-
4 files changed, 3 insertions(+), 6 deletions(-)
--
1.7.6.3