Commit f78f658e authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

dragonflybsd, freebsd, openbsd: fixes for htop 3.0 branch

parent b8bfe60d
...@@ -138,14 +138,14 @@ void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField ...@@ -138,14 +138,14 @@ void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField
long DragonFlyBSDProcess_compare(const void* v1, const void* v2) { long DragonFlyBSDProcess_compare(const void* v1, const void* v2) {
DragonFlyBSDProcess *p1, *p2; DragonFlyBSDProcess *p1, *p2;
Settings *settings = ((Process*)v1)->settings; Settings *settings = ((Process*)v1)->settings;
if (settings->direction == 1) { if (settings->ss->direction == 1) {
p1 = (DragonFlyBSDProcess*)v1; p1 = (DragonFlyBSDProcess*)v1;
p2 = (DragonFlyBSDProcess*)v2; p2 = (DragonFlyBSDProcess*)v2;
} else { } else {
p2 = (DragonFlyBSDProcess*)v1; p2 = (DragonFlyBSDProcess*)v1;
p1 = (DragonFlyBSDProcess*)v2; p1 = (DragonFlyBSDProcess*)v2;
} }
switch ((int) settings->sortKey) { switch ((int) settings->ss->sortKey) {
// add Platform-specific fields here // add Platform-specific fields here
case JID: case JID:
return (p1->jid - p2->jid); return (p1->jid - p2->jid);
......
...@@ -136,14 +136,14 @@ void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField fiel ...@@ -136,14 +136,14 @@ void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField fiel
long FreeBSDProcess_compare(const void* v1, const void* v2) { long FreeBSDProcess_compare(const void* v1, const void* v2) {
FreeBSDProcess *p1, *p2; FreeBSDProcess *p1, *p2;
Settings *settings = ((Process*)v1)->settings; Settings *settings = ((Process*)v1)->settings;
if (settings->direction == 1) { if (settings->ss->direction == 1) {
p1 = (FreeBSDProcess*)v1; p1 = (FreeBSDProcess*)v1;
p2 = (FreeBSDProcess*)v2; p2 = (FreeBSDProcess*)v2;
} else { } else {
p2 = (FreeBSDProcess*)v1; p2 = (FreeBSDProcess*)v1;
p1 = (FreeBSDProcess*)v2; p1 = (FreeBSDProcess*)v2;
} }
switch ((int) settings->sortKey) { switch ((int) settings->ss->sortKey) {
// add FreeBSD-specific fields here // add FreeBSD-specific fields here
case JID: case JID:
return (p1->jid - p2->jid); return (p1->jid - p2->jid);
......
...@@ -215,14 +215,14 @@ void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField fiel ...@@ -215,14 +215,14 @@ void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField fiel
long OpenBSDProcess_compare(const void* v1, const void* v2) { long OpenBSDProcess_compare(const void* v1, const void* v2) {
OpenBSDProcess *p1, *p2; OpenBSDProcess *p1, *p2;
Settings *settings = ((Process*)v1)->settings; Settings *settings = ((Process*)v1)->settings;
if (settings->direction == 1) { if (settings->ss->direction == 1) {
p1 = (OpenBSDProcess*)v1; p1 = (OpenBSDProcess*)v1;
p2 = (OpenBSDProcess*)v2; p2 = (OpenBSDProcess*)v2;
} else { } else {
p2 = (OpenBSDProcess*)v1; p2 = (OpenBSDProcess*)v1;
p1 = (OpenBSDProcess*)v2; p1 = (OpenBSDProcess*)v2;
} }
switch (settings->sortKey) { switch (settings->ss->sortKey) {
// add OpenBSD-specific fields here // add OpenBSD-specific fields here
default: default:
return Process_compare(v1, v2); return Process_compare(v1, v2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment