1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00

Fix build warnings

This commit is contained in:
winlin 2021-01-08 11:48:56 +08:00
parent 473942c6f6
commit 61f62ceec6
3 changed files with 5 additions and 5 deletions

View file

@ -77,7 +77,7 @@ extern srs_utime_t _srs_tmp_timeout;
// For init array data.
#define HELPER_ARRAY_INIT(buf, sz, val) \
for (int _iii = 0; _iii < sz; _iii++) (buf)[_iii] = val
for (int _iii = 0; _iii < (int)sz; _iii++) (buf)[_iii] = val
// Dump simple stream to string.
#define HELPER_BUFFER2STR(io) \

View file

@ -1966,7 +1966,7 @@ VOID TEST(ProtocolHTTPTest, QueryEscape)
{"a%20b", "a b", srs_success}
};
for(int i = 0; i < (sizeof(unescape) / sizeof(struct EscapeTest)); ++i) {
for(int i = 0; i < (int)(sizeof(unescape) / sizeof(struct EscapeTest)); ++i) {
struct EscapeTest& d = unescape[i];
string value;
if(srs_success == d.err) {
@ -1988,7 +1988,7 @@ VOID TEST(ProtocolHTTPTest, QueryEscape)
{" ?&=#+%!<>#\"{}|\\^[]`☺\t:/@$'()*,;",
"+%3F%26%3D%23%2B%25%21%3C%3E%23%22%7B%7D%7C%5C%5E%5B%5D%60%E2%98%BA%09%3A%2F%40%24%27%28%29%2A%2C%3B", srs_success},
};
for(int i = 0; i < (sizeof(escape) / sizeof(struct EscapeTest)); ++i) {
for(int i = 0; i < (int)(sizeof(escape) / sizeof(struct EscapeTest)); ++i) {
struct EscapeTest& d = escape[i];
EXPECT_STREQ(d.out.c_str(), SrsHttpUri::query_escape(d.in).c_str());
@ -2014,7 +2014,7 @@ VOID TEST(ProtocolHTTPTest, PathEscape)
srs_success},
};
for(int i = 0; i < (sizeof(path) / sizeof(struct EscapeTest)); ++i) {
for(int i = 0; i < (int)(sizeof(path) / sizeof(struct EscapeTest)); ++i) {
struct EscapeTest& d = path[i];
EXPECT_STREQ(d.out.c_str(), SrsHttpUri::path_escape(d.in).c_str());

View file

@ -2440,7 +2440,7 @@ VOID TEST(KernelUtility, Base64)
{"Twas brillig, and the slithy toves", "VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw=="}
};
for(int i = 0; i < (sizeof(data) / sizeof(struct testpair)); ++i) {
for(int i = 0; i < (int)(sizeof(data) / sizeof(struct testpair)); ++i) {
struct testpair& d = data[i];
string cipher;
HELPER_EXPECT_SUCCESS(srs_av_base64_encode(d.decoded, cipher));