Skip to content

Commit 46fb084

Browse files
davvidgitster
authored andcommitted
xdiff: avoid signed vs. unsigned comparisons in xemit.c
The unsigned `ignored` variable causes expressions to promote to unsigned. Use a signed value to make comparisons use the same types. Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d31bab commit 46fb084

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

xdiff/xemit.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
*/
2222

23-
#define DISABLE_SIGN_COMPARE_WARNINGS
24-
2523
#include "xinclude.h"
2624

2725
static long xdl_get_rec(xdfile_t *xdf, long ri, char const **rec) {
@@ -56,7 +54,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
5654
xdchange_t *xch, *xchp, *lxch;
5755
long max_common = 2 * xecfg->ctxlen + xecfg->interhunkctxlen;
5856
long max_ignorable = xecfg->ctxlen;
59-
unsigned long ignored = 0; /* number of ignored blank lines */
57+
long ignored = 0; /* number of ignored blank lines */
6058

6159
/* remove ignorable changes that are too far before other changes */
6260
for (xchp = *xscr; xchp && xchp->ignore; xchp = xchp->next) {

0 commit comments

Comments
 (0)