[FFmpeg-devel] [PATCH 5/5] all: fix enum definition for large values

Michael Niedermayer michael at niedermayer.cc
Sat Oct 24 21:02:06 CEST 2015


On Sat, Oct 24, 2015 at 02:41:59PM -0400, Ganesh Ajjanagadde wrote:
> On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > On Sat, Oct 24, 2015 at 09:29:23AM -0400, Ganesh Ajjanagadde wrote:
> >> ISO C restricts enumerator values to the range of int. Thus (for instance) 0x80000000
> >> unfortunately does not work, and throws a warning with -Wpedantic on
> >> clang 3.7.
> >>
> >> This fixes such errors by explicitly casting as an int, doing the
> >> desired unsigned to signed conversion. This method works on all current
> >> architectures. Tested with FATE.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> >
> > Simply changing the values to signed is not correct / not sufficient
> > the code assumes that they are unsigned
> 
> enums are ints (and hence signed).

> I doubt code assumed that they are
> unsigned.

it did
for example (uint64_t)DCA_SYNCWORD_CORE_LE will change its value
with this patch, if thats the only one of if there are dozends more
i dont know

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151024/c5473963/attachment.sig>


More information about the ffmpeg-devel mailing list