diff options
author | Explorer09 <explorer09@gmail.com> | 2023-08-17 04:21:05 +0800 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-08-18 12:52:28 +0200 |
commit | 076b913c7f876ba0489b9751043eeb61aa34680f (patch) | |
tree | 35173363985f959a0e77993b07c3b9fe09a2c1c6 /Process.c | |
parent | 93d76fd37627a3594f52afda32092fa3858f28dc (diff) |
Compare all percentage fields with compareRealNumbers()
The SPACESHIP_NUMBER() macro does not work well with floating point
values that are possible to be NaNs. Change the compare logic of all
percentage fields of Process entries to use compareRealNumbers().
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1182,7 +1182,7 @@ int Process_compareByKey_Base(const Process* p1, const Process* p2, ProcessField switch (key) { case PERCENT_CPU: case PERCENT_NORM_CPU: - return SPACESHIP_NUMBER(p1->percent_cpu, p2->percent_cpu); + return compareRealNumbers(p1->percent_cpu, p2->percent_cpu); case PERCENT_MEM: return SPACESHIP_NUMBER(p1->m_resident, p2->m_resident); case COMM: |