From 92ea153ae9b9d744ef34041cac9e69bec42856bc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 17 Nov 2005 13:17:22 +0000 Subject: [PATCH] const correctness fixes, found by Arjan van de Ven and gcc. 2005-11-17 Matthias Clasen * glib/gbacktrace.c: * glib/gdate.c: * glib/gthread.c: const correctness fixes, found by Arjan van de Ven and gcc. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ glib/gbacktrace.c | 6 +++--- glib/gdate.c | 2 +- glib/gthread.c | 6 +++--- gobject/ChangeLog | 5 +++++ gobject/glib-genmarshal.c | 2 +- 8 files changed, 34 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6da35d61a..c6e93d600 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-11-17 Matthias Clasen + + * glib/gbacktrace.c: + * glib/gdate.c: + * glib/gthread.c: const correctness fixes, found + by Arjan van de Ven and gcc. + 2005-11-16 Behdad Esfahbod * docs/reference/glib/tmpl/unicode.sgml: Correct typo on mentioning diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6da35d61a..c6e93d600 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2005-11-17 Matthias Clasen + + * glib/gbacktrace.c: + * glib/gdate.c: + * glib/gthread.c: const correctness fixes, found + by Arjan van de Ven and gcc. + 2005-11-16 Behdad Esfahbod * docs/reference/glib/tmpl/unicode.sgml: Correct typo on mentioning diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 6da35d61a..c6e93d600 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +2005-11-17 Matthias Clasen + + * glib/gbacktrace.c: + * glib/gdate.c: + * glib/gthread.c: const correctness fixes, found + by Arjan van de Ven and gcc. + 2005-11-16 Behdad Esfahbod * docs/reference/glib/tmpl/unicode.sgml: Correct typo on mentioning diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index 76bb5aa56..5597b12c6 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -92,9 +92,9 @@ void g_on_error_query (const gchar *prg_name) { #ifndef G_OS_WIN32 - static const gchar *query1 = "[E]xit, [H]alt"; - static const gchar *query2 = ", show [S]tack trace"; - static const gchar *query3 = " or [P]roceed"; + static const gchar * const query1 = "[E]xit, [H]alt"; + static const gchar * const query2 = ", show [S]tack trace"; + static const gchar * const query3 = " or [P]roceed"; gchar buf[16]; if (!prg_name) diff --git a/glib/gdate.c b/glib/gdate.c index 85c6171b9..3e9db33d8 100644 --- a/glib/gdate.c +++ b/glib/gdate.c @@ -473,7 +473,7 @@ static GDateDMY dmy_order[3] = * are counted as in the year 1900. */ -static GDateYear twodigit_start_year = 1930; +static const GDateYear twodigit_start_year = 1930; /* It is impossible to enter a year between 1 AD and 99 AD with this * in effect. diff --git a/glib/gthread.c b/glib/gthread.c index d39faa2c0..ee2dcbc91 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -201,7 +201,7 @@ g_once_impl (GOnce *once, void g_static_mutex_init (GStaticMutex *mutex) { - static GStaticMutex init_mutex = G_STATIC_MUTEX_INIT; + static const GStaticMutex init_mutex = G_STATIC_MUTEX_INIT; g_return_if_fail (mutex); @@ -255,7 +255,7 @@ g_static_mutex_free (GStaticMutex* mutex) void g_static_rec_mutex_init (GStaticRecMutex *mutex) { - static GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT; + static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT; g_return_if_fail (mutex); @@ -723,7 +723,7 @@ g_thread_self (void) void g_static_rw_lock_init (GStaticRWLock* lock) { - static GStaticRWLock init_lock = G_STATIC_RW_LOCK_INIT; + static const GStaticRWLock init_lock = G_STATIC_RW_LOCK_INIT; g_return_if_fail (lock); diff --git a/gobject/ChangeLog b/gobject/ChangeLog index a35641a81..fb3932cc4 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,8 @@ +2005-11-17 Matthias Clasen + + * glib-genmarshal.c: const correctness fixes, found + by Arjan van de Ven and gcc. + Tue Nov 1 17:07:43 2005 Tim Janik * gsignal.c: allocate signal handlers and handler match structures diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c index 1c4a4b0c4..1403fb8b7 100644 --- a/gobject/glib-genmarshal.c +++ b/gobject/glib-genmarshal.c @@ -115,7 +115,7 @@ static GScannerConfig scanner_config_template = FALSE /* symbol_2_token */, FALSE /* scope_0_fallback */, }; -static gchar *std_marshaller_prefix = "g_cclosure_marshal"; +static gchar * const std_marshaller_prefix = "g_cclosure_marshal"; static gchar *marshaller_prefix = "g_cclosure_user_marshal"; static GHashTable *marshallers = NULL; static gboolean gen_cheader = FALSE;