aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-20 18:48:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-20 21:36:17 +0200
commit40cbad9ff7e0a8fb5f89fc0779890f80c5d7d26d (patch)
tree7651f95dce2c07869d441c41d6d497857fbaf717
parent10b8481a26346c5586185f65f6f4fca216277fdf (diff)
downloadffmpeg-40cbad9ff7e0a8fb5f89fc0779890f80c5d7d26d.tar.gz
avcodec/wavpackenc: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpackenc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index d7a1c61e91..66ebf2fa3c 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -30,17 +30,17 @@
#include "wavpack.h"
#define UPDATE_WEIGHT(weight, delta, source, result) \
- if (source && result) { \
- int32_t s = (int32_t) (source ^ result) >> 31; \
- weight = (delta ^ s) + (weight - s); \
+ if ((source) && (result)) { \
+ int32_t s = (int32_t) ((source) ^ (result)) >> 31; \
+ weight = ((delta) ^ s) + ((weight) - s); \
}
-#define APPLY_WEIGHT_F(weight, sample) (((((sample & 0xffff) * weight) >> 9) + \
- (((sample & ~0xffff) >> 9) * weight) + 1) >> 1)
+#define APPLY_WEIGHT_F(weight, sample) ((((((sample) & 0xffff) * (weight)) >> 9) + \
+ ((((sample) & ~0xffff) >> 9) * (weight)) + 1) >> 1)
-#define APPLY_WEIGHT_I(weight, sample) ((weight * sample + 512) >> 10)
+#define APPLY_WEIGHT_I(weight, sample) (((weight) * (sample) + 512) >> 10)
-#define APPLY_WEIGHT(weight, sample) (sample != (short) sample ? \
+#define APPLY_WEIGHT(weight, sample) ((sample) != (short) (sample) ? \
APPLY_WEIGHT_F(weight, sample) : APPLY_WEIGHT_I (weight, sample))
#define CLEAR(destin) memset(&destin, 0, sizeof(destin));