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

2015-10-24 Thread Michael Niedermayer
On Sat, Oct 24, 2015 at 09:02:29PM +0200, Hendrik Leppkes wrote: > On Sat, Oct 24, 2015 at 8:58 PM, Michael Niedermayer > wrote: > > On Sat, Oct 24, 2015 at 02:41:59PM -0400, Ganesh Ajjanagadde wrote: > >> On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer > >> wrote: > >> > On Sat, Oct 24, 201

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

2015-10-24 Thread Michael Niedermayer
On Sat, Oct 24, 2015 at 02:41:59PM -0400, Ganesh Ajjanagadde wrote: > On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer > 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) > >> 0x80

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

2015-10-24 Thread Hendrik Leppkes
On Sat, Oct 24, 2015 at 8:58 PM, Michael Niedermayer wrote: > On Sat, Oct 24, 2015 at 02:41:59PM -0400, Ganesh Ajjanagadde wrote: >> On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer >> wrote: >> > On Sat, Oct 24, 2015 at 09:29:23AM -0400, Ganesh Ajjanagadde wrote: >> >> ISO C restricts enumer

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

2015-10-24 Thread Michael Niedermayer
On Sat, Oct 24, 2015 at 02:41:59PM -0400, Ganesh Ajjanagadde wrote: > On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer > 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) > >> 0x80

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

2015-10-24 Thread Ganesh Ajjanagadde
On Sat, Oct 24, 2015 at 2:48 PM, Nicolas George wrote: > Le tridi 3 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : >> or do you prefer a static const style? > > static const is not build-time constant, and therefore unusable for this: > impossible to use it as case label or constant initializer

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

2015-10-24 Thread Nicolas George
Le tridi 3 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit : > or do you prefer a static const style? static const is not build-time constant, and therefore unusable for this: impossible to use it as case label or constant initializer. Regards, -- Nicolas George signature.asc Description: D

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

2015-10-24 Thread Ganesh Ajjanagadde
On Sat, Oct 24, 2015 at 2:33 PM, Michael Niedermayer 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) >> 0x8000 >> unfortunately does not work, and throws a warning with -Wpedantic on >>

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

2015-10-24 Thread Michael Niedermayer
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) > 0x8000 > unfortunately does not work, and throws a warning with -Wpedantic on > clang 3.7. > > This fixes such errors by explicitly casting as an

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

2015-10-24 Thread Ganesh Ajjanagadde
On Sat, Oct 24, 2015 at 11:08 AM, wm4 wrote: > On Sat, 24 Oct 2015 09:29:23 -0400 > Ganesh Ajjanagadde wrote: > >> ISO C restricts enumerator values to the range of int. Thus (for instance) >> 0x8000 >> unfortunately does not work, and throws a warning with -Wpedantic on >> clang 3.7. >> >>

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

2015-10-24 Thread wm4
On Sat, 24 Oct 2015 09:29:23 -0400 Ganesh Ajjanagadde wrote: > ISO C restricts enumerator values to the range of int. Thus (for instance) > 0x8000 > unfortunately does not work, and throws a warning with -Wpedantic on > clang 3.7. > > This fixes such errors by explicitly casting as an int,

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

2015-10-24 Thread Ganesh Ajjanagadde
ISO C restricts enumerator values to the range of int. Thus (for instance) 0x8000 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 c