r15889 - gnucash/trunk/src/gnome-utils - Use g_direct_{hash, equal} in gnc_quickfill_new, drop quickfill_{hash, compare}.
Andreas Köhler
andi5 at cvs.gnucash.org
Sat Apr 14 17:42:41 EDT 2007
Author: andi5
Date: 2007-04-14 17:42:40 -0400 (Sat, 14 Apr 2007)
New Revision: 15889
Trac: http://svn.gnucash.org/trac/changeset/15889
Modified:
gnucash/trunk/src/gnome-utils/QuickFill.c
Log:
Use g_direct_{hash,equal} in gnc_quickfill_new, drop quickfill_{hash,compare}.
Storing pointers in integers is not portable in any way shape or form
(GPOINTER_TO_UINT).
Modified: gnucash/trunk/src/gnome-utils/QuickFill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/QuickFill.c 2007-04-14 18:30:46 UTC (rev 15888)
+++ gnucash/trunk/src/gnome-utils/QuickFill.c 2007-04-14 21:42:40 UTC (rev 15889)
@@ -51,24 +51,6 @@
/********************************************************************\
\********************************************************************/
-static guint
-quickfill_hash (gconstpointer key)
-{
- return GPOINTER_TO_UINT (key);
-}
-
-static gint
-quickfill_compare (gconstpointer key1, gconstpointer key2)
-{
- guint k1 = GPOINTER_TO_UINT (key1);
- guint k2 = GPOINTER_TO_UINT (key2);
-
- return (k1 == k2);
-}
-
-/********************************************************************\
-\********************************************************************/
-
QuickFill *
gnc_quickfill_new (void)
{
@@ -85,7 +67,7 @@
qf->text = NULL;
qf->len = 0;
- qf->matches = g_hash_table_new (quickfill_hash, quickfill_compare);
+ qf->matches = g_hash_table_new (g_direct_hash, g_direct_equal);
return qf;
}
More information about the gnucash-changes
mailing list