summaryrefslogtreecommitdiffstats
path: root/CPUMeter.c
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 /CPUMeter.c
parent53bcc5cbffbdd69e0e08bd33c5e357dd5b753456 (diff)
Use unsigned types for CPU counts and associated variables
Diffstat (limited to 'CPUMeter.c')
-rw-r--r--CPUMeter.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/CPUMeter.c b/CPUMeter.c
index 96da87e1..47437cc7 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -35,23 +35,23 @@ static const int CPUMeter_attributes[] = {
};
typedef struct CPUMeterData_ {
- int cpus;
+ unsigned int cpus;
Meter** meters;
} CPUMeterData;
static void CPUMeter_init(Meter* this) {
- int cpu = this->param;
+ unsigned int cpu = this->param;
if (cpu == 0) {
Meter_setCaption(this, "Avg");
} else if (this->pl->cpuCount > 1) {
char caption[10];
- xSnprintf(caption, sizeof(caption), "%3d", Settings_cpuId(this->pl->settings, cpu - 1));
+ xSnprintf(caption, sizeof(caption), "%3u", Settings_cpuId(this->pl->settings, cpu - 1));
Meter_setCaption(this, caption);
}
}
static void CPUMeter_updateValues(Meter* this) {
- int cpu = this->param;
+ unsigned int cpu = this->param;
if (cpu > this->pl->cpuCount) {
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "absent");
for (uint8_t i = 0; i < this->curItems; i++)
@@ -168,7 +168,7 @@ static void CPUMeter_display(const Object* cast, RichString* out) {
static void AllCPUsMeter_getRange(const Meter* this, int* start, int* count) {
const CPUMeterData* data = this->meterData;
- int cpus = data->cpus;
+ unsigned int cpus = data->cpus;
switch(Meter_name(this)[0]) {
default:
case 'A': // All
@@ -196,7 +196,7 @@ static void AllCPUsMeter_updateValues(Meter* this) {
}
static void CPUMeterCommonInit(Meter* this, int ncol) {
- int cpus = this->pl->cpuCount;
+ unsigned int cpus = this->pl->cpuCount;
CPUMeterData* data = this->meterData;
if (!data) {
data = this->meterData = xMalloc(sizeof(CPUMeterData));

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