* 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>
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 */
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;
}
{
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)