]> git.ipfire.org Git - thirdparty/git.git/commitdiff
xdiff: avoid signed vs. unsigned comparisons in xpatience.c
authorDavid Aguilar <davvid@gmail.com>
Wed, 12 Feb 2025 06:04:17 +0000 (22:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Feb 2025 17:41:17 +0000 (09:41 -0800)
The loop iteration variable is non-negative and used in comparisons
against a size_t value. Use size_t to eliminate the mismatch.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xpatience.c

index b0ba421b28537c278165d07031dffe3ecb3cd0b6..82f663004ec2ef6ad5bf314516a8e6d040ecbca1 100644 (file)
@@ -20,8 +20,6 @@
  *
  */
 
-#define DISABLE_SIGN_COMPARE_WARNINGS
-
 #include "xinclude.h"
 
 /*
@@ -78,7 +76,7 @@ struct hashmap {
 
 static int is_anchor(xpparam_t const *xpp, const char *line)
 {
-       int i;
+       size_t i;
        for (i = 0; i < xpp->anchors_nr; i++) {
                if (!strncmp(line, xpp->anchors[i], strlen(xpp->anchors[i])))
                        return 1;