Merge branch 'atomic-uintptr' into 'main'

gatomic: Use g(u)intptr where appropriate

See merge request GNOME/glib!3143
This commit is contained in:
Philip Withnall
2023-10-24 10:49:30 +00:00
7 changed files with 122 additions and 106 deletions

View File

@@ -3375,7 +3375,7 @@ object_floating_flag_handler (GObject *object,
oldvalue = g_atomic_pointer_get (&object->qdata);
while (!g_atomic_pointer_compare_and_exchange_full (
(void**) &object->qdata, oldvalue,
(void *) ((gsize) oldvalue | OBJECT_FLOATING_FLAG),
(void *) ((guintptr) oldvalue | OBJECT_FLOATING_FLAG),
&oldvalue))
;
return (gsize) oldvalue & OBJECT_FLOATING_FLAG;
@@ -3383,7 +3383,7 @@ object_floating_flag_handler (GObject *object,
oldvalue = g_atomic_pointer_get (&object->qdata);
while (!g_atomic_pointer_compare_and_exchange_full (
(void**) &object->qdata, oldvalue,
(void *) ((gsize) oldvalue & ~(gsize) OBJECT_FLOATING_FLAG),
(void *) ((guintptr) oldvalue & ~(gsize) OBJECT_FLOATING_FLAG),
&oldvalue))
;
return (gsize) oldvalue & OBJECT_FLOATING_FLAG;

View File

@@ -255,7 +255,7 @@ g_param_spec_unref (GParamSpec *pspec)
void
g_param_spec_sink (GParamSpec *pspec)
{
gsize oldvalue;
guintptr oldvalue;
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
oldvalue = g_atomic_pointer_and (&pspec->qdata, ~(gsize)PARAM_FLOATING_FLAG);
@@ -275,7 +275,7 @@ g_param_spec_sink (GParamSpec *pspec)
GParamSpec*
g_param_spec_ref_sink (GParamSpec *pspec)
{
gsize oldvalue;
guintptr oldvalue;
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
oldvalue = g_atomic_pointer_and (&pspec->qdata, ~(gsize)PARAM_FLOATING_FLAG);