change the type of ref_count from guint to gint, so we can remove some
authorMarco Barisione <marco@barisione.org>
Mon, 10 Sep 2007 16:27:38 +0000 (16:27 +0000)
committerMarco Barisione <mbari@src.gnome.org>
Mon, 10 Sep 2007 16:27:38 +0000 (16:27 +0000)
2007-09-10  Marco Barisione <marco@barisione.org>

* 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
glib/gregex.c

index 68a42ac..786865d 100644 (file)
--- 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  <behdad@gnome.org>
 
index 1f9b7a0..8b91eb4 100644 (file)
@@ -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*) &regex->ref_count);
+  g_atomic_int_inc (&regex->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 *) &regex->ref_count, -1) - 1 == 0)
+  if (g_atomic_int_exchange_and_add (&regex->ref_count, -1) - 1 == 0)
     {
       g_free (regex->pattern);
       if (regex->pcre_re != NULL)