[gimp] app, pdb: fix a few "incompatible pointer type" conversions.



commit 759ee663f08860f597a2172038262e6677ac4478
Author: Jehan <jehan girinstud io>
Date:   Thu Oct 20 18:56:24 2022 +0200

    app, pdb: fix a few "incompatible pointer type" conversions.
    
    That's the problem when there are still too many old warnings hiding the
    new ones!

 app/pdb/image-cmds.c | 6 +++---
 pdb/groups/image.pdb | 4 ++--
 pdb/pdb.pl           | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index 0b7dc28eea..5086deaff8 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -1862,7 +1862,7 @@ image_get_selected_channels_invoker (GimpProcedure         *procedure,
         {
           gint i;
 
-          channels = g_new (GimpLayer *, num_channels);
+          channels = g_new (GimpChannel *, num_channels);
 
           for (i = 0; i < num_channels; i++, list = g_list_next (list))
             channels[i] = g_object_ref (list->data);
@@ -1896,7 +1896,7 @@ image_set_selected_channels_invoker (GimpProcedure         *procedure,
 
   image = g_value_get_object (gimp_value_array_index (args, 0));
   num_channels = g_value_get_int (gimp_value_array_index (args, 1));
-  channels = gimp_value_get_object_array (gimp_value_array_index (args, 2));
+  channels = (const GimpChannel **) gimp_value_get_object_array (gimp_value_array_index (args, 2));
 
   if (success)
     {
@@ -1905,7 +1905,7 @@ image_set_selected_channels_invoker (GimpProcedure         *procedure,
 
       for (i = 0; i < num_channels; i++)
         selected_channels = g_list_prepend (selected_channels,
-                                            GIMP_LAYER (channels[i]));
+                                            GIMP_CHANNEL (channels[i]));
 
       gimp_image_set_selected_channels (image, selected_channels);
       g_list_free (selected_channels);
diff --git a/pdb/groups/image.pdb b/pdb/groups/image.pdb
index f0817d6152..26abaa43f6 100644
--- a/pdb/groups/image.pdb
+++ b/pdb/groups/image.pdb
@@ -1918,7 +1918,7 @@ HELP
     {
       gint i;
 
-      channels = g_new (GimpLayer *, num_channels);
+      channels = g_new (GimpChannel *, num_channels);
 
       for (i = 0; i < num_channels; i++, list = g_list_next (list))
         channels[i] = g_object_ref (list->data);
@@ -1959,7 +1959,7 @@ HELP
 
   for (i = 0; i < num_channels; i++)
     selected_channels = g_list_prepend (selected_channels,
-                                        GIMP_LAYER (channels[i]));
+                                        GIMP_CHANNEL (channels[i]));
 
   gimp_image_set_selected_channels (image, selected_channels);
   g_list_free (selected_channels);
diff --git a/pdb/pdb.pl b/pdb/pdb.pl
index af8dc1b9fe..a1321def22 100644
--- a/pdb/pdb.pl
+++ b/pdb/pdb.pl
@@ -169,7 +169,7 @@ package Gimp::CodeGen::pdb;
                     init_value      => 'NULL',
                     in_annotate     => '(element-type GimpChannel)',
                     out_annotate    => '(element-type GimpChannel) (transfer container)',
-                    get_value_func  => '$var = gimp_value_get_object_array ($value)',
+                    get_value_func  => '$var = (const GimpChannel **) gimp_value_get_object_array ($value)',
                     dup_value_func  => '{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index 
($value)); if (a) $var = g_memdup2 (a->data, a->length * sizeof (gpointer)); }',
                     set_value_func  => 'gimp_value_set_object_array ($value, GIMP_TYPE_CHANNEL, (GObject **) 
$var, $var_len)',
                     take_value_func => 'gimp_value_take_object_array ($value, GIMP_TYPE_CHANNEL, (GObject 
**) $var, $var_len)' },


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