mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 10:50:05 +02:00
gobject: Fix several int/unsigned conversions with atomics
Unfortunately the signatures of our atomic functions alternate between using signed and unsigned integers across different functions, so we can’t just use one type as input. Add some explicit casts to fix harmless `-Wsign-conversion` warnings. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
parent
efed9028fa
commit
636bbd1d63
@ -1657,21 +1657,21 @@ g_object_interface_list_properties (gpointer g_iface,
|
||||
static inline guint
|
||||
object_get_optional_flags (GObject *object)
|
||||
{
|
||||
return g_atomic_int_get (object_get_optional_flags_p (object));
|
||||
return (guint) g_atomic_int_get ((gint *) object_get_optional_flags_p (object));
|
||||
}
|
||||
|
||||
static inline void
|
||||
object_set_optional_flags (GObject *object,
|
||||
guint flags)
|
||||
{
|
||||
g_atomic_int_or (object_get_optional_flags_p (object), flags);
|
||||
g_atomic_int_or ((gint *) object_get_optional_flags_p (object), (int) flags);
|
||||
}
|
||||
|
||||
static inline void
|
||||
object_unset_optional_flags (GObject *object,
|
||||
guint flags)
|
||||
{
|
||||
g_atomic_int_and (object_get_optional_flags_p (object), ~flags);
|
||||
g_atomic_int_and ((gint *) object_get_optional_flags_p (object), (int) ~flags);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -3853,9 +3853,9 @@ signal_emit_unlocked_R (SignalNode *node,
|
||||
|
||||
if (!(old_flags & G_HOOK_FLAG_IN_CALL))
|
||||
{
|
||||
g_atomic_int_compare_and_exchange (&hook->flags,
|
||||
old_flags | G_HOOK_FLAG_IN_CALL,
|
||||
old_flags);
|
||||
g_atomic_int_compare_and_exchange ((gint *) &hook->flags,
|
||||
(gint) old_flags | G_HOOK_FLAG_IN_CALL,
|
||||
(gint) old_flags);
|
||||
}
|
||||
|
||||
hook_returns[i] = !!need_destroy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user