glib r7551 - trunk/gobject
- From: danw svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7551 - trunk/gobject
- Date: Fri, 26 Sep 2008 16:00:34 +0000 (UTC)
Author: danw
Date: Fri Sep 26 16:00:33 2008
New Revision: 7551
URL: http://svn.gnome.org/viewvc/glib?rev=7551&view=rev
Log:
* 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
Modified:
trunk/gobject/ChangeLog
trunk/gobject/gobject.c
trunk/gobject/gparam.c
trunk/gobject/gsignal.c
Modified: trunk/gobject/gobject.c
==============================================================================
--- trunk/gobject/gobject.c (original)
+++ trunk/gobject/gobject.c Fri Sep 26 16:00:33 2008
@@ -803,7 +803,7 @@
{
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_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 @@
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 @@
#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 @@
/* 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 @@
/* 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_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))
Modified: trunk/gobject/gparam.c
==============================================================================
--- trunk/gobject/gparam.c (original)
+++ trunk/gobject/gparam.c Fri Sep 26 16:00:33 2008
@@ -201,7 +201,7 @@
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_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))
{
Modified: trunk/gobject/gsignal.c
==============================================================================
--- trunk/gobject/gsignal.c (original)
+++ trunk/gobject/gsignal.c Fri Sep 26 16:00:33 2008
@@ -578,7 +578,7 @@
{
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 @@
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))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]