SOURCES: kazehakase-g_regex_free.patch (NEW) - use g_regex_unref()...

megabajt megabajt at pld-linux.org
Mon Aug 27 12:11:00 CEST 2007


Author: megabajt                     Date: Mon Aug 27 10:11:00 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use g_regex_unref() which replaces g_regex_free()

---- Files affected:
SOURCES:
   kazehakase-g_regex_free.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/kazehakase-g_regex_free.patch
diff -u /dev/null SOURCES/kazehakase-g_regex_free.patch:1.1
--- /dev/null	Mon Aug 27 12:11:00 2007
+++ SOURCES/kazehakase-g_regex_free.patch	Mon Aug 27 12:10:55 2007
@@ -0,0 +1,142 @@
+--- kazehakase-0.4.7/src/actions/kz-actions.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/actions/kz-actions.c	2007-06-05 14:29:14.000000000 +0900
+@@ -336,7 +336,7 @@
+ 	}
+ 
+ 	g_match_info_free(match_info);
+-	g_regex_free(regex);
++	g_regex_unref(regex);
+ 	g_free(text);
+ }
+ 
+--- kazehakase-0.4.7/src/actions/kz-history-action.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/actions/kz-history-action.c	2007-06-05 14:29:14.000000000 +0900
+@@ -127,7 +127,7 @@
+ 
+ 	if (action->completion_regex)
+ 	{
+-		g_regex_free(action->completion_regex);
++		g_regex_unref(action->completion_regex);
+ 		action->completion_regex = NULL;
+ 	}
+ 
+@@ -296,7 +296,7 @@
+ 	if (action->completion_previous_key &&
+ 	    strcmp(action->completion_previous_key, key))
+ 	{
+-		g_regex_free(action->completion_regex);
++		g_regex_unref(action->completion_regex);
+ 		action->completion_regex = NULL;
+ 
+ 		g_free(action->completion_previous_key);
+--- kazehakase-0.4.7/src/actions/kz-location-entry-action.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/actions/kz-location-entry-action.c	2007-06-05 14:29:14.000000000 +0900
+@@ -522,7 +522,7 @@
+ 	}
+ 
+ 	g_match_info_free(match_info);
+-	g_regex_free(regex);
++	g_regex_unref(regex);
+ }
+ 
+ static gboolean
+--- kazehakase-0.4.7/src/bookmarks/kz-bookmark-filter.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/bookmarks/kz-bookmark-filter.c	2007-06-05 14:29:14.000000000 +0900
+@@ -112,7 +112,7 @@
+ 		match = g_regex_match(regex, str, 0, NULL);
+ 
+ 		g_free(exp);
+-		g_regex_free(regex);
++		g_regex_unref(regex);
+ 
+ 		if (match)
+ 			return TRUE;
+--- kazehakase-0.4.7/src/bookmarks/kz-smart-bookmark.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/bookmarks/kz-smart-bookmark.c	2007-06-05 14:29:14.000000000 +0900
+@@ -289,7 +289,7 @@
+ 		}
+ 
+ 		ret = g_regex_match(regex, text, 0, &match_info);
+-		g_regex_free(regex);
++		g_regex_unref(regex);
+ 
+ 		if (ret)
+ 		{
+--- kazehakase-0.4.7/src/kz-migemo.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/kz-migemo.c	2007-06-05 14:29:14.000000000 +0900
+@@ -211,7 +211,7 @@
+ 		if (!last) break;
+ 	}
+ 	g_match_info_free(match_info);
+-	g_regex_free(regex);
++	g_regex_unref(regex);
+ 	return matched_text;
+ }
+ 
+--- kazehakase-0.4.7/src/utils/gregex.c.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/utils/gregex.c	2007-06-05 14:29:15.000000000 +0900
+@@ -838,7 +838,7 @@
+ }
+ 
+ /**
+- * g_regex_free:
++ * g_regex_unref:
+  * @regex: a #GRegex
+  *
+  * Frees all the memory associated with the regex structure.
+@@ -846,7 +846,7 @@
+  * Since: 2.14
+  */
+ void
+-g_regex_free (GRegex *regex)
++g_regex_unref (GRegex *regex)
+ {
+   if (regex == NULL)
+     return;
+@@ -952,7 +952,7 @@
+   if (!regex)
+     return FALSE;
+   result = g_regex_match_full (regex, string, -1, 0, match_options, NULL, NULL);
+-  g_regex_free (regex);
++  g_regex_unref (regex);
+   return result;
+ }
+ 
+@@ -993,7 +993,7 @@
+  *       g_match_info_next (match_info, NULL);
+  *     }
+  *   g_match_info_free (match_info);
+- *   g_regex_free (regex);
++ *   g_regex_unref (regex);
+  * }
+  * </programlisting></informalexample>
+  *
+@@ -1056,7 +1056,7 @@
+  *       g_match_info_next (match_info, &error);
+  *     }
+  *   g_match_info_free (match_info);
+- *   g_regex_free (regex);
++ *   g_regex_unref (regex);
+  *   if (error != NULL)
+  *     {
+  *       g_printerr ("Error while matching: %s\n", error->message);
+@@ -1317,7 +1317,7 @@
+   if (!regex)
+     return NULL;
+   result = g_regex_split_full (regex, string, -1, 0, match_options, 0, NULL);
+-  g_regex_free (regex);
++  g_regex_unref (regex);
+   return result;
+ }
+ 
+--- kazehakase-0.4.7/src/utils/gregex.h.glib	2007-05-29 23:25:05.000000000 +0900
++++ kazehakase-0.4.7/src/utils/gregex.h	2007-06-05 14:29:15.000000000 +0900
+@@ -88,7 +88,7 @@
+ 						 GRegexCompileFlags   compile_options,
+ 						 GRegexMatchFlags     match_options,
+ 						 GError             **error);
+-void		  g_regex_free			(GRegex              *regex);
++void		  g_regex_unref			(GRegex              *regex);
+ const gchar	 *g_regex_get_pattern		(const GRegex        *regex);
+ gint		  g_regex_get_max_backref	(const GRegex        *regex);
+ gint		  g_regex_get_capture_count	(const GRegex        *regex);
================================================================


More information about the pld-cvs-commit mailing list