[easytag] Refactor list handling in flac_tag.c



commit b6167847bce012167acaf5f25dddcfef545181b9
Author: David King <amigadave amigadave com>
Date:   Mon May 27 20:09:46 2013 +0100

    Refactor list handling in flac_tag.c
    
    Iterate over GList with a for loop. Use g_list_next() rather than
    GList->next directly.

 src/flac_tag.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/flac_tag.c b/src/flac_tag.c
index 1b4110b..41b13c1 100644
--- a/src/flac_tag.c
+++ b/src/flac_tag.c
@@ -891,7 +891,7 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
     //
     {
         FLAC__StreamMetadata *vc_block; // For vorbis comments
-        GList *list;
+        GList *l;
         
         // Allocate a block for Vorbis comments
         vc_block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
@@ -981,11 +981,9 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile)
         /**************************
          * Set unsupported fields *
          **************************/
-        list = FileTag->other;
-        while (list)
+        for (l = FileTag->other; l != NULL; l = g_list_next (l))
         {
-            Flac_Set_Tag(vc_block, "", (gchar*)list->data, FALSE);
-            list = list->next;
+            Flac_Set_Tag (vc_block, "", (gchar *)l->data, FALSE);
         }
 
         // Add the block to the the chain (so we don't need to free the block)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]