[FFmpeg-devel] lavfi/colorspace: Suppress compile warning on incompatible pointer type.

Submitted by Ruiling Song on July 13, 2018, 2:37 p.m.

Details

Message ID 20180713143717.19036-1-ruiling.song@intel.com
State New
Headers show

Commit Message

Ruiling Song July 13, 2018, 2:37 p.m.
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
---
Sorry I have not verified this patch, I don't know how to reproduce the gcc warning.

Thanks!
Ruiling

 libavfilter/vf_colorspace.c     | 16 ++++++++--------
 libavfilter/vf_tonemap_opencl.c |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Carl Eugen Hoyos July 13, 2018, 6:12 p.m.
2018-07-13 16:37 GMT+02:00, Ruiling Song <ruiling.song@intel.com>:
> Signed-off-by: Ruiling Song <ruiling.song@intel.com>
> ---
> Sorry I have not verified this patch, I don't know how to
> reproduce the gcc warning.

To the best of my knowledge, this is because the issue is not
reproducible with newer compilers.

This patch is therefore unnecessary imo, Carl Eugen

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 56621d15e2..69c7674a7b 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -382,8 +382,8 @@  static void fill_whitepoint_conv_table(double out[3][3], enum WhitepointAdaptati
     fac[1][1] = gd / gs;
     fac[2][2] = bd / bs;
     fac[0][1] = fac[0][2] = fac[1][0] = fac[1][2] = fac[2][0] = fac[2][1] = 0.0;
-    ff_matrix_mul_3x3(tmp, ma, fac);
-    ff_matrix_mul_3x3(out, tmp, mai);
+    ff_matrix_mul_3x3(tmp, ma, (void *)fac);
+    ff_matrix_mul_3x3(out, (void *)tmp, (void *)mai);
 }
 
 static void apply_lut(int16_t *buf[3], ptrdiff_t stride,
@@ -589,7 +589,7 @@  static int create_filtergraph(AVFilterContext *ctx,
             wp_out = &whitepoint_coefficients[s->out_primaries->wp];
             wp_in = &whitepoint_coefficients[s->in_primaries->wp];
             ff_fill_rgb2xyz_table(&s->out_primaries->coeff, wp_out, rgb2xyz);
-            ff_matrix_invert_3x3(rgb2xyz, xyz2rgb);
+            ff_matrix_invert_3x3((void *)rgb2xyz, xyz2rgb);
             ff_fill_rgb2xyz_table(&s->in_primaries->coeff, wp_in, rgb2xyz);
             if (s->out_primaries->wp != s->in_primaries->wp &&
                 s->wp_adapt != WP_ADAPT_IDENTITY) {
@@ -597,10 +597,10 @@  static int create_filtergraph(AVFilterContext *ctx,
 
                 fill_whitepoint_conv_table(wpconv, s->wp_adapt, s->in_primaries->wp,
                                            s->out_primaries->wp);
-                ff_matrix_mul_3x3(tmp, rgb2xyz, wpconv);
-                ff_matrix_mul_3x3(rgb2rgb, tmp, xyz2rgb);
+                ff_matrix_mul_3x3(tmp, (void *)rgb2xyz, (void *)wpconv);
+                ff_matrix_mul_3x3(rgb2rgb, (void *)tmp, (void *)xyz2rgb);
             } else {
-                ff_matrix_mul_3x3(rgb2rgb, rgb2xyz, xyz2rgb);
+                ff_matrix_mul_3x3(rgb2rgb, (void *)rgb2xyz, (void *)xyz2rgb);
             }
             for (m = 0; m < 3; m++)
                 for (n = 0; n < 3; n++) {
@@ -725,7 +725,7 @@  static int create_filtergraph(AVFilterContext *ctx,
             for (n = 0; n < 8; n++)
                 s->yuv_offset[0][n] = off;
             fill_rgb2yuv_table(s->in_lumacoef, rgb2yuv);
-            ff_matrix_invert_3x3(rgb2yuv, yuv2rgb);
+            ff_matrix_invert_3x3((void *)rgb2yuv, yuv2rgb);
             bits = 1 << (in_desc->comp[0].depth - 1);
             for (n = 0; n < 3; n++) {
                 for (in_rng = s->in_y_rng, m = 0; m < 3; m++, in_rng = s->in_uv_rng) {
@@ -781,7 +781,7 @@  static int create_filtergraph(AVFilterContext *ctx,
             double yuv2yuv[3][3];
             int in_rng, out_rng;
 
-            ff_matrix_mul_3x3(yuv2yuv, yuv2rgb, rgb2yuv);
+            ff_matrix_mul_3x3(yuv2yuv, (void *)yuv2rgb, (void *)rgb2yuv);
             for (out_rng = s->out_y_rng, m = 0; m < 3; m++, out_rng = s->out_uv_rng) {
                 for (in_rng = s->in_y_rng, n = 0; n < 3; n++, in_rng = s->in_uv_rng) {
                     s->yuv2yuv_coeffs[m][n][0] =
diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c
index 241f95e6c3..0cb2da0da2 100644
--- a/libavfilter/vf_tonemap_opencl.c
+++ b/libavfilter/vf_tonemap_opencl.c
@@ -125,9 +125,9 @@  static void get_rgb2rgb_matrix(enum AVColorPrimaries in, enum AVColorPrimaries o
     double rgb2xyz[3][3], xyz2rgb[3][3];
 
     ff_fill_rgb2xyz_table(&primaries_table[out], &whitepoint_table[out], rgb2xyz);
-    ff_matrix_invert_3x3(rgb2xyz, xyz2rgb);
+    ff_matrix_invert_3x3((void *)rgb2xyz, xyz2rgb);
     ff_fill_rgb2xyz_table(&primaries_table[in], &whitepoint_table[in], rgb2xyz);
-    ff_matrix_mul_3x3(rgb2rgb, rgb2xyz, xyz2rgb);
+    ff_matrix_mul_3x3(rgb2rgb, (void *)rgb2xyz, (void *)xyz2rgb);
 }
 
 #define OPENCL_SOURCE_NB 3