Index: include/hwloc.h =================================================================== --- include/hwloc.h (revision 1474) +++ include/hwloc.h (working copy) @@ -%ld,%ld +%ld,%ld @@ struct hwloc_obj { /* physical information */ hwloc_obj_type_t type; /**< \brief Type of object */ - signed os_index; /**< \brief OS-provided physical index number */ + unsigned os_index; /**< \brief OS-provided physical index number */ char *name; /**< \brief Object description if any */ /** \brief Object type-specific Attributes */ @@ -%ld,%ld +%ld,%ld @@ signed os_level; /**< \brief OS-provided physical level */ }; +/** + * \brief Convenience typedef; a pointer to a struct hwloc_obj. + */ typedef struct hwloc_obj * hwloc_obj_t; /** \brief Object type-specific Attributes */ Index: include/private/private.h =================================================================== --- include/private/private.h (revision 1474) +++ include/private/private.h (working copy) @@ -%ld,%ld +%ld,%ld @@ hwloc_setup_level(int procid_max, unsigned num, unsigned *osphysids, unsigned *proc_physids, struct hwloc_topology *topology, hwloc_obj_type_t type) { struct hwloc_obj *obj; - int j; + unsigned j; hwloc_debug("%d %s\n", num, hwloc_obj_type_string(type)); Index: include/hwloc/helper.h =================================================================== --- include/hwloc/helper.h (revision 1474) +++ include/hwloc/helper.h (working copy) @@ -%ld,%ld +%ld,%ld @@ hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth, unsigned idx) { - int count = 0; + unsigned count = 0; hwloc_obj_t obj = hwloc_get_obj_by_depth (topology, depth, 0); while (obj) { if (hwloc_cpuset_isincluded(obj->cpuset, set)) { @@ -%ld,%ld +%ld,%ld @@ hwloc_distribute(hwloc_topology_t topology, hwloc_obj_t root, hwloc_cpuset_t *cpuset, int n) { int i; + unsigned u; int chunk_size, complete_chunks; hwloc_cpuset_t *cpusetp; @@ -%ld,%ld +%ld,%ld @@ hwloc_distribute(topology, root->children[i], cpusetp, chunk_size); /* Now allocate not-so-complete chunks. */ - for ( ; - i < root->arity; - i++, cpusetp += chunk_size-1) - hwloc_distribute(topology, root->children[i], cpusetp, chunk_size-1); + for (u = (unsigned) i; + u < root->arity; + u++, cpusetp += chunk_size-1) + hwloc_distribute(topology, root->children[u], cpusetp, chunk_size-1); } /** @} */ Index: src/topology-darwin.c =================================================================== --- src/topology-darwin.c (revision 1474) +++ src/topology-darwin.c (working copy) @@ -%ld,%ld +%ld,%ld @@ hwloc_debug("\n%d cache levels\n", n - 1); for (i = 0; i < n; i++) { - for (j = 0; j < nprocs / cacheconfig[i]; j++) { + for (j = 0; j < (int) (nprocs / cacheconfig[i]); j++) { obj = hwloc_alloc_setup_object(i?HWLOC_OBJ_CACHE:HWLOC_OBJ_NODE, j); obj->cpuset = hwloc_cpuset_alloc(); for (cpu = j*cacheconfig[i]; - cpu < (j+1)*cacheconfig[i]; + cpu < (int) ((j+1)*cacheconfig[i]); cpu++) hwloc_cpuset_set(obj->cpuset, cpu); Index: src/cpuset.c =================================================================== --- src/cpuset.c (revision 1474) +++ src/cpuset.c (working copy) @@ -%ld,%ld +%ld,%ld @@ int hwloc_snprintf(char *str, size_t size, const char *format, ...) { - int ret; + unsigned ret; va_list ap; static char bin; @@ -%ld,%ld +%ld,%ld @@ void hwloc_cpuset_set_range(struct hwloc_cpuset_s * set, unsigned begincpu, unsigned endcpu) { - int i; + unsigned i; HWLOC__CPUSET_CHECK(set); @@ -%ld,%ld +%ld,%ld @@ void hwloc_cpuset_clr_range(struct hwloc_cpuset_s * set, unsigned begincpu, unsigned endcpu) { - int i; + unsigned i; HWLOC__CPUSET_CHECK(set); Index: src/traversal.c =================================================================== --- src/traversal.c (revision 1474) +++ src/traversal.c (working copy) @@ -%ld,%ld +%ld,%ld @@ struct hwloc_obj ***res, int *max) { int gotten = 0; - int i; + unsigned i; /* the caller must ensure this */ assert(*max > 0); @@ -%ld,%ld +%ld,%ld @@ char os_index[12] = ""; if (l->os_index != -1) - snprintf(os_index, 12, "%s%d", indexprefix, l->os_index); + snprintf(os_index, 12, "%s%u", indexprefix, l->os_index); switch (type) { case HWLOC_OBJ_SOCKET: @@ -%ld,%ld +%ld,%ld @@ { hwloc_cpuset_t set = hwloc_cpuset_alloc(); int res; - int i; + unsigned i; hwloc_cpuset_zero(set); for(i=0; iarity) { /* check whether that father has no children for real */ @@ -%ld,%ld +%ld,%ld @@ hwloc_topology_check(struct hwloc_topology *topology) { struct hwloc_obj *obj; - int i,j; hwloc_obj_type_t type; - unsigned depth; + unsigned i, j, depth; /* check type orders */ - for (type = HWLOC_OBJ_SYSTEM; type < HWLOC_OBJ_TYPE_MAX; type++) + for (type = HWLOC_OBJ_SYSTEM; type < HWLOC_OBJ_TYPE_MAX; type++) { assert(hwloc_get_order_type(hwloc_get_type_order(type)) == type); - for (i = hwloc_get_order_type(HWLOC_OBJ_SYSTEM); i <= hwloc_get_order_type(HWLOC_OBJ_CORE); i++) - assert(hwloc_get_type_order(hwloc_get_order_type(i)) == i); + } + for (i = (unsigned) hwloc_get_order_type(HWLOC_OBJ_SYSTEM); + i <= (unsigned) hwloc_get_order_type(HWLOC_OBJ_CORE); i++) { + assert(i == (unsigned) hwloc_get_type_order(hwloc_get_order_type(i))); + } /* check that first level is SYSTEM */ assert(hwloc_get_depth_type(topology, 0) == HWLOC_OBJ_SYSTEM); @@ -%ld,%ld +%ld,%ld @@ /* check type */ assert(hwloc_get_depth_type(topology, i) == obj->type); - assert(hwloc_get_type_depth(topology, obj->type) == i - || hwloc_get_type_depth(topology, obj->type) == HWLOC_TYPE_DEPTH_MULTIPLE); + assert(i = (unsigned) hwloc_get_type_depth(topology, obj->type) || + HWLOC_TYPE_DEPTH_MULTIPLE == hwloc_get_type_depth(topology, obj->type)); /* check last object of the level */ obj = hwloc_get_obj_by_depth(topology, i, width-1); Index: src/topology-synthetic.c =================================================================== --- src/topology-synthetic.c (revision 1474) +++ src/topology-synthetic.c (working copy) @@ -%ld,%ld +%ld,%ld @@ { const char *pos, *next_pos; unsigned long item, count; - int i; + unsigned i; int cache_depth = 0, misc_depth = 0; int nb_machine_levels = 0, nb_node_levels = 0;