mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 16:33:02 +00:00
stream: silence clang empty statement warnings
clang printed warnings like: stream/stream.c:692:65: warning: if statement has empty body [-Wempty-body] GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,; This macro expands to "if(cond) ;". Replace it with an empty statement that doesn't lead to a clang warning.
This commit is contained in:
parent
7ba6675847
commit
b242aa366b
@ -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);
|
return (uint8_t *)memchr(buf, '\n', len);
|
||||||
case 1:
|
case 1:
|
||||||
while (buf < end - 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')
|
if (buf <= end && c == '\n')
|
||||||
return buf - 1;
|
return buf - 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
while (buf < end - 1) {
|
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')
|
if (buf <= end && c == '\n')
|
||||||
return buf - 1;
|
return buf - 1;
|
||||||
}
|
}
|
||||||
@ -667,6 +665,8 @@ static const uint8_t *find_newline(const uint8_t *buf, int len, int utf16)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define EMPTY_STMT do{}while(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy a number of bytes, converting to UTF-8 if input is UTF-16
|
* Copy a number of bytes, converting to UTF-8 if input is UTF-16
|
||||||
* \param dst buffer to copy to
|
* \param dst buffer to copy to
|
||||||
@ -691,20 +691,16 @@ static int copy_characters(uint8_t *dst, int dstsize,
|
|||||||
case 1:
|
case 1:
|
||||||
while (src < end - 1 && dst_end - dst > 8) {
|
while (src < end - 1 && dst_end - dst > 8) {
|
||||||
uint8_t tmp;
|
uint8_t tmp;
|
||||||
GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,;
|
GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0, EMPTY_STMT)
|
||||||
)
|
PUT_UTF8(c, tmp, *dst++ = tmp; EMPTY_STMT)
|
||||||
PUT_UTF8(c, tmp, *dst++ = tmp;
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
*len -= end - src;
|
*len -= end - src;
|
||||||
return dstsize - (dst_end - dst);
|
return dstsize - (dst_end - dst);
|
||||||
case 2:
|
case 2:
|
||||||
while (src < end - 1 && dst_end - dst > 8) {
|
while (src < end - 1 && dst_end - dst > 8) {
|
||||||
uint8_t tmp;
|
uint8_t tmp;
|
||||||
GET_UTF16(c, src < end - 1 ? get_be16_inc(&src) : 0,;
|
GET_UTF16(c, src < end - 1 ? get_be16_inc(&src) : 0, EMPTY_STMT)
|
||||||
)
|
PUT_UTF8(c, tmp, *dst++ = tmp; EMPTY_STMT)
|
||||||
PUT_UTF8(c, tmp, *dst++ = tmp;
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
*len -= end - src;
|
*len -= end - src;
|
||||||
return dstsize - (dst_end - dst);
|
return dstsize - (dst_end - dst);
|
||||||
|
Loading…
Reference in New Issue
Block a user