FreeBSD Bugzilla – Attachment 9214 Details for
Bug 18951
top sorting error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.51 KB, created by
dwmalone
on 2000-06-01 18:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
dwmalone
Created:
2000-06-01 18:20:01 UTC
Size:
2.51 KB
patch
obsolete
>--- machine.c.orig Fri Mar 24 19:57:36 2000 >+++ machine.c Fri Mar 24 19:58:17 2000 >@@ -737,26 +737,26 @@ > 4 /* stop */ > }; > >+#define CMP(a,b) ( (a) == (b) ? 0 : (a) < (b) ? -1 : 1 ) > > #define ORDERKEY_PCTCPU \ >- if (lresult = (long) PP(p2, p_pctcpu) - (long) PP(p1, p_pctcpu), \ >- (result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0) >+ if ((result = CMP(PP(p2, p_pctcpu),PP(p1, p_pctcpu))) == 0) > > #define ORDERKEY_CPTICKS \ >- if ((result = PP(p2, p_runtime) - PP(p1, p_runtime)) == 0) >+ if ((result = CMP(PP(p2, p_runtime),PP(p1, p_runtime))) == 0) > > #define ORDERKEY_STATE \ >- if ((result = sorted_state[(unsigned char) PP(p2, p_stat)] - \ >- sorted_state[(unsigned char) PP(p1, p_stat)]) == 0) >+ if ((result = CMP(sorted_state[(unsigned char) PP(p2, p_stat)], \ >+ sorted_state[(unsigned char) PP(p1, p_stat)])) == 0) > > #define ORDERKEY_PRIO \ >- if ((result = PP(p2, p_priority) - PP(p1, p_priority)) == 0) >+ if ((result = CMP(PP(p2, p_priority),PP(p1, p_priority))) == 0) > > #define ORDERKEY_RSSIZE \ >- if ((result = VP(p2, vm_rssize) - VP(p1, vm_rssize)) == 0) >+ if ((result = CMP(VP(p2, vm_rssize),VP(p1, vm_rssize))) == 0) > > #define ORDERKEY_MEM \ >- if ( (result = PROCSIZE(p2) - PROCSIZE(p1)) == 0 ) >+ if ((result = CMP(PROCSIZE(p2),PROCSIZE(p1))) == 0 ) > > /* compare_cpu - the comparison function for sorting by cpu percentage */ > >@@ -774,7 +774,6 @@ > register struct kinfo_proc *p1; > register struct kinfo_proc *p2; > register int result; >- register pctcpu lresult; > > /* remove one level of indirection */ > p1 = *(struct kinfo_proc **) pp1; >@@ -816,7 +815,6 @@ > register struct kinfo_proc *p1; > register struct kinfo_proc *p2; > register int result; >- register pctcpu lresult; > > /* remove one level of indirection */ > p1 = *(struct kinfo_proc **) pp1; >@@ -845,7 +843,6 @@ > register struct kinfo_proc *p1; > register struct kinfo_proc *p2; > register int result; >- register pctcpu lresult; > > /* remove one level of indirection */ > p1 = *(struct kinfo_proc **) pp1; >@@ -874,7 +871,6 @@ > register struct kinfo_proc *p1; > register struct kinfo_proc *p2; > register int result; >- register pctcpu lresult; > > /* remove one level of indirection */ > p1 = *(struct kinfo_proc **) pp1; >@@ -903,7 +899,6 @@ > register struct kinfo_proc *p1; > register struct kinfo_proc *p2; > register int result; >- register pctcpu lresult; > > /* remove one level of indirection */ > p1 = *(struct kinfo_proc **) pp1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18951
: 9214