diff options
author | Tor Lillqvist <tml@novell.com> | 2005-12-18 18:35:26 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-12-18 18:35:26 +0800 |
commit | 66102bba0dde1e4ca514421ab40c4f696f8d82d6 (patch) | |
tree | 5fa9e55e98b485b404cdaa72903e01920d501dc6 /widgets/misc | |
parent | 86c90c049e0f4d793c38c6dd239e1bb0b1aeff5f (diff) | |
download | gsoc2013-evolution-66102bba0dde1e4ca514421ab40c4f696f8d82d6.tar.gz gsoc2013-evolution-66102bba0dde1e4ca514421ab40c4f696f8d82d6.tar.zst gsoc2013-evolution-66102bba0dde1e4ca514421ab40c4f696f8d82d6.zip |
Use g_ascii_strcasecmp(). (strcase_hash): Use g_ascii_tolower().
2005-12-18 Tor Lillqvist <tml@novell.com>
* gal-combo-text.c (strcase_equal): Use g_ascii_strcasecmp().
(strcase_hash): Use g_ascii_tolower().
svn path=/trunk/; revision=30868
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/ChangeLog | 3 | ||||
-rw-r--r-- | widgets/misc/gal-combo-text.c | 15 |
2 files changed, 7 insertions, 11 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index c90312575a..a8e285715f 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -12,6 +12,9 @@ * e-map.c: Construct map file name at run-time. + * gal-combo-text.c (strcase_equal): Use g_ascii_strcasecmp(). + (strcase_hash): Use g_ascii_tolower(). + 2005-12-15 Srinivasa Ragavan <sragavan@novell.com> * e-filter-bar.c: (rule_advanced_response), (option_changed), 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 <config.h> #include <ctype.h> +#include <string.h> #include <gtk/gtk.h> @@ -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; } /** |