Browse code

Avoid using empty macro arguments.

These are not supported by all compilers (gcc 2.95 but also older SPARC
compilers, see gcc bug #33304 for example), and there is no real need for them.
One use of this feature remains in libavdevice/v4l2.c which can't be
replaced quite as easily.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

Reimar Döffinger authored on 2013/12/30 20:10:35
Showing 4 changed files
... ...
@@ -60,7 +60,7 @@ static void arith_normalise(ArithCoder *c)
60 60
     }
61 61
 }
62 62
 
63
-ARITH_GET_BIT()
63
+ARITH_GET_BIT(arith)
64 64
 
65 65
 static int arith_get_bits(ArithCoder *c, int bits)
66 66
 {
... ...
@@ -105,7 +105,7 @@ static int arith_get_prob(ArithCoder *c, int16_t *probs)
105 105
     return sym;
106 106
 }
107 107
 
108
-ARITH_GET_MODEL_SYM()
108
+ARITH_GET_MODEL_SYM(arith)
109 109
 
110 110
 static void arith_init(ArithCoder *c, GetBitContext *gb)
111 111
 {
... ...
@@ -99,8 +99,8 @@ int ff_mss12_decode_init(MSS12Context *c, int version,
99 99
                          SliceContext *sc1, SliceContext *sc2);
100 100
 int ff_mss12_decode_end(MSS12Context *ctx);
101 101
 
102
-#define ARITH_GET_BIT(VERSION)                                          \
103
-static int arith ## VERSION ## _get_bit(ArithCoder *c)                  \
102
+#define ARITH_GET_BIT(prefix)                                           \
103
+static int prefix ## _get_bit(ArithCoder *c)                            \
104 104
 {                                                                       \
105 105
     int range = c->high - c->low + 1;                                   \
106 106
     int bit   = 2 * c->value - c->low >= c->high;                       \
... ...
@@ -110,22 +110,22 @@ static int arith ## VERSION ## _get_bit(ArithCoder *c)                  \
110 110
     else                                                                \
111 111
         c->high = c->low + (range >> 1) - 1;                            \
112 112
                                                                         \
113
-    arith ## VERSION ## _normalise(c);                                  \
113
+    prefix ## _normalise(c);                                            \
114 114
                                                                         \
115 115
     return bit;                                                         \
116 116
 }
117 117
 
118
-#define ARITH_GET_MODEL_SYM(VERSION)                                    \
119
-static int arith ## VERSION ## _get_model_sym(ArithCoder *c, Model *m)  \
118
+#define ARITH_GET_MODEL_SYM(prefix)                                     \
119
+static int prefix ## _get_model_sym(ArithCoder *c, Model *m)            \
120 120
 {                                                                       \
121 121
     int idx, val;                                                       \
122 122
                                                                         \
123
-    idx = arith ## VERSION ## _get_prob(c, m->cum_prob);                \
123
+    idx = prefix ## _get_prob(c, m->cum_prob);                          \
124 124
                                                                         \
125 125
     val = m->idx2sym[idx];                                              \
126 126
     ff_mss12_model_update(m, idx);                                      \
127 127
                                                                         \
128
-    arith ## VERSION ## _normalise(c);                                  \
128
+    prefix ## _normalise(c);                                            \
129 129
                                                                         \
130 130
     return val;                                                         \
131 131
 }
... ...
@@ -54,7 +54,7 @@ static void arith2_normalise(ArithCoder *c)
54 54
     }
55 55
 }
56 56
 
57
-ARITH_GET_BIT(2)
57
+ARITH_GET_BIT(arith2)
58 58
 
59 59
 /* L. Stuiver and A. Moffat: "Piecewise Integer Mapping for Arithmetic Coding."
60 60
  * In Proc. 8th Data Compression Conference (DCC '98), pp. 3-12, Mar. 1998 */
... ...
@@ -127,7 +127,7 @@ static int arith2_get_prob(ArithCoder *c, int16_t *probs)
127 127
     return i;
128 128
 }
129 129
 
130
-ARITH_GET_MODEL_SYM(2)
130
+ARITH_GET_MODEL_SYM(arith2)
131 131
 
132 132
 static int arith2_get_consumed_bytes(ArithCoder *c)
133 133
 {
... ...
@@ -21,14 +21,14 @@
21 21
 #include "libswresample/swresample_internal.h"
22 22
 #include "libswresample/audioconvert.h"
23 23
 
24
-#define PROTO(pre, in, out, cap) void ff ## pre ## _ ##in## _to_ ##out## _a_ ##cap(uint8_t **dst, const uint8_t **src, int len);
24
+#define PROTO(pre, in, out, cap) void ff ## pre ## in## _to_ ##out## _a_ ##cap(uint8_t **dst, const uint8_t **src, int len);
25 25
 #define PROTO2(pre, out, cap) PROTO(pre, int16, out, cap) PROTO(pre, int32, out, cap) PROTO(pre, float, out, cap)
26 26
 #define PROTO3(pre, cap) PROTO2(pre, int16, cap) PROTO2(pre, int32, cap) PROTO2(pre, float, cap)
27 27
 #define PROTO4(pre) PROTO3(pre, mmx) PROTO3(pre, sse) PROTO3(pre, sse2) PROTO3(pre, ssse3) PROTO3(pre, sse4) PROTO3(pre, avx)
28
-PROTO4()
29
-PROTO4(_pack_2ch)
30
-PROTO4(_pack_6ch)
31
-PROTO4(_unpack_2ch)
28
+PROTO4(_)
29
+PROTO4(_pack_2ch_)
30
+PROTO4(_pack_6ch_)
31
+PROTO4(_unpack_2ch_)
32 32
 
33 33
 av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
34 34
                                  enum AVSampleFormat out_fmt,