diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-25 23:19:42 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-28 23:37:12 +0200 |
commit | 4393331250d1f61be0d159de2a7976087a118c25 (patch) | |
tree | 241e43832c39d39227c533e3a41fc790fb5027c2 /libavcodec/x86/dirac_dwt_init.c | |
parent | a91ddce6894af70ed7389eaf2a84f844e9f7b7e9 (diff) | |
download | ffmpeg-4393331250d1f61be0d159de2a7976087a118c25.tar.gz |
avcodec/dirac_dwt: Avoid conversions between function pointers and void*
Pointers to void can be converted to any pointer to incomplete or
object type and back; but they are nevertheless not completely generic
pointers: There is no provision in the C standard that guarantees their
convertibility with function pointers. C90 lacks a generic function
pointer, C99 made every function pointer a generic function pointer and
still disallows the convertibility with void *. Both GCC as well as
Clang warn about this when using -pedantic.
Therefore use unions to avoid these conversions.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/x86/dirac_dwt_init.c')
-rw-r--r-- | libavcodec/x86/dirac_dwt_init.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/x86/dirac_dwt_init.c b/libavcodec/x86/dirac_dwt_init.c index 9200618283..13b42b60cb 100644 --- a/libavcodec/x86/dirac_dwt_init.c +++ b/libavcodec/x86/dirac_dwt_init.c @@ -165,23 +165,23 @@ void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type) switch (type) { case DWT_DIRAC_DD9_7: - d->vertical_compose_l0 = (void*)vertical_compose53iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dd97iH0_sse2; + d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2; + d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2; break; case DWT_DIRAC_LEGALL5_3: - d->vertical_compose_l0 = (void*)vertical_compose53iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dirac53iH0_sse2; + d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2; + d->vertical_compose_h0.tap3 = vertical_compose_dirac53iH0_sse2; break; case DWT_DIRAC_DD13_7: - d->vertical_compose_l0 = (void*)vertical_compose_dd137iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dd97iH0_sse2; + d->vertical_compose_l0.tap5 = vertical_compose_dd137iL0_sse2; + d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2; break; case DWT_DIRAC_HAAR0: - d->vertical_compose = (void*)vertical_compose_haar_sse2; + d->vertical_compose = vertical_compose_haar_sse2; d->horizontal_compose = horizontal_compose_haar0i_sse2; break; case DWT_DIRAC_HAAR1: - d->vertical_compose = (void*)vertical_compose_haar_sse2; + d->vertical_compose = vertical_compose_haar_sse2; d->horizontal_compose = horizontal_compose_haar1i_sse2; break; } |