From 7040de9ee9f1a7e4a6444fa905773f33c7828ba6 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 10 Dec 2001 22:21:50 +0000 Subject: [PATCH] perform an exact match on the two types instead of using 2001-12-10 Sven Neumann * gobject/gvalue.c (g_value_register_transform_func): perform an exact match on the two types instead of using transform_func_lookup(). --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gobject/gvalue.c | 9 ++++++--- 9 files changed, 46 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 006939d..5bdf613 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 006939d..5bdf613 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2001-12-10 Sven Neumann + + * gobject/gvalue.c (g_value_register_transform_func): perform an exact + match on the two types instead of using transform_func_lookup(). + 2001-12-09 Christopher Blizzard * glib/gmessages.h: Add pragma that will prevent warnings when you diff --git a/gobject/gvalue.c b/gobject/gvalue.c index 7fd36f7..c6853d1 100644 --- a/gobject/gvalue.c +++ b/gobject/gvalue.c @@ -274,14 +274,17 @@ g_value_register_transform_func (GType src_type, g_return_if_fail (G_TYPE_HAS_VALUE_TABLE (dest_type)); g_return_if_fail (transform_func != NULL); - if (transform_func_lookup (src_type, dest_type)) + entry.src_type = src_type; + entry.dest_type = dest_type; + + if (g_bsearch_array_lookup (&transform_array, &entry)) g_warning ("reregistering value transformation function (%p) for `%s' to `%s'", transform_func, g_type_name (src_type), g_type_name (dest_type)); - entry.src_type = src_type; - entry.dest_type = dest_type; + entry.func = transform_func; + g_bsearch_array_insert (&transform_array, &entry, TRUE); } -- 2.7.4