summaryrefslogtreecommitdiff
path: root/diffcore-rename.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 /diffcore-rename.c
parent25435e4ad87aa484ce0d9d2adf3aa407f0241704 (diff)
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 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 08ebb1fc3d..10bb0321b1 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -4,7 +4,6 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
-#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "diff.h"
@@ -689,7 +688,6 @@ static void cleanup_dir_rename_info(struct dir_rename_info *info,
struct hashmap_iter iter;
struct strmap_entry *entry;
struct string_list to_remove = STRING_LIST_INIT_NODUP;
- int i;
if (!info->setup)
return;
@@ -735,7 +733,7 @@ static void cleanup_dir_rename_info(struct dir_rename_info *info,
if (strintmap_contains(counts, UNKNOWN_DIR))
strintmap_remove(counts, UNKNOWN_DIR);
}
- for (i = 0; i < to_remove.nr; ++i)
+ for (size_t i = 0; i < to_remove.nr; ++i)
strmap_remove(info->dir_rename_count,
to_remove.items[i].string, 1);
string_list_clear(&to_remove, 0);