Merge branch 'cheri-int-cast-warning-fix' into 'main'

Fixes for integer cast warnings when targeting CHERI

See merge request GNOME/glib!3579
This commit is contained in:
Philip Withnall 2023-09-13 11:19:30 +00:00
commit 1f9aafe5d5
3 changed files with 3 additions and 3 deletions

View File

@ -952,7 +952,7 @@
/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT /* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
*/ */
#define GPOINTER_TO_SIZE(p) ((gsize) (p)) #define GPOINTER_TO_SIZE(p) ((gsize) (p))
#define GSIZE_TO_POINTER(s) ((gpointer) (gsize) (s)) #define GSIZE_TO_POINTER(s) ((gpointer) (guintptr) (gsize) (s))
/* Provide convenience macros for handling structure /* Provide convenience macros for handling structure
* fields through their offsets. * fields through their offsets.

View File

@ -4859,7 +4859,7 @@ g_object_compat_control (gsize what,
{ {
gpointer *pp; gpointer *pp;
case 1: /* floating base type */ case 1: /* floating base type */
return G_TYPE_INITIALLY_UNOWNED; return (gsize) G_TYPE_INITIALLY_UNOWNED;
case 2: /* FIXME: remove this once GLib/Gtk+ break ABI again */ case 2: /* FIXME: remove this once GLib/Gtk+ break ABI again */
floating_flag_handler = (guint(*)(GObject*,gint)) data; floating_flag_handler = (guint(*)(GObject*,gint)) data;
return 1; return 1;

View File

@ -955,7 +955,7 @@ param_spec_pool_hash (gconstpointer key_spec)
{ {
const GParamSpec *key = key_spec; const GParamSpec *key = key_spec;
const gchar *p; const gchar *p;
guint h = key->owner_type; guint h = (guint) key->owner_type;
for (p = key->name; *p; p++) for (p = key->name; *p; p++)
h = (h << 5) - h + *p; h = (h << 5) - h + *p;