[Ffmpeg-devel] [PATCH] macro redefinition warning fix

Diego Biurrun diego
Mon Oct 30 09:59:15 CET 2006


Here's a fix for the following warning:

ppc/mpegvideo_altivec.c:34:1: warning: "SWAP" redefined
In file included from ppc/../dsputil.h:33,
                 from ppc/mpegvideo_altivec.c:26:
/Users/diegobiurrun/src/ffmpeg/libavutil/common.h:201:1: warning: this is the location of the previous definition

I renamed the SWAP macro to SWAP_ALTIVEC.

Probably a better solution would be to rename the SWAP macro in
libavutil/common.h to FFSWAP.  Thoughts?

Diego
-------------- next part --------------
Index: mpegvideo_altivec.c
===================================================================
--- mpegvideo_altivec.c	(revision 6837)
+++ mpegvideo_altivec.c	(working copy)
@@ -31,7 +31,7 @@
 #include "dsputil_altivec.h"
 
 // Swaps two variables (used for altivec registers)
-#define SWAP(a,b) \
+#define SWAP_ALTIVEC(a,b) \
 do { \
     __typeof__(a) swap_temp=a; \
     a=b; \
@@ -229,14 +229,14 @@
                 // this sets up the low values to be acted on in the second half.
                 // If this is the second half, it puts the high values back in
                 // the row values where they are expected to be when we're done.
-                SWAP(row0, alt0);
-                SWAP(row1, alt1);
-                SWAP(row2, alt2);
-                SWAP(row3, alt3);
-                SWAP(row4, alt4);
-                SWAP(row5, alt5);
-                SWAP(row6, alt6);
-                SWAP(row7, alt7);
+                SWAP_ALTIVEC(row0, alt0);
+                SWAP_ALTIVEC(row1, alt1);
+                SWAP_ALTIVEC(row2, alt2);
+                SWAP_ALTIVEC(row3, alt3);
+                SWAP_ALTIVEC(row4, alt4);
+                SWAP_ALTIVEC(row5, alt5);
+                SWAP_ALTIVEC(row6, alt6);
+                SWAP_ALTIVEC(row7, alt7);
             }
 
             if (whichPass == 1)
@@ -244,10 +244,10 @@
                 // transpose the data for the second pass
 
                 // First, block transpose the upper right with lower left.
-                SWAP(row4, alt0);
-                SWAP(row5, alt1);
-                SWAP(row6, alt2);
-                SWAP(row7, alt3);
+                SWAP_ALTIVEC(row4, alt0);
+                SWAP_ALTIVEC(row5, alt1);
+                SWAP_ALTIVEC(row6, alt2);
+                SWAP_ALTIVEC(row7, alt3);
 
                 // Now, transpose each block of four
                 TRANSPOSE4(row0, row1, row2, row3);



More information about the ffmpeg-devel mailing list