summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1998-09-20 05:58:55 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1998-09-20 05:58:55 +0000
commit4cd3eb4f514a0a7336c26d9a4576e351bd22a1a6 (patch)
tree9cb1e667f4c357f13cd94245512b7536ba95c547 /usr.bin
parent375f764578ae94ab4470970cb9cc430d58f6dcae (diff)
widen unsigned entities to signed ones before subtracting, fixes sorting on alpha
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/top/machine.c4
1 files changed, 2 insertions, 2 deletions
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) \