@@ -58,17 +58,17 @@ static size_t* shuffled_range(const size_t n){
58
58
return ret ;
59
59
}
60
60
61
- static int hwloc_distrib_level_cmp_depth (void * la , void * lb ){
62
- struct hwloc_distrib_level * a = (struct hwloc_distrib_level * )la ;
63
- struct hwloc_distrib_level * b = (struct hwloc_distrib_level * )lb ;
61
+ static int hwloc_distrib_level_cmp_depth (const void * la , const void * lb ){
62
+ const struct hwloc_distrib_level * a = (struct hwloc_distrib_level * )la ;
63
+ const struct hwloc_distrib_level * b = (struct hwloc_distrib_level * )lb ;
64
64
if (a -> depth > b -> depth ) { return 1 ; }
65
65
if (a -> depth < b -> depth ) { return -1 ; }
66
66
return 0 ;
67
67
}
68
68
69
- static int hwloc_distrib_level_cmp_user_index (void * la , void * lb ){
70
- struct hwloc_distrib_level * a = (struct hwloc_distrib_level * )la ;
71
- struct hwloc_distrib_level * b = (struct hwloc_distrib_level * )lb ;
69
+ static int hwloc_distrib_level_cmp_user_index (const void * la , const void * lb ){
70
+ const struct hwloc_distrib_level * a = (struct hwloc_distrib_level * )la ;
71
+ const struct hwloc_distrib_level * b = (struct hwloc_distrib_level * )lb ;
72
72
if (a -> user_index > b -> user_index ) { return 1 ; }
73
73
if (a -> user_index < b -> user_index ) { return -1 ; }
74
74
return 0 ;
@@ -103,7 +103,7 @@ hwloc_distrib_root_levels(hwloc_topology_t topology,
103
103
qsort (levels ,
104
104
n_types ,
105
105
sizeof (* levels ),
106
- ( __compar_fn_t ) hwloc_distrib_level_cmp_depth );
106
+ hwloc_distrib_level_cmp_depth );
107
107
108
108
// Walk from top to bottom and set arity to the maximum arity below root field.
109
109
size_t arity ;
@@ -291,7 +291,7 @@ hwloc_distrib_iterator_inc(struct hwloc_distrib_iterator *it){
291
291
qsort (levels ,
292
292
it -> n_levels ,
293
293
sizeof (* levels ),
294
- ( __compar_fn_t ) hwloc_distrib_level_cmp_user_index );
294
+ hwloc_distrib_level_cmp_user_index );
295
295
296
296
for (i = it -> n_levels - 1 ; i >=0 ; i -- ){
297
297
if (++ levels [i ].coord >= levels [i ].arity )
@@ -322,7 +322,7 @@ hwloc_distrib_iterator_next(hwloc_topology_t topology,
322
322
qsort (levels ,
323
323
it -> n_levels ,
324
324
sizeof (* levels ),
325
- ( __compar_fn_t ) hwloc_distrib_level_cmp_depth );
325
+ hwloc_distrib_level_cmp_depth );
326
326
327
327
for (size_t i = 0 ; i < it -> n_levels ; i ++ ){
328
328
coord = levels [i ].index [levels [i ].coord ];
0 commit comments