+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 ===
{
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);
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);
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);
#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);
/* 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 */
/* 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 */
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))
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;
}
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))
{