mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 05:16:18 +01:00
change the type of ref_count from guint to gint, so we can remove some
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
This commit is contained in:
parent
4356f18a3d
commit
6273407af6
@ -6,6 +6,8 @@
|
|||||||
* glib/gregex.c: use pcre_get_stringnumber() in
|
* glib/gregex.c: use pcre_get_stringnumber() in
|
||||||
get_matched_substring_number() if G_REGEX_DUPNAMES was not set.
|
get_matched_substring_number() if G_REGEX_DUPNAMES was not set.
|
||||||
(#444765, Yevgen Muntyan)
|
(#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>
|
2007-09-05 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ struct _GMatchInfo
|
|||||||
|
|
||||||
struct _GRegex
|
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 */
|
gchar *pattern; /* the pattern */
|
||||||
pcre *pcre_re; /* compiled form of the pattern */
|
pcre *pcre_re; /* compiled form of the pattern */
|
||||||
GRegexCompileFlags compile_opts; /* options used at compile time on the pattern */
|
GRegexCompileFlags compile_opts; /* options used at compile time on the pattern */
|
||||||
@ -802,7 +802,7 @@ GRegex *
|
|||||||
g_regex_ref (GRegex *regex)
|
g_regex_ref (GRegex *regex)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (regex != NULL, NULL);
|
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;
|
return regex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -820,7 +820,7 @@ g_regex_unref (GRegex *regex)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (regex != NULL);
|
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);
|
g_free (regex->pattern);
|
||||||
if (regex->pcre_re != NULL)
|
if (regex->pcre_re != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user