From 6273407af69fa6d035b6dc494fc23bc8a4cd36b2 Mon Sep 17 00:00:00 2001 From: Marco Barisione Date: Mon, 10 Sep 2007 16:27:38 +0000 Subject: [PATCH] change the type of ref_count from guint to gint, so we can remove some 2007-09-10 Marco Barisione * glib/gregex.c: change the type of ref_count from guint to gint, so we can remove some ugly casts. svn path=/trunk/; revision=5746 --- ChangeLog | 2 ++ glib/gregex.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68a42ac..786865d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * glib/gregex.c: use pcre_get_stringnumber() in get_matched_substring_number() if G_REGEX_DUPNAMES was not set. (#444765, Yevgen Muntyan) + * glib/gregex.c: change the type of ref_count from guint to gint, so + we can remove some ugly casts. 2007-09-05 Behdad Esfahbod diff --git a/glib/gregex.c b/glib/gregex.c index 1f9b7a0..8b91eb4 100644 --- a/glib/gregex.c +++ b/glib/gregex.c @@ -92,7 +92,7 @@ struct _GMatchInfo struct _GRegex { - volatile guint ref_count; /* the ref count for the immutable part */ + volatile gint ref_count; /* the ref count for the immutable part */ gchar *pattern; /* the pattern */ pcre *pcre_re; /* compiled form of the pattern */ GRegexCompileFlags compile_opts; /* options used at compile time on the pattern */ @@ -802,7 +802,7 @@ GRegex * g_regex_ref (GRegex *regex) { g_return_val_if_fail (regex != NULL, NULL); - g_atomic_int_inc ((gint*) ®ex->ref_count); + g_atomic_int_inc (®ex->ref_count); return regex; } @@ -820,7 +820,7 @@ g_regex_unref (GRegex *regex) { g_return_if_fail (regex != NULL); - if (g_atomic_int_exchange_and_add ((gint *) ®ex->ref_count, -1) - 1 == 0) + if (g_atomic_int_exchange_and_add (®ex->ref_count, -1) - 1 == 0) { g_free (regex->pattern); if (regex->pcre_re != NULL) -- 2.7.4