Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-29 Thread Diego Biurrun
On Fri, Oct 26, 2012 at 06:29:47PM -0700, Diego Elio Pettenò wrote:
 On 26/10/2012 18:18, Måns Rullgård wrote:
  Only to follow the pattern.
 
 Should yours do the same then, or should one Diego at random send a
 patch to remove the rest?

I nominate you :)

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-29 Thread Alex Converse
On Fri, Oct 26, 2012 at 5:50 PM, Mans Rullgard m...@mansr.com wrote:
 The C99 standard requires that the expression that defines the value of
 an enumeration constant shall be an integer constant expression that has
 a value representable as an int.

 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavformat/mov_chan.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
 index 00a2a4b..d7eb528 100644
 --- a/libavformat/mov_chan.c
 +++ b/libavformat/mov_chan.c
 @@ -45,7 +45,7 @@
   *do not specify a particular ordering of those channels.
   */
  enum MovChannelLayoutTag {
 -MOV_CH_LAYOUT_UNKNOWN   = 0x,
 +MOV_CH_LAYOUT_UNKNOWN   = ( -1  16),


Your replacement is undefined:

6.5.7 Bitwise shift operators

The result of E1  E2 is E1 left-shifted E2 bit positions; vacated
bits are filled with zeros. If E1 has an unsigned type, the value of
the result is E1 × 2^E2 , reduced modulo one more than the maximum
value representable in the result type. If E1 has a signed type and
nonnegative value, and E1 × 2^E2 is representable in the result type,
then that is the resulting value; otherwise, the behavior is
undefined.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-29 Thread Måns Rullgård
Alex Converse alex.conve...@gmail.com writes:

 On Fri, Oct 26, 2012 at 5:50 PM, Mans Rullgard m...@mansr.com wrote:
 The C99 standard requires that the expression that defines the value of
 an enumeration constant shall be an integer constant expression that has
 a value representable as an int.

 Signed-off-by: Mans Rullgard m...@mansr.com
 ---
  libavformat/mov_chan.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
 index 00a2a4b..d7eb528 100644
 --- a/libavformat/mov_chan.c
 +++ b/libavformat/mov_chan.c
 @@ -45,7 +45,7 @@
   *do not specify a particular ordering of those channels.
   */
  enum MovChannelLayoutTag {
 -MOV_CH_LAYOUT_UNKNOWN   = 0x,
 +MOV_CH_LAYOUT_UNKNOWN   = ( -1  16),

 Your replacement is undefined:

 6.5.7 Bitwise shift operators

 The result of E1  E2 is E1 left-shifted E2 bit positions; vacated
 bits are filled with zeros. If E1 has an unsigned type, the value of
 the result is E1 × 2^E2 , reduced modulo one more than the maximum
 value representable in the result type. If E1 has a signed type and
 nonnegative value, and E1 × 2^E2 is representable in the result type,
 then that is the resulting value; otherwise, the behavior is
 undefined.

We shift negative values all the time.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-26 Thread Mans Rullgard
The C99 standard requires that the expression that defines the value of
an enumeration constant shall be an integer constant expression that has
a value representable as an int.

Signed-off-by: Mans Rullgard m...@mansr.com
---
 libavformat/mov_chan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 00a2a4b..d7eb528 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -45,7 +45,7 @@
  *do not specify a particular ordering of those channels.
  */
 enum MovChannelLayoutTag {
-MOV_CH_LAYOUT_UNKNOWN   = 0x,
+MOV_CH_LAYOUT_UNKNOWN   = ( -1  16),
 MOV_CH_LAYOUT_USE_DESCRIPTIONS  = (  0  16) | 0,
 MOV_CH_LAYOUT_USE_BITMAP= (  1  16) | 0,
 MOV_CH_LAYOUT_DISCRETEINORDER   = (147  16) | 0,
-- 
1.7.12.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-26 Thread Diego Elio Pettenò
On 26/10/2012 17:50, Mans Rullgard wrote:
 +MOV_CH_LAYOUT_UNKNOWN   = ( -1  16),
  MOV_CH_LAYOUT_USE_DESCRIPTIONS  = (  0  16) | 0,

Uhm, any reason for the others to use | 0 ?

-- 
Diego Elio Pettenò — Flameeyes
flamee...@flameeyes.eu — http://blog.flameeyes.eu/
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-26 Thread Måns Rullgård
Diego Elio Pettenò flamee...@flameeyes.eu writes:

 On 26/10/2012 17:50, Mans Rullgard wrote:
 +MOV_CH_LAYOUT_UNKNOWN   = ( -1  16),
  MOV_CH_LAYOUT_USE_DESCRIPTIONS  = (  0  16) | 0,

 Uhm, any reason for the others to use | 0 ?

Only to follow the pattern.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/11] mov: make enum MovChannelLayoutTag definition standards compliant

2012-10-26 Thread Diego Elio Pettenò
On 26/10/2012 18:18, Måns Rullgård wrote:
 Only to follow the pattern.

Should yours do the same then, or should one Diego at random send a
patch to remove the rest?

-- 
Diego Elio Pettenò — Flameeyes
flamee...@flameeyes.eu — http://blog.flameeyes.eu/
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel