Skip to content

Commit a52787f

Browse files
committed
xdiff/xdl_cleanup_records: use unambiguous types
Change the parameters of xdl_clean_mmatch() and the local variables i, nm in xdl_cleanup_records() to use unambiguous types. Best viewed with --color-words. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
1 parent 6abd052 commit a52787f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

xdiff/xprepare.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void xdl_free_env(xdfenv_t *xe) {
197197
}
198198

199199

200-
static bool xdl_clean_mmatch(uint8_t const *action, long i, long s, long e) {
201-
long r, rdis0, rpdis0, rdis1, rpdis1;
200+
static bool xdl_clean_mmatch(uint8_t const *action, ptrdiff_t i, ptrdiff_t s, ptrdiff_t e) {
201+
ptrdiff_t r, rdis0, rpdis0, rdis1, rpdis1;
202202

203203
/*
204204
* Limits the window that is examined during the similar-lines
@@ -268,8 +268,8 @@ static bool xdl_clean_mmatch(uint8_t const *action, long i, long s, long e) {
268268
* might be potentially discarded if they appear in a run of discardable.
269269
*/
270270
static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xdf2) {
271-
long i, nm;
272-
size_t mlim1, mlim2;
271+
ptrdiff_t i;
272+
size_t nm, mlim1, mlim2;
273273
xdlclass_t *rcrec;
274274
uint8_t *action1 = NULL, *action2 = NULL;
275275
bool need_min = !!(cf->flags & XDF_NEED_MINIMAL);
@@ -303,7 +303,7 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
303303
for (i = xdf1->dstart; i <= xdf1->dend; i++) {
304304
size_t mph1 = xdf1->recs[i].minimal_perfect_hash;
305305
rcrec = cf->rcrecs[mph1];
306-
nm = rcrec ? rcrec->len2 : 0;
306+
nm = rcrec ? (size_t)rcrec->len2 : 0;
307307
if (nm == 0)
308308
action1[i] = DISCARD;
309309
else if (nm < mlim1)
@@ -315,7 +315,7 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
315315
for (i = xdf2->dstart; i <= xdf2->dend; i++) {
316316
size_t mph2 = xdf2->recs[i].minimal_perfect_hash;
317317
rcrec = cf->rcrecs[mph2];
318-
nm = rcrec ? rcrec->len1 : 0;
318+
nm = rcrec ? (size_t)rcrec->len1 : 0;
319319
if (nm == 0)
320320
action2[i] = DISCARD;
321321
else if (nm < mlim2)

0 commit comments

Comments
 (0)