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/dirac_dwt.h | |
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/dirac_dwt.h')
-rw-r--r-- | libavcodec/dirac_dwt.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h index 994dc21d70..84f71d9120 100644 --- a/libavcodec/dirac_dwt.h +++ b/libavcodec/dirac_dwt.h @@ -61,11 +61,14 @@ typedef struct DWTContext { int support; void (*spatial_compose)(struct DWTContext *cs, int level, int width, int height, int stride); - void (*vertical_compose_l0)(void); - void (*vertical_compose_h0)(void); - void (*vertical_compose_l1)(void); - void (*vertical_compose_h1)(void); - void (*vertical_compose)(void); ///< one set of lowpass and highpass combined + union { + vertical_compose_3tap tap3; + vertical_compose_5tap tap5; + vertical_compose_9tap tap9; + } vertical_compose_l0, vertical_compose_h0; + vertical_compose_3tap vertical_compose_l1; + vertical_compose_3tap vertical_compose_h1; + vertical_compose_2tap vertical_compose; ///< one set of lowpass and highpass combined void (*horizontal_compose)(uint8_t *b, uint8_t *tmp, int width); DWTCompose cs[MAX_DECOMPOSITIONS]; |