[gimp] plug-ins: Silence some warnings



commit 01516591f6450280bcf397c9bbd2244d7a6a0559
Author: Ondřej Míchal <harrymichal seznam cz>
Date:   Sat Oct 16 16:37:33 2021 +0300

    plug-ins: Silence some warnings

 plug-ins/common/file-gif-load.c       |  2 +-
 plug-ins/file-psd/psd-util.c          |  7 ++++---
 plug-ins/file-tiff/file-tiff-load.c   | 10 +++++-----
 plug-ins/script-fu/script-fu-compat.c |  2 +-
 4 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c
index 8af262696c..300a9bd063 100644
--- a/plug-ins/common/file-gif-load.c
+++ b/plug-ins/common/file-gif-load.c
@@ -420,7 +420,7 @@ load_image (GFile     *file,
       return NULL;
     }
 
-  if ((strncmp (buf + 3, "87a", 3) != 0) && (strncmp (buf + 3, "89a", 3) != 0))
+  if ((strncmp ((gchar *) buf + 3, "87a", 3) != 0) && (strncmp ((gchar *) buf + 3, "89a", 3) != 0))
     {
       g_message ("Bad version number, not '87a' or '89a'");
       fclose (fd);
diff --git a/plug-ins/file-psd/psd-util.c b/plug-ins/file-psd/psd-util.c
index 6dd07d11f7..b22731497f 100644
--- a/plug-ins/file-psd/psd-util.c
+++ b/plug-ins/file-psd/psd-util.c
@@ -248,7 +248,7 @@ fread_pascal_string (gint32        *bytes_read,
 
   gchar        *str;
   gchar        *utf8_str;
-  guchar        len;
+  guchar        len = 0;
   gint32        padded_len;
 
   *bytes_read = 0;
@@ -400,7 +400,7 @@ fread_unicode_string (gint32        *bytes_read,
 
   gchar     *utf8_str;
   gunichar2 *utf16_str;
-  gint32     len;
+  gint32     len = 0;
   gint32     i;
   gint32     padded_len;
   glong      utf8_str_len;
@@ -958,7 +958,8 @@ gimp_to_psd_layer_color_tag (GimpColorTag layer_color_tag)
       if (CONVERSION_WARNINGS)
         g_message ("Photoshop doesn't support GIMP layer color tag: %i. Photoshop layer color tag set to 
none.",
                    layer_color_tag);
-        color_tag = 0;
+
+      color_tag = 0;
     }
 
   return color_tag;
diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c
index 368d918e8a..c26e794168 100644
--- a/plug-ins/file-tiff/file-tiff-load.c
+++ b/plug-ins/file-tiff/file-tiff-load.c
@@ -497,7 +497,7 @@ load_image (GFile        *file,
       gushort           extra;
       gushort          *extra_types;
       ChannelData      *channel = NULL;
-      uint16            planar  = PLANARCONFIG_CONTIG;
+      uint16_t          planar  = PLANARCONFIG_CONTIG;
       TiffColorMode     tiff_mode;
       gboolean          is_signed;
       gint              i;
@@ -1144,7 +1144,7 @@ load_image (GFile        *file,
       {
         GimpParasite *parasite    = NULL;
         void         *geotag_data = NULL;
-        uint32        count       = 0;
+        uint32_t      count       = 0;
 
         if (TIFFGetField (tif, GEOTIFF_MODELPIXELSCALE, &count, &geotag_data))
           {
@@ -1585,8 +1585,8 @@ load_profile (TIFF *tif)
    * libtiff version that can handle ICC profiles. Otherwise just
    * return a NULL profile.
    */
-  uint32  profile_size;
-  guchar *icc_profile;
+  uint32_t  profile_size;
+  guchar   *icc_profile;
 
   /* set the ICC profile - if found in the TIFF */
   if (TIFFGetField (tif, TIFFTAG_ICCPROFILE, &profile_size, &icc_profile))
@@ -1614,7 +1614,7 @@ load_rgba (TIFF        *tif,
   TIFFGetField (tif, TIFFTAG_IMAGEWIDTH,  &image_width);
   TIFFGetField (tif, TIFFTAG_IMAGELENGTH, &image_height);
 
-  buffer = g_new (uint32, image_width * image_height);
+  buffer = g_new (uint32_t, image_width * image_height);
 
   if (! TIFFReadRGBAImage (tif, image_width, image_height, buffer, 0))
     {
diff --git a/plug-ins/script-fu/script-fu-compat.c b/plug-ins/script-fu/script-fu-compat.c
index 9a167d3966..6bdfd930a1 100644
--- a/plug-ins/script-fu/script-fu-compat.c
+++ b/plug-ins/script-fu/script-fu-compat.c
@@ -130,7 +130,7 @@ define_deprecated_scheme_func (const char   *old_name,
                           " (apply --gimp-proc-db-call \"%s\" args))",
                           old_name, new_name);
 
-  sc->vptr->load_string (sc, buff);
+  sc->vptr->load_string ((scheme *) sc, buff);
 
   g_free (buff);
 }


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