babl: babl-fish-path improve portability for ppc
authorØyvind Kolås <pippin@gimp.org>
Sat, 15 Feb 2020 06:22:25 +0000 (07:22 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sat, 15 Feb 2020 06:25:33 +0000 (07:25 +0100)
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

index c8911d192b64563814cc15d79de1d31dda155d10..284d4523fd33d311226abf330a5e8db6e4f768bb 100644 (file)
@@ -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: