From 4cd3eb4f514a0a7336c26d9a4576e351bd22a1a6 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Sun, 20 Sep 1998 05:58:55 +0000 Subject: widen unsigned entities to signed ones before subtracting, fixes sorting on alpha --- usr.bin/top/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/top') diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index e8f0edf0337..dcdd40a64c0 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.11 1998/08/21 13:55:23 kstailey Exp $ */ +/* $OpenBSD: machine.c,v 1.12 1998/09/20 05:58:54 niklas Exp $ */ /* * top - a top users display for Unix @@ -596,7 +596,7 @@ static unsigned char sorted_state[] = #define ORDERKEY_PCTCPU \ - if (lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu), \ + if (lresult = (pctcpu)PP(p2, p_pctcpu) - (pctcpu)PP(p1, p_pctcpu), \ (result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0) #define ORDERKEY_CPUTIME \ if ((result = PP(p2, p_rtime.tv_sec) - PP(p1, p_rtime.tv_sec)) == 0) \ -- cgit v1.2.3