diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-12-06 11:27:24 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-06 20:20:04 +0900 |
| commit | 80c9e70ebe871f0826bc101142c66ff783405100 (patch) | |
| tree | c95f04cef2dc0abb2d1fe8e4470e9e385e637b12 /tmp-objdir.c | |
| parent | 25435e4ad87aa484ce0d9d2adf3aa407f0241704 (diff) | |
| download | git-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 'tmp-objdir.c')
| -rw-r--r-- | tmp-objdir.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tmp-objdir.c b/tmp-objdir.c index b9084d0ac3..659fcdcc29 100644 --- a/tmp-objdir.c +++ b/tmp-objdir.c @@ -1,5 +1,4 @@ #define USE_THE_REPOSITORY_VARIABLE -#define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.h" #include "tmp-objdir.h" @@ -238,7 +237,6 @@ static int migrate_paths(struct strbuf *src, struct strbuf *dst, { size_t src_len = src->len, dst_len = dst->len; struct string_list paths = STRING_LIST_INIT_DUP; - int i; int ret = 0; if (read_dir_paths(&paths, src->buf) < 0) @@ -246,7 +244,7 @@ static int migrate_paths(struct strbuf *src, struct strbuf *dst, paths.cmp = pack_copy_cmp; string_list_sort(&paths); - for (i = 0; i < paths.nr; i++) { + for (size_t i = 0; i < paths.nr; i++) { const char *name = paths.items[i].string; enum finalize_object_file_flags flags_copy = flags; |
