diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-01-21 22:48:15 +0100 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-01-22 14:41:15 +0100 |
commit | 420719e1410cf634bfaf98d5e545a91c781c63b2 (patch) | |
tree | 31bc10e9747cce75897d6eaf5bc5916d3db99d65 /libavutil/base64.c | |
parent | 0421b6dc7a1463b9263b9d63533dd7c5be8ffa97 (diff) | |
download | ffmpeg-420719e1410cf634bfaf98d5e545a91c781c63b2.tar.gz |
Cosmetics: add do {} while 0 to macro.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil/base64.c')
-rw-r--r-- | libavutil/base64.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libavutil/base64.c b/libavutil/base64.c index df0f6a3853..145bed6f36 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -68,13 +68,14 @@ static const uint8_t map2[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; -#define BASE64_DEC_STEP(i) \ +#define BASE64_DEC_STEP(i) do { \ bits = map2[in[i]]; \ if (bits & 0x80) \ goto out; \ v = (v << 6) + bits; \ if (i & 3) \ *dst++ = v >> (6 - 2 * (i & 3)); \ +} while(0) int av_base64_decode(uint8_t *out, const char *in_str, int out_size) { @@ -87,29 +88,29 @@ int av_base64_decode(uint8_t *out, const char *in_str, int out_size) v = 0; while (end - dst > 2) { - BASE64_DEC_STEP(0) - BASE64_DEC_STEP(1) - BASE64_DEC_STEP(2) - BASE64_DEC_STEP(3) + BASE64_DEC_STEP(0); + BASE64_DEC_STEP(1); + BASE64_DEC_STEP(2); + BASE64_DEC_STEP(3); in += 4; } if (end - dst) { - BASE64_DEC_STEP(0) - BASE64_DEC_STEP(1) + BASE64_DEC_STEP(0); + BASE64_DEC_STEP(1); if (end - dst) { - BASE64_DEC_STEP(2) + BASE64_DEC_STEP(2); in++; } in += 2; } while (1) { - BASE64_DEC_STEP(0) + BASE64_DEC_STEP(0); in++; - BASE64_DEC_STEP(0) + BASE64_DEC_STEP(0); in++; - BASE64_DEC_STEP(0) + BASE64_DEC_STEP(0); in++; - BASE64_DEC_STEP(0) + BASE64_DEC_STEP(0); in++; } |