mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
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
This commit is contained in:
parent
5360907e9e
commit
7afe2bb07a
@ -1,3 +1,11 @@
|
||||
2008-09-26 Dan Winship <danw@gnome.org>
|
||||
|
||||
* 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 <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.18.1 ===
|
||||
|
@ -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))
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user