[gimp] app, pdb: fix build warning because of discarded 'const' qualifier.



commit 5398d15b554292d662a7629f40bb9732ca4d8862
Author: Jehan <jehan girinstud io>
Date:   Tue May 26 17:19:31 2020 +0200

    app, pdb: fix build warning because of discarded 'const' qualifier.
    
    The PDB creates the array of drawables as a `const GimpItem *` and the
    compiler does not like when we drop the const qualifier. So force this
    const dropping with explicit type casting.

 app/pdb/image-cmds.c | 6 ++++--
 pdb/groups/image.pdb | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index c9f63ada26..37b3fba3bc 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -725,9 +725,11 @@ image_pick_color_invoker (GimpProcedure         *procedure,
 
           for (i = 0; i < num_drawables; i++)
             {
-              drawable_list = g_list_prepend (drawable_list, drawables[i]);
+              GimpPickable *pickable = (GimpPickable *) drawables[i];
+
+              drawable_list = g_list_prepend (drawable_list, pickable);
               if (! sample_merged)
-                  gimp_pickable_flush (GIMP_PICKABLE (drawables[i]));
+                gimp_pickable_flush (pickable);
             }
 
           if (sample_merged)
diff --git a/pdb/groups/image.pdb b/pdb/groups/image.pdb
index 96a0e21aa2..64d269ee25 100644
--- a/pdb/groups/image.pdb
+++ b/pdb/groups/image.pdb
@@ -481,9 +481,11 @@ HELP
 
       for (i = 0; i < num_drawables; i++)
         {
-          drawable_list = g_list_prepend (drawable_list, drawables[i]);
+          GimpPickable *pickable = (GimpPickable *) drawables[i];
+
+          drawable_list = g_list_prepend (drawable_list, pickable);
           if (! sample_merged)
-              gimp_pickable_flush (GIMP_PICKABLE (drawables[i]));
+            gimp_pickable_flush (pickable);
         }
 
       if (sample_merged)


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