[FFmpeg-cvslog] swresample/resample_template: Add () to protect the arguments of the OUT() macro

Michael Niedermayer git at videolan.org
Tue Feb 17 00:58:04 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Feb 17 00:36:35 2015 +0100| [0cb95f908298bf31058fc0d08d13178bebfa3170] | committer: Michael Niedermayer

swresample/resample_template: Add () to protect the arguments of the OUT() macro

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0cb95f908298bf31058fc0d08d13178bebfa3170
---

 libswresample/resample_template.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 069b19c..7e80ef9 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -52,8 +52,8 @@
 #    define FELEM2 int64_t
 #    define FELEM_MAX INT32_MAX
 #    define FELEM_MIN INT32_MIN
-#    define OUT(d, v) v = (v + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
-                      d = (uint64_t)(v + 0x80000000) > 0xFFFFFFFF ? (v>>63) ^ 0x7FFFFFFF : v
+#    define OUT(d, v) (v) = ((v) + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
+                      (d) = (uint64_t)((v) + 0x80000000) > 0xFFFFFFFF ? ((v)>>63) ^ 0x7FFFFFFF : (v)
 
 #elif    defined(TEMPLATE_RESAMPLE_S16)
 
@@ -65,8 +65,8 @@
 #    define FELEML int64_t
 #    define FELEM_MAX INT16_MAX
 #    define FELEM_MIN INT16_MIN
-#    define OUT(d, v) v = (v + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
-                      d = (unsigned)(v + 32768) > 65535 ? (v>>31) ^ 32767 : v
+#    define OUT(d, v) (v) = ((v) + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
+                      (d) = (unsigned)((v) + 32768) > 65535 ? ((v)>>31) ^ 32767 : (v)
 
 #endif
 



More information about the ffmpeg-cvslog mailing list