]> git.ipfire.org Git - thirdparty/git.git/commit
diff.h: fix index used to loop through unsigned integer
authorPatrick Steinhardt <ps@pks.im>
Fri, 6 Dec 2024 10:27:21 +0000 (11:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2024 11:20:03 +0000 (20:20 +0900)
commit47d72a74a737f06791c282a75baf2c573cdf42f6
treeb5c04796ba6e418f79f9621bff13900442e956b3
parent4f9264b0cdf588745ebd71638a216e626b89df35
diff.h: fix index used to loop through unsigned integer

The `struct diff_flags` structure is essentially an array of flags, all
of which have the same type. We can thus use `sizeof()` to iterate
through all of the flags, which we do in `diff_flags_or()`. But while
the statement returns an unsigned integer, we used a signed integer to
iterate through the flags, which generates a warning.

Fix this by using `size_t` for the index instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 files changed:
builtin/am.c
builtin/diff-tree.c
builtin/merge-ours.c
builtin/pack-refs.c
builtin/range-diff.c
builtin/reflog.c
builtin/reset.c
builtin/revert.c
builtin/shortlog.c
diff-merges.c
diff.h
diffcore-order.c
diffcore-rotate.c
list-objects-filter.c
patch-ids.c
reachable.c
reflog-walk.c
t/helper/test-revision-walking.c