From a11d01568c5e7bc5570fd48fa0703d837c4bcd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 17 Feb 2021 17:38:35 +0100 Subject: Use unsigned types for CPU counts and associated variables --- AffinityPanel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'AffinityPanel.c') diff --git a/AffinityPanel.c b/AffinityPanel.c index 57211050..25169994 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -382,8 +382,8 @@ Panel* AffinityPanel_new(ProcessList* pl, const Affinity* affinity, int* width) Panel_setHeader(super, "Use CPUs:"); - int curCpu = 0; - for (int i = 0; i < pl->cpuCount; i++) { + unsigned int curCpu = 0; + for (unsigned int i = 0; i < pl->cpuCount; i++) { char number[16]; xSnprintf(number, 9, "CPU %d", Settings_cpuId(pl->settings, i)); unsigned cpu_width = 4 + strlen(number); @@ -422,12 +422,12 @@ Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl) { Affinity* affinity = Affinity_new(pl); #ifdef HAVE_LIBHWLOC - int i; + unsigned int i; hwloc_bitmap_foreach_begin(i, this->workCpuset) Affinity_add(affinity, i); hwloc_bitmap_foreach_end(); #else - for (int i = 0; i < this->pl->cpuCount; i++) { + for (unsigned int i = 0; i < this->pl->cpuCount; i++) { const MaskItem* item = (const MaskItem*)Vector_get(this->cpuids, i); if (item->value) { Affinity_add(affinity, item->cpu); -- cgit v1.2.3