Browse code

Cosmetics: add do {} while 0 to macro.

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

Reimar Döffinger authored on 2012/01/22 06:48:15
Showing 1 changed files
... ...
@@ -68,13 +68,14 @@ static const uint8_t map2[256] =
68 68
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
69 69
 };
70 70
 
71
-#define BASE64_DEC_STEP(i) \
71
+#define BASE64_DEC_STEP(i) do { \
72 72
     bits = map2[in[i]]; \
73 73
     if (bits & 0x80) \
74 74
         goto out; \
75 75
     v = (v << 6) + bits; \
76 76
     if (i & 3) \
77 77
         *dst++ = v >> (6 - 2 * (i & 3)); \
78
+} while(0)
78 79
 
79 80
 int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
80 81
 {
... ...
@@ -87,29 +88,29 @@ int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
87 87
 
88 88
     v = 0;
89 89
     while (end - dst > 2) {
90
-        BASE64_DEC_STEP(0)
91
-        BASE64_DEC_STEP(1)
92
-        BASE64_DEC_STEP(2)
93
-        BASE64_DEC_STEP(3)
90
+        BASE64_DEC_STEP(0);
91
+        BASE64_DEC_STEP(1);
92
+        BASE64_DEC_STEP(2);
93
+        BASE64_DEC_STEP(3);
94 94
         in += 4;
95 95
     }
96 96
     if (end - dst) {
97
-        BASE64_DEC_STEP(0)
98
-        BASE64_DEC_STEP(1)
97
+        BASE64_DEC_STEP(0);
98
+        BASE64_DEC_STEP(1);
99 99
         if (end - dst) {
100
-            BASE64_DEC_STEP(2)
100
+            BASE64_DEC_STEP(2);
101 101
             in++;
102 102
         }
103 103
         in += 2;
104 104
     }
105 105
     while (1) {
106
-        BASE64_DEC_STEP(0)
106
+        BASE64_DEC_STEP(0);
107 107
         in++;
108
-        BASE64_DEC_STEP(0)
108
+        BASE64_DEC_STEP(0);
109 109
         in++;
110
-        BASE64_DEC_STEP(0)
110
+        BASE64_DEC_STEP(0);
111 111
         in++;
112
-        BASE64_DEC_STEP(0)
112
+        BASE64_DEC_STEP(0);
113 113
         in++;
114 114
     }
115 115