mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
Consolidate repeated macro definitions into one header
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
This commit is contained in:
@ -20,7 +20,7 @@ static void TasksMeter_updateValues(Meter* this, char* buffer, int len) {
|
||||
this->values[0] = pl->kernelThreads;
|
||||
this->values[1] = pl->userlandThreads;
|
||||
this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads;
|
||||
this->values[3] = MIN(pl->runningTasks, pl->cpuCount);
|
||||
this->values[3] = MINIMUM(pl->runningTasks, pl->cpuCount);
|
||||
if (pl->totalTasks > this->total) {
|
||||
this->total = pl->totalTasks;
|
||||
}
|
||||
|
Reference in New Issue
Block a user