+Mon Nov 26 09:55:12 2001 Tim Janik <timj@gtk.org>
+
+ * gtype.h: typedef GType to gulong instead of gsize, if possible.
+
+ * gtype.c: fixups for GType being sizeof(long) wide (changed
+ UINT casts).
+ * gsignal.c:
+ * gclosure.c:
+ * gparam.c: likewise.
+
Sun Nov 25 22:33:32 2001 Tim Janik <timj@gtk.org>
* gtype.h: removed enum GTypeFundamentals. use macros
{
GTypeClass *class;
gpointer callback;
- /* GType itype = GPOINTER_TO_UINT (closure->data); */
+ /* GType itype = (GType) closure->data; */
guint offset = GPOINTER_TO_UINT (marshal_data);
class = G_TYPE_INSTANCE_GET_CLASS (g_value_peek_pointer (param_values + 0), itype, GTypeClass);
{
GTypeClass *class;
gpointer callback;
- GType itype = GPOINTER_TO_UINT (closure->data);
+ GType itype = (GType) closure->data;
guint offset = GPOINTER_TO_UINT (marshal_data);
class = G_TYPE_INSTANCE_GET_INTERFACE (g_value_peek_pointer (param_values + 0), itype, GTypeClass);
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), GUINT_TO_POINTER (itype));
+ closure = g_closure_new_simple (sizeof (GClosure), (gpointer) itype);
if (G_TYPE_IS_INTERFACE (itype))
g_closure_set_meta_marshal (closure, GUINT_TO_POINTER (struct_offset), g_type_iface_meta_marshal);
else
{
GParamSpec *pspec = value;
gpointer *data = user_data;
- GType owner_type = GPOINTER_TO_UINT (data[1]);
+ GType owner_type = (GType) data[1];
if (owner_type == pspec->owner_type)
data[0] = g_list_prepend (data[0], pspec);
G_SLOCK (&pool->smutex);
data[0] = NULL;
- data[1] = GUINT_TO_POINTER (owner_type);
+ data[1] = (gpointer) owner_type;
g_hash_table_foreach (pool->hash_table, pool_list, &data);
G_SUNLOCK (&pool->smutex);
GParamSpec *pspec = value;
gpointer *data = user_data;
GSList **slists = data[0];
- GType owner_type = GPOINTER_TO_UINT (data[1]);
+ GType owner_type = (GType) data[1];
if (g_type_is_a (owner_type, pspec->owner_type))
{
d = g_type_depth (owner_type);
slists = g_new0 (GSList*, d);
data[0] = slists;
- data[1] = GUINT_TO_POINTER (owner_type);
+ data[1] = (gpointer) owner_type;
g_hash_table_foreach (pool->hash_table, pool_depth_list, &data);
for (i = 0; i < d - 1; i++)
slists[i] = pspec_list_remove_overridden (slists[i], pool->hash_table, owner_type, n_pspecs_p);
{
/* give elaborate warnings */
if (!g_type_name (itype))
- g_warning (G_STRLOC ": unable to lookup signal \"%s\" for invalid type id `%u'",
+ g_warning (G_STRLOC ": unable to lookup signal \"%s\" for invalid type id `%lu'",
name, itype);
else if (!G_TYPE_IS_INSTANTIATABLE (itype))
g_warning (G_STRLOC ": unable to lookup signal \"%s\" for non instantiatable type `%s'",
{
/* give elaborate warnings */
if (!g_type_name (itype))
- g_warning (G_STRLOC ": unable to list signals for invalid type id `%u'",
+ g_warning (G_STRLOC ": unable to list signals for invalid type id `%lu'",
itype);
else if (!G_TYPE_IS_INSTANTIATABLE (itype))
g_warning (G_STRLOC ": unable to list signals of non instantiatable type `%s'",
g_hash_table_insert (static_type_nodes_ht,
GUINT_TO_POINTER (node->qname),
- GUINT_TO_POINTER (type));
+ (gpointer) type);
return node;
}
if ((type_id & TYPE_ID_MASK) ||
type_id > G_TYPE_FUNDAMENTAL_MAX)
{
- g_warning ("attempt to register fundamental type `%s' with invalid type id (%u)",
+ g_warning ("attempt to register fundamental type `%s' with invalid type id (%lu)",
type_name,
type_id);
return 0;
if (quark)
{
G_READ_LOCK (&type_rw_lock);
- type = GPOINTER_TO_UINT (g_hash_table_lookup (static_type_nodes_ht, GUINT_TO_POINTER (quark)));
+ type = (GType) g_hash_table_lookup (static_type_nodes_ht, GUINT_TO_POINTER (quark));
G_READ_UNLOCK (&type_rw_lock);
}
return vtable;
if (!node)
- g_warning (G_STRLOC ": type id `%u' is invalid", type);
+ g_warning (G_STRLOC ": type id `%lu' is invalid", type);
if (!has_refed_data)
g_warning ("can't peek value table for type `%s' which is not currently referenced",
type_descriptive_name_I (type));
/* Typedefs
*/
+#if GLIB_SIZEOF_LONG == GLIB_SIZEOF_SIZE_T
+typedef gulong GType;
+#else /* hm, shouldn't happen? */
typedef gsize GType;
+#endif
typedef struct _GValue GValue;
typedef union _GTypeCValue GTypeCValue;
typedef struct _GTypePlugin GTypePlugin;