Fix #316221, Michal Benes, Stanislav Brabec;

2005-12-27  Matthias Clasen  <mclasen@redhat.com>

        Fix #316221, Michal Benes, Stanislav Brabec;

        * configure.in: Fix a strict aliasing problem in
        g_static_mutex_get_mutex().
        * glib/gthread.h: ...and in
        g_static_mutex_get_mutex_impl_shortcut().
This commit is contained in:
Matthias Clasen 2005-12-27 19:50:02 +00:00 committed by Matthias Clasen
parent 97ffe020cd
commit 1e4efb6554
5 changed files with 23 additions and 2 deletions

View File

@ -1,5 +1,12 @@
2005-12-27 Matthias Clasen <mclasen@redhat.com>
Fix #316221, Michal Benes, Stanislav Brabec;
* configure.in: Fix a strict aliasing problem in
g_static_mutex_get_mutex().
* glib/gthread.h: ...and in
g_static_mutex_get_mutex_impl_shortcut().
* glib/gdatasetprivate.h: Add a cast to silence compiler
warnings. (#321978, Andrew Paprocki)

View File

@ -1,5 +1,12 @@
2005-12-27 Matthias Clasen <mclasen@redhat.com>
Fix #316221, Michal Benes, Stanislav Brabec;
* configure.in: Fix a strict aliasing problem in
g_static_mutex_get_mutex().
* glib/gthread.h: ...and in
g_static_mutex_get_mutex_impl_shortcut().
* glib/gdatasetprivate.h: Add a cast to silence compiler
warnings. (#321978, Andrew Paprocki)

View File

@ -1,5 +1,12 @@
2005-12-27 Matthias Clasen <mclasen@redhat.com>
Fix #316221, Michal Benes, Stanislav Brabec;
* configure.in: Fix a strict aliasing problem in
g_static_mutex_get_mutex().
* glib/gthread.h: ...and in
g_static_mutex_get_mutex_impl_shortcut().
* glib/gdatasetprivate.h: Add a cast to silence compiler
warnings. (#321978, Andrew Paprocki)

View File

@ -2358,7 +2358,7 @@ struct _GStaticMutex
};
#define G_STATIC_MUTEX_INIT { NULL, { { $g_mutex_contents} } }
#define g_static_mutex_get_mutex(mutex) \\
(g_thread_use_default_impl ? ((GMutex*) &((mutex)->static_mutex)) : \\
(g_thread_use_default_impl ? ((GMutex*) &((mutex)->static_mutex.pad)) : \\
g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
_______EOF
else

View File

@ -138,7 +138,7 @@ void g_thread_init_with_errorcheck_mutexes (GThreadFunctions* vtable);
GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
#define g_static_mutex_get_mutex_impl_shortcut(mutex) \
(g_atomic_pointer_get ((gpointer*)mutex) ? *(mutex) : \
(g_atomic_pointer_get (mutex) ? *(mutex) : \
g_static_mutex_get_mutex_impl (mutex))
/* shorthands for conditional and unconditional function calls */