[glib] gstrfuncs.c: Fix variable declaration
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gstrfuncs.c: Fix variable declaration
- Date: Sat, 12 Nov 2011 02:39:40 +0000 (UTC)
commit faebf0f6536f85bfc4afd81a69d9d46383031fa6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Sat Nov 12 10:38:31 2011 +0800
gstrfuncs.c: Fix variable declaration
Declare variables at top of block to stop C89 compilers from complaining.
glib/gstrfuncs.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index 8495697..528e660 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -39,9 +39,9 @@
#include <errno.h>
#include <ctype.h> /* For tolower() */
-#ifdef HAVE_XLOCALE_H
-/* Needed on BSD/OS X for e.g. strtod_l */
-#include <xlocale.h>
+#ifdef HAVE_XLOCALE_H
+/* Needed on BSD/OS X for e.g. strtod_l */
+#include <xlocale.h>
#endif
#ifdef G_OS_WIN32
@@ -683,13 +683,6 @@ gdouble
g_ascii_strtod (const gchar *nptr,
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;
gdouble val;
struct lconv *locale_data;
@@ -699,6 +692,14 @@ g_ascii_strtod (const gchar *nptr,
const char *end = NULL; /* Silence gcc */
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;
locale_data = localeconv ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]