Brice --

Will you bring this to the v1.2 branch, too?


On Aug 4, 2011, at 3:01 PM, [email protected] wrote:

> Author: bgoglin
> Date: 2011-08-04 15:01:00 EDT (Thu, 04 Aug 2011)
> New Revision: 3586
> URL: https://svn.open-mpi.org/trac/hwloc/changeset/3586
> 
> Log:
> Fix build on Solaris 2.8 by using atof+index instead of strtof.
> Thanks to Andreas Kupries for providing a patch, simplified by me.
> 
> 
> Text files modified: 
>   trunk/src/distances.c |     8 +++++---                                
>   1 files changed, 5 insertions(+), 3 deletions(-)
> 
> Modified: trunk/src/distances.c
> ==============================================================================
> --- trunk/src/distances.c     (original)
> +++ trunk/src/distances.c     2011-08-04 15:01:00 EDT (Thu, 04 Aug 2011)
> @@ -180,9 +180,11 @@
>   } else {
>     /* parse a comma separated list of distances */
>     for(i=0; i<nbobjs*nbobjs; i++) {
> -      distances[i] = strtof(tmp, &next);
> -      tmp = next+1;
> -      if (!*next && i!=nbobjs*nbobjs-1) {
> +      distances[i] = atof(tmp);
> +      next = index(tmp, ',');
> +      if (next) {
> +        tmp = next+1;
> +      } else if (i!=nbobjs*nbobjs-1) {
>       fprintf(stderr, "Ignoring %s distances from environment variable, not 
> enough values (%u out of %u)\n",
>               hwloc_obj_type_string(type), i+1, nbobjs*nbobjs);
>       free(indexes);
> _______________________________________________
> hwloc-svn mailing list
> [email protected]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-svn


-- 
Jeff Squyres
[email protected]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to