mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +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
@@ -1234,7 +1234,7 @@ g_param_spec_pool_list_owned (GParamSpecPool *pool,
|
||||
|
||||
g_mutex_lock (&pool->mutex);
|
||||
data[0] = NULL;
|
||||
data[1] = (gpointer) owner_type;
|
||||
data[1] = GTYPE_TO_POINTER (owner_type);
|
||||
g_hash_table_foreach (pool->hash_table, pool_list, &data);
|
||||
g_mutex_unlock (&pool->mutex);
|
||||
|
||||
@@ -1373,7 +1373,7 @@ g_param_spec_pool_list (GParamSpecPool *pool,
|
||||
d = g_type_depth (owner_type);
|
||||
slists = g_new0 (GSList*, d);
|
||||
data[0] = slists;
|
||||
data[1] = (gpointer) owner_type;
|
||||
data[1] = GTYPE_TO_POINTER (owner_type);
|
||||
data[2] = pool->hash_table;
|
||||
data[3] = &n_pspecs;
|
||||
|
||||
|
Reference in New Issue
Block a user