[gimp] libgimp: use G_N_ELEMENTS() in gimp_image_metadata_save_finish()



commit d8732909151a3c21d23eadc6d7872297e9cdb14c
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jan 1 20:26:07 2019 +0100

    libgimp: use G_N_ELEMENTS() in gimp_image_metadata_save_finish()
    
    intead of hardcoding the array length.

 libgimp/gimpimagemetadata.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/libgimp/gimpimagemetadata.c b/libgimp/gimpimagemetadata.c
index c0daa29e7a..4e8b044494 100644
--- a/libgimp/gimpimagemetadata.c
+++ b/libgimp/gimpimagemetadata.c
@@ -503,21 +503,22 @@ gimp_image_metadata_save_finish (gint32                  image_ID,
       gexiv2_metadata_set_tag_string (GEXIV2_METADATA (metadata),
                                       "Xmp.GIMP.Platform",
 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
-                                      "Windows");
+                                      "Windows"
 #elif defined(__linux__)
-                                      "Linux");
+                                      "Linux"
 #elif defined(__APPLE__) && defined(__MACH__)
-                                      "Mac OS");
+                                      "Mac OS"
 #elif defined(unix) || defined(__unix__) || defined(__unix)
-                                      "Unix");
+                                      "Unix"
 #else
-                                      "Unknown");
+                                      "Unknown"
 #endif
+                                      );
 
       xmp_data = gexiv2_metadata_get_xmp_tags (GEXIV2_METADATA (metadata));
 
       /* Patch necessary structures */
-      for (i = 0; i < 9; i++)
+      for (i = 0; i < G_N_ELEMENTS (structlist); i++)
         {
           gexiv2_metadata_set_xmp_tag_struct (GEXIV2_METADATA (new_g2metadata),
                                               structlist[i].tag,


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