diff options
author | wm4 <wm4@nowhere> | 2013-04-30 00:52:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-30 00:52:32 +0200 |
commit | ea7b920184a865a3343001318fc4a32dcfc7b4f5 (patch) | |
tree | fbefd8539b77ee7473ad73740cc8ffa97bc4ffbe /stream/stream.c | |
parent | 3dcc83a70609d392c8ecd917dd5c16995424e9c4 (diff) | |
parent | d98e61ea438db66323734ad1b6bea66411a3c97b (diff) | |
download | mpv-ea7b920184a865a3343001318fc4a32dcfc7b4f5.tar.bz2 mpv-ea7b920184a865a3343001318fc4a32dcfc7b4f5.tar.xz |
Merge branch 'master' into low_quality_intel_crap
Conflicts:
video/out/gl_video_shaders.glsl
video/out/vo_opengl.c
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/stream/stream.c b/stream/stream.c index d0bd0b58d6..75c7d4fb5c 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -649,16 +649,14 @@ static const uint8_t *find_newline(const uint8_t *buf, int len, int utf16) return (uint8_t *)memchr(buf, '\n', len); case 1: while (buf < end - 1) { - GET_UTF16(c, buf < end - 1 ? get_le16_inc(&buf) : 0, return NULL; - ) + GET_UTF16(c, buf < end - 1 ? get_le16_inc(&buf) : 0, return NULL;) if (buf <= end && c == '\n') return buf - 1; } break; case 2: while (buf < end - 1) { - GET_UTF16(c, buf < end - 1 ? get_be16_inc(&buf) : 0, return NULL; - ) + GET_UTF16(c, buf < end - 1 ? get_be16_inc(&buf) : 0, return NULL;) if (buf <= end && c == '\n') return buf - 1; } @@ -667,6 +665,8 @@ static const uint8_t *find_newline(const uint8_t *buf, int len, int utf16) return NULL; } +#define EMPTY_STMT do{}while(0); + /** * Copy a number of bytes, converting to UTF-8 if input is UTF-16 * \param dst buffer to copy to @@ -691,20 +691,16 @@ static int copy_characters(uint8_t *dst, int dstsize, case 1: while (src < end - 1 && dst_end - dst > 8) { uint8_t tmp; - GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,; - ) - PUT_UTF8(c, tmp, *dst++ = tmp; - ) + GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0, EMPTY_STMT) + PUT_UTF8(c, tmp, *dst++ = tmp; EMPTY_STMT) } *len -= end - src; return dstsize - (dst_end - dst); case 2: while (src < end - 1 && dst_end - dst > 8) { uint8_t tmp; - GET_UTF16(c, src < end - 1 ? get_be16_inc(&src) : 0,; - ) - PUT_UTF8(c, tmp, *dst++ = tmp; - ) + GET_UTF16(c, src < end - 1 ? get_be16_inc(&src) : 0, EMPTY_STMT) + PUT_UTF8(c, tmp, *dst++ = tmp; EMPTY_STMT) } *len -= end - src; return dstsize - (dst_end - dst); |