From 66102bba0dde1e4ca514421ab40c4f696f8d82d6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 18 Dec 2005 10:35:26 +0000 Subject: Use g_ascii_strcasecmp(). (strcase_hash): Use g_ascii_tolower(). 2005-12-18 Tor Lillqvist * gal-combo-text.c (strcase_equal): Use g_ascii_strcasecmp(). (strcase_hash): Use g_ascii_tolower(). svn path=/trunk/; revision=30868 --- widgets/misc/gal-combo-text.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'widgets/misc/gal-combo-text.c') diff --git a/widgets/misc/gal-combo-text.c b/widgets/misc/gal-combo-text.c index e9e825d396..ccec4b748d 100644 --- a/widgets/misc/gal-combo-text.c +++ b/widgets/misc/gal-combo-text.c @@ -23,6 +23,7 @@ #include #include +#include #include @@ -88,17 +89,9 @@ E_MAKE_TYPE (gal_combo_text, static gint strcase_equal (gconstpointer v, gconstpointer v2) { - return g_strcasecmp ((const gchar*) v, (const gchar*)v2) == 0; + return g_ascii_strcasecmp ((const gchar*) v, (const gchar*)v2) == 0; } - -/* - * a char* hash function from ASU - * - * This is cut/paste from gutils.c - * We've got to do this, because this widget will soon move out of the - * Gnumeric source and into a separate library. - */ static guint strcase_hash (gconstpointer v) { @@ -107,14 +100,14 @@ strcase_hash (gconstpointer v) guint h = 0, g; for(p = s; *p != '\0'; p += 1) { - h = ( h << 4 ) + tolower (*p); + h = ( h << 4 ) + g_ascii_tolower (*p); if ( ( g = h & 0xf0000000 ) ) { h = h ^ (g >> 24); h = h ^ g; } } - return h /* % M */; + return h; } /** -- cgit v1.2.3