summaryrefslogtreecommitdiffstats
path: root/solaris
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-02-17 17:38:35 +0100
committerBenny Baumann <BenBE@geshi.org>2021-03-19 23:30:54 +0100
commita11d01568c5e7bc5570fd48fa0703d837c4bcd84 (patch)
tree3e298e81123789ed6ae288e5bd32e91ebfb3ff01 /solaris
parent53bcc5cbffbdd69e0e08bd33c5e357dd5b753456 (diff)
Use unsigned types for CPU counts and associated variables
Diffstat (limited to 'solaris')
-rw-r--r--solaris/Platform.c4
-rw-r--r--solaris/Platform.h2
-rw-r--r--solaris/SolarisProcessList.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/solaris/Platform.c b/solaris/Platform.c
index aa000e29..cadf092c 100644
--- a/solaris/Platform.c
+++ b/solaris/Platform.c
@@ -177,9 +177,9 @@ int Platform_getMaxPid() {
return vproc;
}
-double Platform_setCPUValues(Meter* this, int cpu) {
+double Platform_setCPUValues(Meter* this, unsigned int cpu) {
const SolarisProcessList* spl = (const SolarisProcessList*) this->pl;
- int cpus = this->pl->cpuCount;
+ unsigned int cpus = this->pl->cpuCount;
const CPUData* cpuData = NULL;
if (cpus == 1) {
diff --git a/solaris/Platform.h b/solaris/Platform.h
index bacadf07..8d08ad99 100644
--- a/solaris/Platform.h
+++ b/solaris/Platform.h
@@ -59,7 +59,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen);
int Platform_getMaxPid(void);
-double Platform_setCPUValues(Meter* this, int cpu);
+double Platform_setCPUValues(Meter* this, unsigned int cpu);
void Platform_setMemoryValues(Meter* this);
diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c
index 1f24c9ab..5223addf 100644
--- a/solaris/SolarisProcessList.c
+++ b/solaris/SolarisProcessList.c
@@ -69,7 +69,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui
static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) {
const SolarisProcessList* spl = (SolarisProcessList*) pl;
- int cpus = pl->cpuCount;
+ unsigned int cpus = pl->cpuCount;
kstat_t* cpuinfo = NULL;
kstat_named_t* idletime = NULL;
kstat_named_t* intrtime = NULL;
@@ -91,7 +91,7 @@ static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) {
}
// Calculate per-CPU statistics first
- for (int i = 0; i < cpus; i++) {
+ for (unsigned int i = 0; i < cpus; i++) {
if (spl->kd != NULL) {
if ((cpuinfo = kstat_lookup(spl->kd, "cpu", i, "sys")) != NULL) {
if (kstat_read(spl->kd, cpuinfo, NULL) != -1) {

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