@@ -58,17 +58,17 @@ static size_t* shuffled_range(const size_t n){
5858 return ret ;
5959}
6060
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 ;
6464 if (a -> depth > b -> depth ) { return 1 ; }
6565 if (a -> depth < b -> depth ) { return -1 ; }
6666 return 0 ;
6767}
6868
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 ;
7272 if (a -> user_index > b -> user_index ) { return 1 ; }
7373 if (a -> user_index < b -> user_index ) { return -1 ; }
7474 return 0 ;
@@ -103,7 +103,7 @@ hwloc_distrib_root_levels(hwloc_topology_t topology,
103103 qsort (levels ,
104104 n_types ,
105105 sizeof (* levels ),
106- ( __compar_fn_t ) hwloc_distrib_level_cmp_depth );
106+ hwloc_distrib_level_cmp_depth );
107107
108108 // Walk from top to bottom and set arity to the maximum arity below root field.
109109 size_t arity ;
@@ -291,7 +291,7 @@ hwloc_distrib_iterator_inc(struct hwloc_distrib_iterator *it){
291291 qsort (levels ,
292292 it -> n_levels ,
293293 sizeof (* levels ),
294- ( __compar_fn_t ) hwloc_distrib_level_cmp_user_index );
294+ hwloc_distrib_level_cmp_user_index );
295295
296296 for (i = it -> n_levels - 1 ; i >=0 ; i -- ){
297297 if (++ levels [i ].coord >= levels [i ].arity )
@@ -322,7 +322,7 @@ hwloc_distrib_iterator_next(hwloc_topology_t topology,
322322 qsort (levels ,
323323 it -> n_levels ,
324324 sizeof (* levels ),
325- ( __compar_fn_t ) hwloc_distrib_level_cmp_depth );
325+ hwloc_distrib_level_cmp_depth );
326326
327327 for (size_t i = 0 ; i < it -> n_levels ; i ++ ){
328328 coord = levels [i ].index [levels [i ].coord ];
0 commit comments