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

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

index 4685ba613778149dba84d080869d1b6d7fc2654c..8889b8b62a1a6e87f36adcbb501302d518cd94ec 100644 (file)
@@ -19,7 +19,6 @@
  *  Davide Libenzi <davidel@xmailserver.org>
  *
  */
-#define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "xinclude.h"
 
@@ -1014,7 +1013,7 @@ static void xdl_mark_ignorable_lines(xdchange_t *xscr, xdfenv_t *xe, long flags)
 
 static int record_matches_regex(xrecord_t *rec, xpparam_t const *xpp) {
        regmatch_t regmatch;
-       int i;
+       size_t i;
 
        for (i = 0; i < xpp->ignore_regex_nr; i++)
                if (!regexec_buf(xpp->ignore_regex[i], rec->ptr, rec->size, 1,