summaryrefslogtreecommitdiffstats
path: root/pcp/Platform.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-08-17 14:41:55 +1000
committerNathan Scott <nathans@redhat.com>2021-08-17 14:41:55 +1000
commitc7f634ec218da6bdb3bab9e9cd6fa7b2df3fcea8 (patch)
tree5522eeea3bdbec5e6bbbe614845a8463452740b8 /pcp/Platform.h
parentc401ac3a98563f84e1957445f4c5643186e0e9d3 (diff)
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).
Diffstat (limited to 'pcp/Platform.h')
-rw-r--r--pcp/Platform.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcp/Platform.h b/pcp/Platform.h
index 9d0c8f53..dcb8dc98 100644
--- a/pcp/Platform.h
+++ b/pcp/Platform.h
@@ -54,7 +54,7 @@ typedef struct Platform_ {
long long btime; /* boottime in seconds since the epoch */
char* release; /* uname and distro from this context */
int pidmax; /* maximum platform process identifier */
- int ncpu; /* maximum processor count configured */
+ unsigned int ncpu; /* maximum processor count configured */
} Platform;
extern ProcessField Platform_defaultFields[];
@@ -79,7 +79,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen);
long long Platform_getBootTime(void);
-int Platform_getMaxCPU(void);
+unsigned int Platform_getMaxCPU(void);
int Platform_getMaxPid(void);

© 2014-2024 Faster IT GmbH | imprint | privacy policy