From d0f5b61aa59184825f8b8b60d9a7e169405441a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 2 Sep 2021 22:32:50 +0200 Subject: [PATCH] hwloc: use int in hwloc_bitmap_foreach_begin loop Affinity.c:67:10: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) --- Affinity.c | 6 +++--- AffinityPanel.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Affinity.c b/Affinity.c index 13f5547c..c1e73cc3 100644 --- a/Affinity.c +++ b/Affinity.c @@ -63,9 +63,9 @@ Affinity* Affinity_get(const Process* proc, ProcessList* pl) { Affinity_add(affinity, i); } } else { - unsigned int id; - hwloc_bitmap_foreach_begin(id, cpuset); - Affinity_add(affinity, id); + int id; + hwloc_bitmap_foreach_begin(id, cpuset) + Affinity_add(affinity, (unsigned)id); hwloc_bitmap_foreach_end(); } } diff --git a/AffinityPanel.c b/AffinityPanel.c index dbce5ca0..d50d5542 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -425,9 +425,9 @@ Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl) { Affinity* affinity = Affinity_new(pl); #ifdef HAVE_LIBHWLOC - unsigned int i; + int i; hwloc_bitmap_foreach_begin(i, this->workCpuset) - Affinity_add(affinity, i); + Affinity_add(affinity, (unsigned)i); hwloc_bitmap_foreach_end(); #else for (int i = 0; i < Vector_size(this->cpuids); i++) {