[gegl] Fix the type casts for babl_space_from_icc



commit d77fd17e0afde1df2f35979929b7d8d5e29ad022
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Sep 6 09:06:42 2018 +0200

    Fix the type casts for babl_space_from_icc
    
    For reference, here's the signature of babl_space_from_icc:
    const Babl *babl_space_from_icc (const char       *icc_data,
                                     int               icc_length,
                                     BablIccIntent     intent,
                                     const char      **error);
    
    ... and JOCTET can be defined as either a signed or unsigned char:
    #ifdef HAVE_UNSIGNED_CHAR
    typedef unsigned char JOCTET;
    #define GETJOCTET(value)  (value)
    #else /* not HAVE_UNSIGNED_CHAR */
    typedef char JOCTET;
    #ifdef __CHAR_UNSIGNED__
    #define GETJOCTET(value)  (value)
    #else
    #define GETJOCTET(value)  ((value) & 0xFF)
    #endif /* __CHAR_UNSIGNED__ */
    #endif /* HAVE_UNSIGNED_CHAR */

 bin/mrg-gegl.c                  | 2 +-
 operations/core/cast-space.c    | 2 +-
 operations/core/convert-space.c | 2 +-
 operations/external/jpg-load.c  | 6 +++---
 operations/external/png-load.c  | 2 +-
 operations/external/tiff-load.c | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/bin/mrg-gegl.c b/bin/mrg-gegl.c
index 1cc872bff..c720516be 100644
--- a/bin/mrg-gegl.c
+++ b/bin/mrg-gegl.c
@@ -108,7 +108,7 @@ foo++;
       unsigned const char *icc_data = mrg_get_profile (mrg, &icc_length);
       const Babl *space = NULL;
       if (icc_data)
-         space = babl_space_from_icc ((void*)icc_data, icc_length, BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, 
NULL);
+         space = babl_space_from_icc ((char*)icc_data, icc_length, BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, 
NULL);
       fmt = babl_format_with_space ("cairo-RGB24", space);
     }
     gegl_node_blit (node, scale / fake_factor, &roi, fmt, buf, width * 4,
diff --git a/operations/core/cast-space.c b/operations/core/cast-space.c
index b6ea766c9..731872307 100644
--- a/operations/core/cast-space.c
+++ b/operations/core/cast-space.c
@@ -57,7 +57,7 @@ prepare (GeglOperation *operation)
     if (icc_data)
     {
       const char *error = NULL;
-      const Babl *s = babl_space_from_icc ((void*)icc_data, icc_length,
+      const Babl *s = babl_space_from_icc (icc_data, (gint)icc_length,
                                  BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
       if (s) space = s;
       g_free (icc_data);
diff --git a/operations/core/convert-space.c b/operations/core/convert-space.c
index e068b3f78..dc45fbc55 100644
--- a/operations/core/convert-space.c
+++ b/operations/core/convert-space.c
@@ -55,7 +55,7 @@ gegl_convert_space_prepare (GeglOperation *operation)
     if (icc_data)
     {
       const char *error = NULL;
-      const Babl *s = babl_space_from_icc ((void*)icc_data, icc_length,
+      const Babl *s = babl_space_from_icc (icc_data, (gint)icc_length,
                                  BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
       if (s) space = s;
       g_free (icc_data);
diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c
index 374a1711a..ac75258b3 100644
--- a/operations/external/jpg-load.c
+++ b/operations/external/jpg-load.c
@@ -185,9 +185,9 @@ static const Babl *jpg_get_space (struct jpeg_decompress_struct *cinfo)
   {
     const char *error = NULL;
     const Babl *ret;
-    ret = babl_space_from_icc ((void*)icc_data, icc_len,
-                                BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
-                                &error);
+    ret = babl_space_from_icc ((char*)icc_data, (int)icc_len,
+                               BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
+                               &error);
     free (icc_data);
     return ret;
   }
diff --git a/operations/external/png-load.c b/operations/external/png-load.c
index 72a498ea0..2ef82bc22 100644
--- a/operations/external/png-load.c
+++ b/operations/external/png-load.c
@@ -171,7 +171,7 @@ gegl_png_space (png_structp load_png_ptr,
       PNG_INFO_iCCP)
     {
       const char *error = NULL;
-      return babl_space_from_icc ((void*)profile, proflen,
+      return babl_space_from_icc ((char*)profile, (int)proflen,
                                  BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
     }
 
diff --git a/operations/external/tiff-load.c b/operations/external/tiff-load.c
index 3ebc68d79..f94cbc874 100644
--- a/operations/external/tiff-load.c
+++ b/operations/external/tiff-load.c
@@ -504,7 +504,7 @@ query_tiff(GeglOperation *operation)
     if (TIFFGetField (p->tiff, TIFFTAG_ICCPROFILE, &profile_size, &icc_profile))
       {
         const char *error = NULL;
-        space = babl_space_from_icc ((void*)icc_profile, profile_size,
+        space = babl_space_from_icc ((char*)icc_profile, (gint)profile_size,
                                      BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
       }
 


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