Arithmetic comparisons to be same way around

In writing arithmetic comparisons, use "<" and "<=" rather than
">" and ">=". For some justification, read this:

http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-01-22 12:35:18 +01:00
parent e6c32dbdf9
commit ee35f8bb1f
5 changed files with 37 additions and 36 deletions

View file

@ -135,7 +135,7 @@ int get_order(struct range_t *left, struct range_t *right)
ret =
strcmp(left->shared_net->name,
right->shared_net->name);
if (ret > 0) {
if (0 < ret) {
return (0);
} else if (ret < 0) {
return (1);
@ -170,7 +170,7 @@ void mergesort_ranges(struct range_t *orig, int size, struct range_t *temp)
if (size < MIN_MERGE_SIZE) {
for (left = 0; left < size; left++) {
hold = *(orig + left);
for (right = left - 1; right >= 0; right--) {
for (right = left - 1; 0 <= right; right--) {
if (get_order((orig + right), &hold)) {
break;
}