mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
Fix strict aliasing warnings and viiolations to make GLib and
GLib users buildable with gcc 4.4. Patch by Jakub Jelinek. * glib/gatomic.[hc]: Add G_GNUC_MAY_ALIAS to pointer arguments, fix macro versions to only operate on objects of the same size. * glib/gdataset.c: * glib/gthread.[hc]: * glib/gdatasetprivate.h: Remove unnecessary casts in g_atomic_pointer_get calls. svn path=/trunk/; revision=7875
This commit is contained in:
@@ -807,7 +807,7 @@ g_object_freeze_notify (GObject *object)
|
||||
{
|
||||
g_return_if_fail (G_IS_OBJECT (object));
|
||||
|
||||
if (g_atomic_int_get ((int *)&object->ref_count) == 0)
|
||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
||||
return;
|
||||
|
||||
g_object_ref (object);
|
||||
@@ -830,7 +830,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 ((int *)&object->ref_count) == 0)
|
||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
||||
return;
|
||||
|
||||
g_object_ref (object);
|
||||
@@ -875,7 +875,7 @@ g_object_thaw_notify (GObject *object)
|
||||
GObjectNotifyQueue *nqueue;
|
||||
|
||||
g_return_if_fail (G_IS_OBJECT (object));
|
||||
if (g_atomic_int_get ((int *)&object->ref_count) == 0)
|
||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
||||
return;
|
||||
|
||||
g_object_ref (object);
|
||||
@@ -2377,7 +2377,7 @@ 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 ((int *)&object->ref_count);
|
||||
old_ref = g_atomic_int_get (&object->ref_count);
|
||||
if (old_ref > 1)
|
||||
{
|
||||
if (!g_atomic_int_compare_and_exchange ((int *)&object->ref_count, old_ref, old_ref - 1))
|
||||
|
Reference in New Issue
Block a user