From: Dan Winship Date: Fri, 26 Sep 2008 16:00:33 +0000 (+0000) Subject: add uint* -> int* casts in g_atomic_int calls to avoid gcc warnings X-Git-Tag: GLIB_2_19_0~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7afe2bb07a5ab089083d4193f4a1b0bc1591f282;p=platform%2Fupstream%2Fglib.git add uint* -> int* casts in g_atomic_int calls to avoid gcc warnings * gobject.c (g_object_ref, g_object_unref) (g_object_freeze_notify, g_object_notify, g_object_thaw_notify): * gparam.c (g_param_spec_ref, g_param_spec_unref): * gsignal.c (handler_ref, handler_unref_R): add uint* -> int* casts in g_atomic_int calls to avoid gcc warnings svn path=/trunk/; revision=7551 --- diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 9ce06fd..b7f2619 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,11 @@ +2008-09-26 Dan Winship + + * gobject.c (g_object_ref, g_object_unref) + (g_object_freeze_notify, g_object_notify, g_object_thaw_notify): + * gparam.c (g_param_spec_ref, g_param_spec_unref): + * gsignal.c (handler_ref, handler_unref_R): add uint* -> int* + casts in g_atomic_int calls to avoid gcc warnings + 2008-09-17 Matthias Clasen * === Released 2.18.1 === diff --git a/gobject/gobject.c b/gobject/gobject.c index 577de2b..a9b16de 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -803,7 +803,7 @@ g_object_freeze_notify (GObject *object) { g_return_if_fail (G_IS_OBJECT (object)); - if (g_atomic_int_get (&object->ref_count) == 0) + if (g_atomic_int_get ((int *)&object->ref_count) == 0) return; g_object_ref (object); @@ -826,7 +826,7 @@ g_object_notify (GObject *object, g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (property_name != NULL); - if (g_atomic_int_get (&object->ref_count) == 0) + if (g_atomic_int_get ((int *)&object->ref_count) == 0) return; g_object_ref (object); @@ -871,7 +871,7 @@ g_object_thaw_notify (GObject *object) GObjectNotifyQueue *nqueue; g_return_if_fail (G_IS_OBJECT (object)); - if (g_atomic_int_get (&object->ref_count) == 0) + if (g_atomic_int_get ((int *)&object->ref_count) == 0) return; g_object_ref (object); @@ -2341,7 +2341,7 @@ g_object_ref (gpointer _object) #endif /* G_ENABLE_DEBUG */ - old_val = g_atomic_int_exchange_and_add (&object->ref_count, 1); + old_val = g_atomic_int_exchange_and_add ((int *)&object->ref_count, 1); if (old_val == 1 && OBJECT_HAS_TOGGLE_REF (object)) toggle_refs_notify (object, FALSE); @@ -2373,10 +2373,10 @@ g_object_unref (gpointer _object) /* here we want to atomically do: if (ref_count>1) { ref_count--; return; } */ retry_atomic_decrement1: - old_ref = g_atomic_int_get (&object->ref_count); + old_ref = g_atomic_int_get ((int *)&object->ref_count); if (old_ref > 1) { - if (!g_atomic_int_compare_and_exchange (&object->ref_count, old_ref, old_ref - 1)) + if (!g_atomic_int_compare_and_exchange ((int *)&object->ref_count, old_ref, old_ref - 1)) goto retry_atomic_decrement1; /* if we went from 2->1 we need to notify toggle refs if any */ @@ -2390,10 +2390,10 @@ g_object_unref (gpointer _object) /* may have been re-referenced meanwhile */ retry_atomic_decrement2: - old_ref = g_atomic_int_get (&object->ref_count); + old_ref = g_atomic_int_get ((int *)&object->ref_count); if (old_ref > 1) { - if (!g_atomic_int_compare_and_exchange (&object->ref_count, old_ref, old_ref - 1)) + if (!g_atomic_int_compare_and_exchange ((int *)&object->ref_count, old_ref, old_ref - 1)) goto retry_atomic_decrement2; /* if we went from 2->1 we need to notify toggle refs if any */ @@ -2409,7 +2409,7 @@ g_object_unref (gpointer _object) g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL); /* decrement the last reference */ - is_zero = g_atomic_int_dec_and_test (&object->ref_count); + is_zero = g_atomic_int_dec_and_test ((int *)&object->ref_count); /* may have been re-referenced meanwhile */ if (G_LIKELY (is_zero)) diff --git a/gobject/gparam.c b/gobject/gparam.c index 3dccff0..029301c 100644 --- a/gobject/gparam.c +++ b/gobject/gparam.c @@ -201,7 +201,7 @@ g_param_spec_ref (GParamSpec *pspec) g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL); g_return_val_if_fail (pspec->ref_count > 0, NULL); - g_atomic_int_inc (&pspec->ref_count); + g_atomic_int_inc ((int *)&pspec->ref_count); return pspec; } @@ -220,7 +220,7 @@ g_param_spec_unref (GParamSpec *pspec) g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (pspec->ref_count > 0); - is_zero = g_atomic_int_dec_and_test (&pspec->ref_count); + is_zero = g_atomic_int_dec_and_test ((int *)&pspec->ref_count); if (G_UNLIKELY (is_zero)) { diff --git a/gobject/gsignal.c b/gobject/gsignal.c index f81251f..1f0d2eb 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -578,7 +578,7 @@ handler_ref (Handler *handler) { g_return_if_fail (handler->ref_count > 0); - g_atomic_int_inc (&handler->ref_count); + g_atomic_int_inc ((int *)&handler->ref_count); } static inline void @@ -590,7 +590,7 @@ handler_unref_R (guint signal_id, g_return_if_fail (handler->ref_count > 0); - is_zero = g_atomic_int_dec_and_test (&handler->ref_count); + is_zero = g_atomic_int_dec_and_test ((int *)&handler->ref_count); if (G_UNLIKELY (is_zero)) {