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
- ? -1
- : thisline[0]->length != thisline[1]->length);
+ order = ((thisline[0]->length > thisline[1]->length)
+ - (thisline[0]->length < thisline[1]->length));
}
}
if (diff)
return diff;
- return len1 < len2 ? -1 : len1 != len2;
+ return (len1 > len2) - (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 ? -1 : a > b;
+ return (a > b) - (a < b);
}
static int
}
}
- return first->size < second->size ? -1 : first->size > second->size;
+ return (first->size > second->size) - (first->size < second->size);
#undef first
#undef second
}
value = compare_words (&first->key, &second->key);
return (value ? value
- : first->key.start < second->key.start ? -1
- : first->key.start > second->key.start);
+ : ((first->key.start > second->key.start)
+ - (first->key.start < second->key.start)));
#undef first
#undef second
}
/* Comparison function for qsort to order the list of
- struct range_pairs. */
+ struct field_range_pairs. */
static int
compare_ranges (const void *a, const void *b)
{
- int a_start = ((const struct field_range_pair *) a)->lo;
- int b_start = ((const struct field_range_pair *) b)->lo;
- return a_start < b_start ? -1 : a_start > b_start;
+ struct field_range_pair const *ap = a, *bp = b;
+ return (ap->lo > bp->lo) - (ap->lo < bp->lo);
}
/* Reallocate Range Pair entries, with corresponding