[babl] babl: babl-fish-path improve portability for ppc



commit a585692ae33cedf1823fa788172a5e56c3ef5f2b
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Feb 15 07:22:25 2020 +0100

    babl: babl-fish-path improve portability for ppc
    
    Quoting his explaination for why this fixes things (the other half of
    the same function was already portable.)
    
    "This breaks on PowerPC 32-bit, because the calling convention for
    passing a union is to pass a pointer to a temporary copy of the union.
    This pointer isn't as a function pointer.  On some other platforms, the
    call would just copy the union, which is like copying the function
    pointer.  On all platforms, the compiler doesn't check the type, because
    babl_conversion_new() has a va_arg(3) prototype."
    
    Portabilitiy issue figured out by George Koehler, This fixes issue #24.

 babl/babl-fish-path.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index c8911d192..284d4523f 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -404,7 +404,7 @@ alias_conversion (Babl *babl,
                     (void*)conv->source, (void*)space),
               babl_remodel_with_space (
                     (void*)conv->destination, (void*)space),
-              "linear", conv->function,
+              "linear", conv->function.linear,
               NULL);
         break;
       case BABL_CONVERSION_PLANAR:
@@ -413,7 +413,7 @@ alias_conversion (Babl *babl,
                     (void*)conv->source, (void*)space),
               babl_remodel_with_space (
                     (void*)conv->destination, (void*)space),
-              "planar", conv->function,
+              "planar", conv->function.planar,
               NULL);
         break;
       case BABL_CONVERSION_PLANE:
@@ -422,7 +422,7 @@ alias_conversion (Babl *babl,
                     (void*)conv->source, (void*)space),
               babl_remodel_with_space (
                     (void*)conv->destination, (void*)space),
-              "plane", conv->function,
+              "plane", conv->function.plane,
               NULL);
         break;
       default:


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