diff options
author | Miguel de Icaza <miguel@gnome.org> | 2006-10-22 02:38:42 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2006-10-22 02:38:42 +0400 |
commit | a941c11b2dcd88359cf8f1a50c8b312cb427772f (patch) | |
tree | c852956ce8c0943efb5b5cc80d74e122b6591dd7 /eglib | |
parent | 15cd89ac5d4c5bc1b66dae606b1dfa7df6d67a04 (diff) |
2006-10-21 Miguel de Icaza <miguel@novell.com>
* src/gstr.c (g_ascii_xdigit_value): Make this into a function,
thanks to Paolo for pointing the problem with the double macro
expansion.
svn path=/trunk/mono/; revision=66863
Diffstat (limited to 'eglib')
-rw-r--r-- | eglib/ChangeLog | 4 | ||||
-rw-r--r-- | eglib/src/glib.h | 18 | ||||
-rw-r--r-- | eglib/src/gstr.c | 10 |
3 files changed, 21 insertions, 11 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog index c417abd8490..daa0831c054 100644 --- a/eglib/ChangeLog +++ b/eglib/ChangeLog @@ -1,5 +1,9 @@ 2006-10-21 Miguel de Icaza <miguel@novell.com> + * src/gstr.c (g_ascii_xdigit_value): Make this into a function, + thanks to Paolo for pointing the problem with the double macro + expansion. + * src/gmodule.c (g_module_open): Actually return NULL if we fail to load the module (was hiding the real bug in the pinvoke tests). diff --git a/eglib/src/glib.h b/eglib/src/glib.h index 6bfbf84dcef..28c345ed423 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -214,16 +214,13 @@ gint g_snprintf (gchar *string, gulong n, gchar const *format, .. gsize g_strlcpy (gchar *dest, const gchar *src, gsize dest_size); #endif -gchar *g_ascii_strdown (const gchar *str, gssize len); -gint g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n); -#define g_ascii_isspace(c) (isspace (c) != 0) -#define g_ascii_isalpha(c) (isalpha (c) != 0) -#define g_ascii_isprint(c) (isprint (c) != 0) -#define g_ascii_isxdigit(c) (isxdigit (c) != 0) -#define g_ascii_xdigit_value(c) ((isxdigit (c) == 0) ? -1 : \ - ((c >= '0' && c <= '9') ? (c - '0') : \ - ((c >= 'a' && c <= 'f') ? (c - 'a' + 10) : \ - (c - 'A' + 10)))) +gchar *g_ascii_strdown (const gchar *str, gssize len); +gint g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n); +gint g_ascii_xdigit_value (gchar c); +#define g_ascii_isspace(c) (isspace (c) != 0) +#define g_ascii_isalpha(c) (isalpha (c) != 0) +#define g_ascii_isprint(c) (isprint (c) != 0) +#define g_ascii_isxdigit(c) (isxdigit (c) != 0) /* FIXME: g_strcasecmp supports utf8 unicode stuff */ #define g_strcasecmp strcasecmp @@ -300,7 +297,6 @@ GSList *g_slist_insert_before (GSList *list, gpointer data); GSList *g_slist_sort (GSList *list, GCompareFunc func); - #define g_slist_next(slist) ((slist) ? (((GSList *) (slist))->next) : NULL) typedef struct _GList GList; diff --git a/eglib/src/gstr.c b/eglib/src/gstr.c index 976c3967d67..de4f67ab52a 100644 --- a/eglib/src/gstr.c +++ b/eglib/src/gstr.c @@ -692,3 +692,13 @@ g_strdup (const gchar *str) return strdup (str); } +gint +g_ascii_xdigit_value (gchar c) +{ + return ((isxdigit (c) == 0) ? -1 : + ((c >= '0' && c <= '9') ? (c - '0') : + ((c >= 'a' && c <= 'f') ? (c - 'a' + 10) : + (c - 'A' + 10)))); +} + + |