mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-21 09:27:51 +02:00
[Changes from josh to sync with his glib stuff -Yosh]
Fri Jun 12 00:39:28 1998 Josh MacDonald <jmacd@icw.EECS.Berkeley.EDU> * glib.h: add new hash and equal functions g_int_*. complement g_direct_hash with g_direct_equal. * grel.c: new file, GRelations implement tuples of N-N mappings. A comment in glib.h briefly describes the interface. * ghash.c: new function, g_hash_table_size * glib.h: new typedefs, gsize, gssize, gtime. * garray.c: new functions implementing a simplified GArray. This GPtrArray is an array of gpointers and has functions to add and remove elements, much like java.lang.Vector. * garray.c: new functions for the single-byte special case of GArray. The functions g_byte_array* operate on arrays of bytes. Internally, a GArray is used. * testglib.c: tests for g_ptr_array, g_byte_array, and g_relation...
This commit is contained in:
committed by
Manish Singh
parent
f62aace5b0
commit
df9a49ec3c
@@ -851,8 +851,25 @@ g_parse_debug_string (const gchar *string,
|
||||
}
|
||||
|
||||
guint
|
||||
g_direct_hash(gconstpointer key)
|
||||
g_direct_hash(gconstpointer v)
|
||||
{
|
||||
return GPOINTER_TO_UINT (key);
|
||||
return GPOINTER_TO_UINT (v);
|
||||
}
|
||||
|
||||
gint
|
||||
g_direct_equal(gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return GPOINTER_TO_UINT (v) == GPOINTER_TO_UINT (v2);
|
||||
}
|
||||
|
||||
gint
|
||||
g_int_equal (gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return *((const gint*) v) == *((const gint*) v2);
|
||||
}
|
||||
|
||||
guint
|
||||
g_int_hash (gconstpointer v)
|
||||
{
|
||||
return *(const gint*) v;
|
||||
}
|
||||
|
Reference in New Issue
Block a user