summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMarcin Baczyński <marbacz@gmail.com>2010-03-13 14:26:45 +0100
committerIan Romanick <ian.d.romanick@intel.com>2010-03-15 08:38:24 -0700
commit346298c7658f2ec8b105e5e53101637af232724f (patch)
tree986b382e8be6eba02eb2fa213fad1efd1782fa8b /src/mesa/main
parent63af29bfbe265318bcf5be69e420de361b900321 (diff)
Replace _mesa_strtod with _mesa_strtof.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/imports.c12
-rw-r--r--src/mesa/main/imports.h4
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 56e8195810..1ae0853364 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -795,18 +795,20 @@ _mesa_strdup( const char *s )
}
}
-/** Wrapper around strtod() */
-double
-_mesa_strtod( const char *s, char **end )
+/** Wrapper around strtof() */
+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 strtod_l(s, end, loc);
+ return strtof_l(s, end, loc);
+#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
+ return strtof(s, end);
#else
- return strtod(s, end);
+ return (float)strtod(s, end);
#endif
}
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index fb4a00eca7..d28f4ad125 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -575,8 +575,8 @@ _mesa_getenv( const char *var );
extern char *
_mesa_strdup( const char *s );
-extern double
-_mesa_strtod( const char *s, char **end );
+extern float
+_mesa_strtof( const char *s, char **end );
extern unsigned int
_mesa_str_checksum(const char *str);