From 8168836cd2bad582d63d7d693634b08c03204a4b Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Mon, 15 Feb 1999 08:26:00 +0000 Subject: [PATCH] Changed signature of all g_static_mutex_* functions to take a pointer 1999-02-15 Sebastian Wilhelmi * glib.h, glibconfig.h.win32, configure.in: Changed signature of all g_static_mutex_* functions to take a pointer rather than the struct itself. This is not an issue at the moment, because those funcs are really macros, but is it un'G'ish and might fall on our feet in the future. * gthread/testgthread.c (test_mutexes): Use new signature of g_static_mutex* functions. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ configure.in | 6 +++--- glib.h | 12 ++++++------ glib/glib.h | 12 ++++++------ glibconfig.h.win32 | 4 ++-- gthread/ChangeLog | 5 +++++ gthread/testgthread.c | 4 ++-- 14 files changed, 88 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb0b04b..de18db5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index bb0b04b..de18db5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +1999-02-15 Sebastian Wilhelmi + + * glib.h, glibconfig.h.win32, configure.in: Changed signature of + all g_static_mutex_* functions to take a pointer rather than the + struct itself. This is not an issue at the moment, because those + funcs are really macros, but is it un'G'ish and might fall on our + feet in the future. + Mon Feb 15 07:45:54 1999 Tim Janik * configure.in (--enable-debug): default to yes for development trees. diff --git a/configure.in b/configure.in index 428fb77..53ea07c 100644 --- a/configure.in +++ b/configure.in @@ -995,8 +995,8 @@ 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).aligned_pad_u) : \ - g_static_mutex_get_mutex_impl (&(mutex).runtime_mutex)) + (g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \ + g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex))) _______EOF else cat >>$outfile <<_______EOF @@ -1004,7 +1004,7 @@ $g_enable_threads_def G_THREADS_ENABLED #define G_THREADS_IMPL_$g_threads_impl_def typedef struct _GMutex* GStaticMutex; #define G_STATIC_MUTEX_INIT NULL -#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (&(mutex))) +#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (mutex)) _______EOF fi diff --git a/glib.h b/glib.h index 1f917b7..78ea3e6 100644 --- a/glib.h +++ b/glib.h @@ -2741,25 +2741,25 @@ extern void glib_dummy_decl (void); "file %s: line %d (%s): locking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - g_static_mutex_lock (G_LOCK_NAME (name)); \ + g_static_mutex_lock (&G_LOCK_NAME (name)); \ }G_STMT_END # define G_UNLOCK(name) G_STMT_START{ \ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "file %s: line %d (%s): unlocking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - g_static_mutex_unlock (G_LOCK_NAME (name)); \ + g_static_mutex_unlock (&G_LOCK_NAME (name)); \ }G_STMT_END # define G_TRYLOCK(name) G_STMT_START{ \ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "file %s: line %d (%s): try locking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - }G_STMT_END, g_static_mutex_trylock (G_LOCK_NAME (name)) + }G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name)) # else /* !G_DEBUG_LOCKS */ -# define G_LOCK(name) g_static_mutex_lock (G_LOCK_NAME (name)) -# define G_UNLOCK(name) g_static_mutex_unlock (G_LOCK_NAME (name)) -# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name)) +# define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name)) +# define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name)) +# define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name)) # endif /* !G_DEBUG_LOCKS */ #else /* !G_THREADS_ENABLED */ # define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void) diff --git a/glib/glib.h b/glib/glib.h index 1f917b7..78ea3e6 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -2741,25 +2741,25 @@ extern void glib_dummy_decl (void); "file %s: line %d (%s): locking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - g_static_mutex_lock (G_LOCK_NAME (name)); \ + g_static_mutex_lock (&G_LOCK_NAME (name)); \ }G_STMT_END # define G_UNLOCK(name) G_STMT_START{ \ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "file %s: line %d (%s): unlocking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - g_static_mutex_unlock (G_LOCK_NAME (name)); \ + g_static_mutex_unlock (&G_LOCK_NAME (name)); \ }G_STMT_END # define G_TRYLOCK(name) G_STMT_START{ \ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ "file %s: line %d (%s): try locking: %s ", \ __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \ #name); \ - }G_STMT_END, g_static_mutex_trylock (G_LOCK_NAME (name)) + }G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name)) # else /* !G_DEBUG_LOCKS */ -# define G_LOCK(name) g_static_mutex_lock (G_LOCK_NAME (name)) -# define G_UNLOCK(name) g_static_mutex_unlock (G_LOCK_NAME (name)) -# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name)) +# define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name)) +# define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name)) +# define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name)) # endif /* !G_DEBUG_LOCKS */ #else /* !G_THREADS_ENABLED */ # define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void) diff --git a/glibconfig.h.win32 b/glibconfig.h.win32 index 05ff5f0..83ea125 100644 --- a/glibconfig.h.win32 +++ b/glibconfig.h.win32 @@ -120,8 +120,8 @@ struct _GStaticMutex /* This should be NULL followed by the bytes in PTHREAD_MUTEX_INITIALIZER */ #define G_STATIC_MUTEX_INIT { NULL, { { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } #define g_static_mutex_get_mutex(mutex) \ - (g_thread_use_default_impl ? ((GMutex*) &(mutex).aligned_pad_u) : \ - g_static_mutex_get_mutex_impl (&(mutex).runtime_mutex)) + (g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \ + g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex))) #define G_BYTE_ORDER G_LITTLE_ENDIAN diff --git a/gthread/ChangeLog b/gthread/ChangeLog index 4144266..953ed86 100644 --- a/gthread/ChangeLog +++ b/gthread/ChangeLog @@ -1,3 +1,8 @@ +1999-02-15 Sebastian Wilhelmi + + * testgthread.c (test_mutexes): Use new signature of + g_static_mutex* functions. + 1999-02-08 Sebastian Wilhelmi * gthread-posix.c (g_private_get_posix_impl): Use the diff --git a/gthread/testgthread.c b/gthread/testgthread.c index 493a47e..72874cc 100644 --- a/gthread/testgthread.c +++ b/gthread/testgthread.c @@ -26,8 +26,8 @@ test_mutexes (void) g_mutex_lock (mutex); g_mutex_unlock (mutex); - g_static_mutex_lock (static_mutex); - g_static_mutex_unlock (static_mutex); + g_static_mutex_lock (&static_mutex); + g_static_mutex_unlock (&static_mutex); g_cond_signal (cond); g_cond_broadcast (cond); -- 2.7.4