]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktextbufferserialize.c
filechooserbutton: Test that the expected filename is shown
[~andy/gtk] / gtk / gtktextbufferserialize.c
index e4b4f730060ad2c05ad7d6a5f4b065505d2b8d6f..0b3f547b6450e2d800637a9a20ff63d21c0bafce 100644 (file)
@@ -14,9 +14,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* FIXME: We should use other error codes for the
@@ -54,7 +52,7 @@ serialize_value (GValue *value)
 {
   if (g_value_type_transformable (value->g_type, G_TYPE_STRING))
     {
-      GValue text_value = { 0 };
+      GValue text_value = G_VALUE_INIT;
       gchar *tmp;
 
       g_value_init (&text_value, G_TYPE_STRING);
@@ -85,7 +83,7 @@ deserialize_value (const gchar *str,
 {
   if (g_value_type_transformable (G_TYPE_STRING, value->g_type))
     {
-      GValue text_value = { 0 };
+      GValue text_value = G_VALUE_INIT;
       gboolean retval;
 
       g_value_init (&text_value, G_TYPE_STRING);
@@ -313,7 +311,7 @@ serialize_tag (gpointer key,
 
   for (i = 0; i < n_pspecs; i++)
     {
-      GValue value = { 0 };
+      GValue value = G_VALUE_INIT;
       gchar *tmp, *tmp2;
 
       if (!(pspecs[i]->flags & G_PARAM_READABLE) ||
@@ -1164,7 +1162,7 @@ parse_attr_element (GMarkupParseContext  *context,
 {
   const gchar *name, *type, *value;
   GType gtype;
-  GValue gvalue = { 0 };
+  GValue gvalue = G_VALUE_INIT;
   GParamSpec *pspec;
 
   g_assert (peek_state (info) == STATE_TAG);
@@ -1784,8 +1782,7 @@ read_headers (const gchar *start,
   return g_list_reverse (headers);
 
  error:
-  g_list_foreach (headers, (GFunc) g_free, NULL);
-  g_list_free (headers);
+  g_list_free_full (headers, g_free);
 
   g_set_error_literal (error,
                        G_MARKUP_ERROR,
@@ -1879,8 +1876,7 @@ _gtk_text_buffer_deserialize_rich_text (GtkTextBuffer *register_buffer,
                             create_tags, error, headers->next);
 
  out:
-  g_list_foreach (headers, (GFunc)g_free, NULL);
-  g_list_free (headers);
+  g_list_free_full (headers, g_free);
 
   return retval;
 }