mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 09:58:54 +02:00
GType: introduce GTYPE_TO_POINTER/GPOINTER_TO_TYPE
On CHERI-enabled systems we use uintptr_t as the underlying storage for GType and therefore casting to gsize strips the upper bits from a pointer. Fix this by casting via uintptr_t instead and introduce a new set of macros to convert between GType and pointers.
This commit is contained in:
committed by
Philip Withnall
parent
4b111f1650
commit
d0e03f0930
@@ -1175,7 +1175,7 @@ g_signal_type_cclosure_new (GType itype,
|
||||
g_return_val_if_fail (G_TYPE_IS_CLASSED (itype) || G_TYPE_IS_INTERFACE (itype), NULL);
|
||||
g_return_val_if_fail (struct_offset >= sizeof (GTypeClass), NULL);
|
||||
|
||||
closure = g_closure_new_simple (sizeof (GClosure), (gpointer) itype);
|
||||
closure = g_closure_new_simple (sizeof (GClosure), GTYPE_TO_POINTER (itype));
|
||||
if (G_TYPE_IS_INTERFACE (itype))
|
||||
{
|
||||
g_closure_set_meta_marshal (closure, GUINT_TO_POINTER (struct_offset), g_type_iface_meta_marshal);
|
||||
|
Reference in New Issue
Block a user