[glib] Revert last 4 commits
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Revert last 4 commits
- Date: Mon, 25 Nov 2019 23:54:36 +0000 (UTC)
commit 276e927fd476dadb7cdd5e34dc6be6182a6f9b09
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 26 00:52:03 2019 +0100
Revert last 4 commits
This reverts commits:
5899c61ed2b4be3f02d0382d6fb0d1fc1bb7bc98
e994d4535270b233c4ed5c62e0055fe20c9ab1c6
eb20dec144765d255928fb3e0df960b09af5904d
ebec0dd359eb3a3dc5dbf8ac533a7d89cfc72267
which wer accidentally pushed to master instead of a branch
docs/reference/gobject/gobject-sections.txt | 1 -
gobject/gclosure.c | 16 ++--------
gobject/gtype.c | 47 +----------------------------
gobject/gtype.h | 3 --
gobject/gvalue.c | 13 ++------
gobject/tests/type.c | 1 -
6 files changed, 6 insertions(+), 75 deletions(-)
---
diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index 81db1b576..bed38e4c5 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -65,7 +65,6 @@ g_type_default_interface_unref
g_type_children
g_type_interfaces
g_type_interface_prerequisites
-g_type_interface_instantiable_prerequisite
g_type_set_qdata
g_type_get_qdata
g_type_query
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index 601dab1fd..472f037e2 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -1258,12 +1258,8 @@ static void
value_from_ffi_type (GValue *gvalue, gpointer *value)
{
ffi_arg *int_val = (ffi_arg*) value;
- GType type;
- type = G_VALUE_TYPE (gvalue);
-
-restart:
- switch (g_type_fundamental (type))
+ switch (g_type_fundamental (G_VALUE_TYPE (gvalue)))
{
case G_TYPE_INT:
g_value_set_int (gvalue, (gint) *int_val);
@@ -1322,15 +1318,9 @@ restart:
case G_TYPE_VARIANT:
g_value_take_variant (gvalue, *(gpointer*)value);
break;
- case G_TYPE_INTERFACE:
- type = g_type_interface_instantiable_prerequisite (G_VALUE_TYPE (gvalue));
- if (type)
- goto restart;
- G_GNUC_FALLTHROUGH;
default:
- g_warning ("value_from_ffi_type: Unsupported fundamental type %s for type %s",
- g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue))),
- g_type_name (G_VALUE_TYPE (gvalue)));
+ g_warning ("value_from_ffi_type: Unsupported fundamental type: %s",
+ g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue))));
}
}
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 94b3667bc..b5ef2d11e 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -1689,51 +1689,6 @@ g_type_interface_prerequisites (GType interface_type,
}
}
-/**
- * g_type_interface_instantiable_prerequisite:
- * @interface_type: an interface type
- *
- * Returns the instantiable prerequisite of an interface type.
- *
- * If the interface type has no instantiable prerequisite, 0 is returned.
- *
- * Since: 2.64
- *
- * Returns: the instantiable prerequisite type or 0 if none
- **/
-GType
-g_type_interface_instantiable_prerequisite (GType interface_type)
-{
- TypeNode *inode = NULL;
- TypeNode *iface;
- guint i;
-
- g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface_type), G_TYPE_INVALID);
-
- iface = lookup_type_node_I (interface_type);
- if (iface == NULL)
- return 0;
-
- G_READ_LOCK (&type_rw_lock);
-
- for (i = 0; i < IFACE_NODE_N_PREREQUISITES (iface); i++)
- {
- GType prerequisite = IFACE_NODE_PREREQUISITES (iface)[i];
- TypeNode *node = lookup_type_node_I (prerequisite);
- if (node->is_instantiatable)
- {
- if (!inode || type_node_is_a_L (node, inode))
- inode = node;
- }
- }
-
- G_READ_UNLOCK (&type_rw_lock);
-
- if (inode)
- return NODE_TYPE (inode);
- else
- return 0;
-}
static IFaceHolder*
type_iface_peek_holder_L (TypeNode *iface,
@@ -3452,7 +3407,7 @@ g_type_depth (GType type)
* @root_type: immediate parent of the returned type
*
* Given a @leaf_type and a @root_type which is contained in its
- * ancestry, return the type that @root_type is the immediate parent
+ * anchestry, return the type that @root_type is the immediate parent
* of. In other words, this function determines the type that is
* derived directly from @root_type which is also a base class of
* @leaf_type. Given a root type and a leaf type, this function can
diff --git a/gobject/gtype.h b/gobject/gtype.h
index b092f7f2b..797ab48ee 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -1304,9 +1304,6 @@ void g_type_interface_add_prerequisite (GType interface_type,
GLIB_AVAILABLE_IN_ALL
GType*g_type_interface_prerequisites (GType interface_type,
guint *n_prerequisites);
-GLIB_AVAILABLE_IN_2_64
-GType g_type_interface_instantiable_prerequisite
- (GType interface_type);
GLIB_DEPRECATED_IN_2_58
void g_type_class_add_private (gpointer g_class,
gsize private_size);
diff --git a/gobject/gvalue.c b/gobject/gvalue.c
index df7b4ee11..c30501a6b 100644
--- a/gobject/gvalue.c
+++ b/gobject/gvalue.c
@@ -448,15 +448,6 @@ g_value_init_from_instance (GValue *value,
}
}
-static GType
-tranform_lookup_get_parent_type (GType type)
-{
- if (g_type_fundamental (type) == G_TYPE_INTERFACE)
- return g_type_interface_instantiable_prerequisite (type);
-
- return g_type_parent (type);
-}
-
static GValueTransform
transform_func_lookup (GType src_type,
GType dest_type)
@@ -479,11 +470,11 @@ transform_func_lookup (GType src_type,
g_type_value_table_peek (entry.src_type) == g_type_value_table_peek (src_type))
return e->func;
}
- entry.dest_type = tranform_lookup_get_parent_type (entry.dest_type);
+ entry.dest_type = g_type_parent (entry.dest_type);
}
while (entry.dest_type);
- entry.src_type = tranform_lookup_get_parent_type (entry.src_type);
+ entry.src_type = g_type_parent (entry.src_type);
}
while (entry.src_type);
diff --git a/gobject/tests/type.c b/gobject/tests/type.c
index 9ed1806e9..c5db7e992 100644
--- a/gobject/tests/type.c
+++ b/gobject/tests/type.c
@@ -52,7 +52,6 @@ test_interface_prerequisite (void)
g_assert_cmpint (n_prereqs, ==, 2);
g_assert (prereqs[0] == bar_get_type ());
g_assert (prereqs[1] == G_TYPE_OBJECT);
- g_assert (g_type_interface_instantiable_prerequisite (foo_get_type ()) == G_TYPE_OBJECT);
iface = g_type_default_interface_ref (foo_get_type ());
parent = g_type_interface_peek_parent (iface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]