diff options
author | Benny Baumann <BenBE@geshi.org> | 2023-11-29 21:27:07 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-12-26 15:14:19 +0100 |
commit | 2aacbf84cb397e17e677b7e46cc4548ab599493a (patch) | |
tree | d6fd34701f8c90cc52bc4c43e6df32c2fcc50545 /linux | |
parent | 6aa9ef2726e42c4ae062b55be4d5cc015767d997 (diff) |
Use consistent style for process field output/compare functions
Diffstat (limited to 'linux')
-rw-r--r-- | linux/LinuxProcess.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 84141ec0..b6c90780 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -226,13 +226,15 @@ static double LinuxProcess_totalIORate(const LinuxProcess* lp) { static void LinuxProcess_rowWriteField(const Row* super, RichString* str, ProcessField field) { const Process* this = (const Process*) super; + const LinuxProcess* lp = (const LinuxProcess*) super; const Machine* host = (const Machine*) super->host; - const LinuxMachine* lhost = (const LinuxMachine*) host; - const LinuxProcess* lp = (const LinuxProcess*) this; + const LinuxMachine* lhost = (const LinuxMachine*) super->host; + bool coloring = host->settings->highlightMegabytes; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; size_t n = sizeof(buffer) - 1; + switch (field) { case CMINFLT: Row_printCount(str, lp->cminflt, coloring); return; case CMAJFLT: Row_printCount(str, lp->cmajflt, coloring); return; @@ -330,6 +332,7 @@ static void LinuxProcess_rowWriteField(const Row* super, RichString* str, Proces Process_writeField(this, str, field); return; } + RichString_appendAscii(str, attr, buffer); } |