aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-dump-split-index.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-06 11:27:24 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-06 20:20:04 +0900
commit80c9e70ebe871f0826bc101142c66ff783405100 (patch)
treec95f04cef2dc0abb2d1fe8e4470e9e385e637b12 /t/helper/test-dump-split-index.c
parent25435e4ad87aa484ce0d9d2adf3aa407f0241704 (diff)
downloadgit-80c9e70ebe871f0826bc101142c66ff783405100.tar.gz
global: trivial conversions to fix `-Wsign-compare` warnings
We have a bunch of loops which iterate up to an unsigned boundary using a signed index, which generates warnigs because we compare a signed and unsigned value in the loop condition. Address these sites for trivial cases and enable `-Wsign-compare` warnings for these code units. This patch only adapts those code units where we can drop the `DISABLE_SIGN_COMPARE_WARNINGS` macro in the same step. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-dump-split-index.c')
-rw-r--r--t/helper/test-dump-split-index.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c
index f31b44a767..f855a3862c 100644
--- a/t/helper/test-dump-split-index.c
+++ b/t/helper/test-dump-split-index.c
@@ -1,5 +1,4 @@
#define USE_THE_REPOSITORY_VARIABLE
-#define DISABLE_SIGN_COMPARE_WARNINGS
#include "test-tool.h"
#include "hex.h"
@@ -17,7 +16,6 @@ static void show_bit(size_t pos, void *data UNUSED)
int cmd__dump_split_index(int ac UNUSED, const char **av)
{
struct split_index *si;
- int i;
setup_git_directory();
@@ -29,7 +27,7 @@ int cmd__dump_split_index(int ac UNUSED, const char **av)
return 0;
}
printf("base %s\n", oid_to_hex(&si->base_oid));
- for (i = 0; i < the_repository->index->cache_nr; i++) {
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++) {
struct cache_entry *ce = the_repository->index->cache[i];
printf("%06o %s %d\t%s\n", ce->ce_mode,
oid_to_hex(&ce->oid), ce_stage(ce), ce->name);