mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 06:32:10 +01:00
Revert last 4 commits
This reverts commits: 5899c61ed2b4be3f02d0382d6fb0d1fc1bb7bc98 e994d4535270b233c4ed5c62e0055fe20c9ab1c6 eb20dec144765d255928fb3e0df960b09af5904d ebec0dd359eb3a3dc5dbf8ac533a7d89cfc72267 which wer accidentally pushed to master instead of a branch
This commit is contained in:
parent
5899c61ed2
commit
276e927fd4
@ -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
|
||||
|
@ -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))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user