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)
This commit is contained in:
Christian Göttsche 2021-09-02 22:32:50 +02:00 committed by BenBE
parent 284f8c5e0b
commit d0f5b61aa5
2 changed files with 5 additions and 5 deletions

View File

@ -63,9 +63,9 @@ Affinity* Affinity_get(const Process* proc, ProcessList* pl) {
Affinity_add(affinity, i); Affinity_add(affinity, i);
} }
} else { } else {
unsigned int id; int id;
hwloc_bitmap_foreach_begin(id, cpuset); hwloc_bitmap_foreach_begin(id, cpuset)
Affinity_add(affinity, id); Affinity_add(affinity, (unsigned)id);
hwloc_bitmap_foreach_end(); hwloc_bitmap_foreach_end();
} }
} }

View File

@ -425,9 +425,9 @@ Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl) {
Affinity* affinity = Affinity_new(pl); Affinity* affinity = Affinity_new(pl);
#ifdef HAVE_LIBHWLOC #ifdef HAVE_LIBHWLOC
unsigned int i; int i;
hwloc_bitmap_foreach_begin(i, this->workCpuset) hwloc_bitmap_foreach_begin(i, this->workCpuset)
Affinity_add(affinity, i); Affinity_add(affinity, (unsigned)i);
hwloc_bitmap_foreach_end(); hwloc_bitmap_foreach_end();
#else #else
for (int i = 0; i < Vector_size(this->cpuids); i++) { for (int i = 0; i < Vector_size(this->cpuids); i++) {