[hwloc-devel] Strange difference

2013-10-12 Thread Ralph Castain
Yo guys I was doing some work that involved traversing the hwloc topo tree, and encountered the following odd discrepancy. hwloc_topology_get_depth => returns "unsigned" hwloc_get_type_depth => returns "int" Why the difference? Makes it hard sometimes to avoid the "comparison between unsign

Re: [hwloc-devel] Strange difference

2013-10-12 Thread Brice Goglin
Yo Ralph, The reason is that get_type_depth() returns negative numbers for errors (when the type doesn't exist or exists multiple times in the topology). topology_get_depth() never fails, so always returns >=0. And indeed that's annoying when the compiler is picky. Brice Le 12/10/2013 20:37, Ral