mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
PCP: ensure unsigned types used throughout CPU count detection
This cannot be negative in these code locations, but for the purposes of static checking like Coverity scan make it clear and used the same unsigned type as ProcessList.h for the CPU count variable (matching PL activeCPUs and existingCPUs).
This commit is contained in:
@ -35,7 +35,7 @@ static void PCPProcessList_updateCPUcount(PCPProcessList* this) {
|
||||
unsigned int cpus = Platform_getMaxCPU();
|
||||
if (cpus == pl->existingCPUs)
|
||||
return;
|
||||
if (cpus <= 0)
|
||||
if (cpus == 0)
|
||||
cpus = pl->activeCPUs;
|
||||
if (cpus <= 1)
|
||||
cpus = pl->activeCPUs = 1;
|
||||
|
Reference in New Issue
Block a user