ffmpeg/libswscale
Andreas Rheinhardt 2fae000994 swscale/vscale: Increase type strictness
libswscale/vscale.c makes extensive use of function pointers and in
doing so it converts these function pointers to and from a pointer to
void. Yet this is actually against the C standard:
C90 only guarantees that one can convert a pointer to any incomplete
type or object type to void* and back with the result comparing equal
to the original which makes pointers to void generic pointers to
incomplete or object type. Yet C90 lacks a generic function pointer
type.
C99 additionally guarantees that a pointer to a function of one type may
be converted to a pointer to a function of another type with the result
and the original comparing equal when converting back.
This makes any function pointer type a generic function pointer type.
Yet even this does not make pointers to void generic function pointers.

Both GCC and Clang emit warnings for this when in pedantic mode.

This commit fixes this by using a union that can hold one member of any
of the required function pointer types to store the function pointer.
This works even for C90.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-04-27 23:34:31 +02:00
..
aarch64 swscale: aarch64: Don't clobber callee-saved registers v8-v15 2020-04-21 23:41:13 +03:00
arm
ppc swscale: Fix AltiVec/VSX build with recent GCC 2019-10-04 08:58:17 +03:00
tests
x86 swscale/swscale: remove useless code 2020-04-03 00:58:07 +02:00
Makefile
alphablend.c
bayer_template.c
gamma.c
hscale.c
hscale_fast_bilinear.c
input.c lsws/input: Do not change transparency range. 2020-03-11 22:55:49 +01:00
libswscale.v
log2_tab.c
options.c
output.c swscale/output: Fix integer overflow in yuv2rgb_write_full() with out of range input 2020-04-04 22:09:46 +02:00
rgb2rgb.c
rgb2rgb.h
rgb2rgb_template.c
slice.c
swscale.c swscale/swscale: remove useless code 2020-04-03 00:58:07 +02:00
swscale.h
swscale_internal.h swscale/swscale: remove useless code 2020-04-03 00:58:07 +02:00
swscale_unscaled.c swscale/swscale_unscaled: add AV_PIX_FMT_GBRAP10 for LE and BE conversion wrapper 2019-12-10 16:09:14 +01:00
swscaleres.rc
utils.c swscale: Add swscale input support for Y210LE 2020-02-24 00:09:51 +00:00
version.h lsws/input: Do not change transparency range. 2020-03-11 22:55:49 +01:00
vscale.c swscale/vscale: Increase type strictness 2020-04-27 23:34:31 +02:00
yuv2rgb.c swscale/yuv2rgb: Fix vertical dither offset with slices 2020-04-12 16:36:47 +02:00