Message ID | CAB0OVGowhU7AHy7NhsiOkP=_fRhOeLFYS9b4j_rq3L9QeQ7XQA@mail.gmail.com |
---|---|
State | Accepted |
Headers | show |
2019-04-18 14:07 GMT+02:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>: > 2019-04-18 12:16 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>: >>> Silences a warning with clang: >>> warning: implicit conversion from 'int' to 'int16_t' (aka 'short') >>> changes >>> value from 44130 to -21406 >>> --- >>> libavfilter/vf_fspp.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/libavfilter/vf_fspp.h b/libavfilter/vf_fspp.h >>> index 802db14..bdafe8e 100644 >>> --- a/libavfilter/vf_fspp.h >>> +++ b/libavfilter/vf_fspp.h >>> @@ -31,7 +31,7 @@ >>> #define DCTSIZE 8 >>> #define DCTSIZE_S "8" >>> >>> -#define FIX(x,s) ((int) ((x) * (1 << s) + 0.5) & 0xffff) >>> +#define FIX(x,s) ((int16_t)((x) * (1 << s) + 0.5)) >> >> does it need the cast at all to avoid the warning ? > > Attached patch also avoids the warning. Patch applied. Thank you, Carl Eugen
From 69c7f0894acccf64438198cd8d01a9f3e9765a95 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos <ceffmpeg@gmail.com> Date: Thu, 18 Apr 2019 14:05:21 +0200 Subject: [PATCH] lavfi/fspp: Simplify a macro. Silences a warning with clang: warning: implicit conversion from 'int' to 'int16_t' (aka 'short') changes value from 44130 to -21406 --- libavfilter/vf_fspp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_fspp.h b/libavfilter/vf_fspp.h index 802db14..73d8c7c 100644 --- a/libavfilter/vf_fspp.h +++ b/libavfilter/vf_fspp.h @@ -31,7 +31,7 @@ #define DCTSIZE 8 #define DCTSIZE_S "8" -#define FIX(x,s) ((int) ((x) * (1 << s) + 0.5) & 0xffff) +#define FIX(x,s) ((x) * (1 << s) + 0.5) #define MULTIPLY16H(x,k) (((x) * (k)) >> 16) #define THRESHOLD(r,x,t) \ -- 1.7.10.4