From 72103e9613a4767a3aad2dd63c629f4a1384880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 21 Oct 2020 21:25:50 +0200 Subject: Hold only a const version of the ProcessList in Meters --- solaris/Platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'solaris') diff --git a/solaris/Platform.c b/solaris/Platform.c index 978cca08..2fa2e1de 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -167,9 +167,9 @@ int Platform_getMaxPid() { } double Platform_setCPUValues(Meter* this, int cpu) { - SolarisProcessList* spl = (SolarisProcessList*) this->pl; + const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; int cpus = this->pl->cpuCount; - CPUData* cpuData = NULL; + const CPUData* cpuData = NULL; if (cpus == 1) { // single CPU box has everything in spl->cpus[0] @@ -203,7 +203,7 @@ double Platform_setCPUValues(Meter* this, int cpu) { } void Platform_setMemoryValues(Meter* this) { - ProcessList* pl = (ProcessList*) this->pl; + const ProcessList* pl = this->pl; this->total = pl->totalMem; this->values[0] = pl->usedMem; this->values[1] = pl->buffersMem; @@ -211,19 +211,19 @@ void Platform_setMemoryValues(Meter* this) { } void Platform_setSwapValues(Meter* this) { - ProcessList* pl = (ProcessList*) this->pl; + const ProcessList* pl = this->pl; this->total = pl->totalSwap; this->values[0] = pl->usedSwap; } void Platform_setZfsArcValues(Meter* this) { - SolarisProcessList* spl = (SolarisProcessList*) this->pl; + const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; ZfsArcMeter_readStats(this, &(spl->zfs)); } void Platform_setZfsCompressedArcValues(Meter* this) { - SolarisProcessList* spl = (SolarisProcessList*) this->pl; + const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; ZfsCompressedArcMeter_readStats(this, &(spl->zfs)); } -- cgit v1.2.3