[vlc-devel] commit: __EVEN: expansion-safety ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jun 28 11:40:34 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jun 28 12:37:05 2008 +0300| [10eab32c8fa2c23467bb2efb3c9c30b077bc47fa]

__EVEN: expansion-safety

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10eab32c8fa2c23467bb2efb3c9c30b077bc47fa
---

 modules/demux/avi/libavi.c |    2 +-
 modules/demux/wav.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index b121e1f..a0b7cc2 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -33,7 +33,7 @@
 
 #define AVI_DEBUG 1
 
-#define __EVEN( x ) ( (x)&0x01 ? (x)+1 : (x) )
+#define __EVEN( x ) (((x) + 1) & ~1)
 
 static vlc_fourcc_t GetFOURCC( const uint8_t *p_buff )
 {
diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index 382b553..0613dd8 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -73,7 +73,7 @@ struct demux_sys_t
     int pi_chan_table[AOUT_CHAN_MAX];
 };
 
-#define __EVEN( x ) ( ( (x)%2 != 0 ) ? ((x)+1) : (x) )
+#define __EVEN( x ) (((x) + 1) & ~1)
 
 static int ChunkFind( demux_t *, const char *, unsigned int * );
 




More information about the vlc-devel mailing list