* src/comm.c (compare_files): Use _GL_CMP.
* src/join.c (keycmp): Likewise.
* src/ls.c (off_cmp): Likewise.
* src/ptx.c (compare_words, compare_occurs): Likewise.
* src/set-fields.c (compare_ranges): Likewise.
* src/sort.c (compare_random, diff_reversed, compare): Likewise.
size_t len = MIN (thisline[0]->length, thisline[1]->length) - 1;
order = memcmp (thisline[0]->buffer, thisline[1]->buffer, len);
if (order == 0)
- order = ((thisline[0]->length > thisline[1]->length)
- - (thisline[0]->length < thisline[1]->length));
+ order = _GL_CMP (thisline[0]->length, thisline[1]->length);
}
}
if (diff)
return diff;
- return (len1 > len2) - (len1 < len2);
+ return _GL_CMP (len1, len2);
}
/* Check that successive input lines PREV and CURRENT from input file
static int
off_cmp (off_t a, off_t b)
{
- return (a > b) - (a < b);
+ return _GL_CMP (a, b);
}
static int
}
}
- return (first->size > second->size) - (first->size < second->size);
+ return _GL_CMP (first->size, second->size);
}
/*-----------------------------------------------------------------------.
value = compare_words (&first->key, &second->key);
return (value ? value
- : ((first->key.start > second->key.start)
- - (first->key.start < second->key.start)));
+ : _GL_CMP (first->key.start, second->key.start));
#undef first
#undef second
}
compare_ranges (const void *a, const void *b)
{
struct field_range_pair const *ap = a, *bp = b;
- return (ap->lo > bp->lo) - (ap->lo < bp->lo);
+ return _GL_CMP (ap->lo, bp->lo);
}
/* Reallocate Range Pair entries, with corresponding
{
xfrm_diff = memcmp (buf, buf + sizea, MIN (sizea, sizeb));
if (! xfrm_diff)
- xfrm_diff = (sizea > sizeb) - (sizea < sizeb);
+ xfrm_diff = _GL_CMP (sizea, sizeb);
}
}
}
{
xfrm_diff = memcmp (texta, textb, MIN (lena, lenb));
if (! xfrm_diff)
- xfrm_diff = (lena > lenb) - (lena < lenb);
+ xfrm_diff = _GL_CMP (lena, lenb);
}
diff = xfrm_diff;
static int
diff_reversed (int diff, bool reversed)
{
- return reversed ? (diff < 0) - (diff > 0) : diff;
+ return reversed ? _GL_CMP (0, diff) : diff;
}
/* Compare two lines A and B trying every key in sequence until there
diff = memcmp (texta, textb, lenmin);
if (! diff)
- diff = (lena > lenb) - (lena < lenb);
+ diff = _GL_CMP (lena, lenb);
}
if (diff)
{
diff = memcmp (a->text, b->text, MIN (alen, blen));
if (!diff)
- diff = (alen > blen) - (alen < blen);
+ diff = _GL_CMP (alen, blen);
}
return diff_reversed (diff, reverse);