add uint* -> int* casts in g_atomic_int calls to avoid gcc warnings
authorDan Winship <danw@src.gnome.org>
Fri, 26 Sep 2008 16:00:33 +0000 (16:00 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 26 Sep 2008 16:00:33 +0000 (16:00 +0000)
* 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

gobject/ChangeLog
gobject/gobject.c
gobject/gparam.c
gobject/gsignal.c

index 9ce06fd..b7f2619 100644 (file)
@@ -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 ===
index 577de2b..a9b16de 100644 (file)
@@ -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)) 
index 3dccff0..029301c 100644 (file)
@@ -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))
     {
index f81251f..1f0d2eb 100644 (file)
@@ -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))
     {