gstrfuncs.c: Fix variable declaration

Declare variables at top of block to stop C89 compilers from complaining.
This commit is contained in:
Chun-wei Fan 2011-11-12 10:38:31 +08:00
parent 0f01bef4b4
commit faebf0f653

View File

@ -39,9 +39,9 @@
#include <errno.h> #include <errno.h>
#include <ctype.h> /* For tolower() */ #include <ctype.h> /* For tolower() */
#ifdef HAVE_XLOCALE_H #ifdef HAVE_XLOCALE_H
/* Needed on BSD/OS X for e.g. strtod_l */ /* Needed on BSD/OS X for e.g. strtod_l */
#include <xlocale.h> #include <xlocale.h>
#endif #endif
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
@ -683,13 +683,6 @@ gdouble
g_ascii_strtod (const gchar *nptr, g_ascii_strtod (const gchar *nptr,
gchar **endptr) gchar **endptr)
{ {
g_return_val_if_fail (nptr != NULL, 0);
#ifdef HAVE_STRTOD_L
errno = 0;
return strtod_l (nptr, endptr, get_C_locale ());
#else
gchar *fail_pos; gchar *fail_pos;
gdouble val; gdouble val;
struct lconv *locale_data; struct lconv *locale_data;
@ -699,6 +692,14 @@ g_ascii_strtod (const gchar *nptr,
const char *end = NULL; /* Silence gcc */ const char *end = NULL; /* Silence gcc */
int strtod_errno; int strtod_errno;
g_return_val_if_fail (nptr != NULL, 0);
#ifdef HAVE_STRTOD_L
errno = 0;
return strtod_l (nptr, endptr, get_C_locale ());
#else
fail_pos = NULL; fail_pos = NULL;
locale_data = localeconv (); locale_data = localeconv ();