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:
Nathan Scott
2021-08-17 14:41:55 +10:00
parent c401ac3a98
commit c7f634ec21
3 changed files with 7 additions and 7 deletions

View File

@ -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;