Skip to content

Commit

Permalink
RTC: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 8, 2020
1 parent 5309dbe commit c7c6d87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ srs_error_t SrsSslConnection::read(void* plaintext, size_t nn_plaintext, ssize_t

// OK, got data.
if (r0 > 0) {
srs_assert(r0 <= nn_plaintext);
srs_assert(r0 <= (int)nn_plaintext);
if (nread) {
*nread = r0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_rtc_dtls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ srs_error_t SrsDtlsClientImpl::cycle()
srs_error_t err = srs_success;

// Limit the max retry for ARQ.
for (int i = 0; i < sizeof(arq_to_ratios) / sizeof(int); i++) {
for (int i = 0; i < (int)(sizeof(arq_to_ratios) / sizeof(int)); i++) {
srs_utime_t arq_to = arq_interval * arq_to_ratios[i];
srs_usleep(arq_to);

Expand Down
12 changes: 6 additions & 6 deletions trunk/src/protocol/srs_http_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,12 @@ namespace {
bool has_plus = false;
int i = 0;
// Count %, check that they're well-formed.
while(i < s.length()) {
while(i < (int)s.length()) {
switch (s.at(i)) {
case '%':
{
n++;
if((i+2) >= s.length() || !ishex(s.at(i+1)) || !ishex(s.at(i+2))) {
if((i+2) >= (int)s.length() || !ishex(s.at(i+1)) || !ishex(s.at(i+2))) {
string msg = s.substr(i);
if(msg.length() > 3) {
msg = msg.substr(0, 3);
Expand Down Expand Up @@ -1250,7 +1250,7 @@ namespace {

value.clear();
//value.resize(s.length() - 2*n);
for(int i = 0; i < s.length(); ++i) {
for(int i = 0; i < (int)s.length(); ++i) {
switch(s.at(i)) {
case '%':
value += (hex_to_num(s.at(i+1))<<4 | hex_to_num(s.at(i+2)));
Expand All @@ -1275,7 +1275,7 @@ namespace {
string escape(string s, EncodeMode mode) {
int space_count = 0;
int hex_count = 0;
for(int i = 0; i < s.length(); ++i) {
for(int i = 0; i < (int)s.length(); ++i) {
uint8_t c = s.at(i);
if(should_escape(c, mode)) {
if(' ' == c && encodeQueryComponent == mode) {
Expand All @@ -1293,7 +1293,7 @@ namespace {
string value;
if(0 == hex_count) {
value = s;
for(int i = 0; i < s.length(); ++i) {
for(int i = 0; i < (int)s.length(); ++i) {
if(' ' == s.at(i)) {
value[i] = '+';
}
Expand All @@ -1304,7 +1304,7 @@ namespace {
//value.resize(s.length() + 2*hex_count);
const char escape_code[] = "0123456789ABCDEF";
//int j = 0;
for(int i = 0; i < s.length(); ++i) {
for(int i = 0; i < (int)s.length(); ++i) {
uint8_t c = s.at(i);
if(' ' == c && encodeQueryComponent == mode) {
value += '+';
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/protocol/srs_service_http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ srs_error_t SrsSslClient::read(void* plaintext, size_t nn_plaintext, ssize_t* nr

// OK, got data.
if (r0 > 0) {
srs_assert(r0 <= nn_plaintext);
srs_assert(r0 <= (int)nn_plaintext);
if (nread) {
*nread = r0;
}
Expand Down

0 comments on commit c7c6d87

Please sign in to comment.