-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Marcin Baczyński wrote: > 2010/3/13 Karl Schultz <karl.w.schu...@gmail.com>: >> In some locales, a comma can be used as a decimal place. That is, 5,2 is a >> number between 5 and 6. (I think I have that right) I would guess that the >> shader language, like C, wouldn't allow this form in code. So, it makes >> sense to force the C locale when parsing numbers from shader source code, as >> the code does above. >> >> strtof doesn't show up until C99 and not all compilers support it, including >> the MSFT Windows compilers. Ian says that all usages of this function want >> a float anyway, so we may end up with something like: >> >> float >> _mesa_strtof( const char *s, char **end ) >> { >> #ifdef _GNU_SOURCE >> static locale_t loc = NULL; >> if (!loc) { >> loc = newlocale(LC_CTYPE_MASK, "C", NULL); >> } >> return (float) strtod_l(s, end, loc); >> #else >> return (float) strtod(s, end); >> #endif >> } >> >> And then change all _mesa_strtod to _mesa_strtof. >> >> If Ian doesn't care for the casts here, then I'm fine with silencing >> warnings in the Studio with a compiler option. > > Attached patch uses strtof when it is available.
Applied. Thanks. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkueVj8ACgkQX1gOwKyEAw/aTQCfRrPt+MDFkh2g87pQKShWSpvR m9gAnjcl8jsgxfJJJW9j7zCxxhv3LpN9 =mmpj -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev