changeset 12201:c4b53914f286 libavcodec

vp8: add do { } while(0) around XCHG() macro to avoid confusing if/else This is the correct solution to the warning "fixed" in the previous commit.
author mru
date Tue, 20 Jul 2010 17:54:25 +0000
parents b768afb88d1a
children 3465e53116e5
files vp8.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vp8.c	Tue Jul 20 17:45:54 2010 +0000
+++ b/vp8.c	Tue Jul 20 17:54:25 2010 +0000
@@ -882,16 +882,17 @@
     src_cb -= uvlinesize;
     src_cr -= uvlinesize;
 
-#define XCHG(a,b,xchg)\
+#define XCHG(a,b,xchg) do {\
 if (xchg) AV_SWAP64(b,a);\
-else      AV_COPY64(b,a);
+else      AV_COPY64(b,a);\
+} while (0)
 
     XCHG(top_border_m1+8, src_y-8, xchg);
     XCHG(top_border,      src_y,   xchg);
     XCHG(top_border+8,    src_y+8, 1);
-    if (mb_x < mb_width-1) {
+    if (mb_x < mb_width-1)
         XCHG(top_border+32, src_y+16, 1);
-    }
+
     // only copy chroma for normal loop filter
     // or to initialize the top row to 127
     if (!simple || !mb_y) {