From 7ffa781dc39a7274692d8db11043b3a9e92e36ce Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 25 Aug 2015 08:45:46 +0000 Subject: Re #1881: Fixed compile warnings on VS2015 about declaration hides previous declaration. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5170 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath-test/server.c | 2 +- pjnath/src/pjnath-test/stun.c | 16 ++++++++-------- pjnath/src/pjnath/ice_session.c | 22 +++++++++++----------- pjnath/src/pjnath/turn_session.c | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'pjnath') diff --git a/pjnath/src/pjnath-test/server.c b/pjnath/src/pjnath-test/server.c index 0b07180d..7491d9da 100644 --- a/pjnath/src/pjnath-test/server.c +++ b/pjnath/src/pjnath-test/server.c @@ -424,7 +424,7 @@ static pj_bool_t turn_on_data_recvfrom(pj_activesock_t *asock, //pj_str_t ip_addr; pj_stun_username_attr *uname; pj_activesock_cb alloc_sock_cb; - turn_allocation *alloc; + ///turn_allocation *alloc; /* Must be Allocate request */ if (req->hdr.type != PJ_STUN_ALLOCATE_REQUEST) { diff --git a/pjnath/src/pjnath-test/stun.c b/pjnath/src/pjnath-test/stun.c index c530cf1c..51afc0dd 100644 --- a/pjnath/src/pjnath-test/stun.c +++ b/pjnath/src/pjnath-test/stun.c @@ -692,7 +692,7 @@ static int fingerprint_test_vector() if (v->options & USE_MESSAGE_INTEGRITY) { if (PJ_STUN_IS_REQUEST(msg->hdr.type)) { pj_stun_auth_cred cred; - pj_status_t status; + pj_status_t status2; pj_bzero(&cred, sizeof(cred)); cred.type = PJ_STUN_AUTH_CRED_STATIC; @@ -701,11 +701,11 @@ static int fingerprint_test_vector() cred.data.static_cred.data = pj_str(v->password); cred.data.static_cred.nonce = pj_str(v->nonce); - status = pj_stun_authenticate_request(buf, (unsigned)len, msg, + status2 = pj_stun_authenticate_request(buf, (unsigned)len, msg, &cred, pool, NULL, NULL); - if (status != PJ_SUCCESS) { + if (status2 != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror(status, errmsg, sizeof(errmsg)); + pj_strerror(status2, errmsg, sizeof(errmsg)); PJ_LOG(1,(THIS_FILE, " Request authentication failed: %s", errmsg)); @@ -714,12 +714,12 @@ static int fingerprint_test_vector() } } else if (PJ_STUN_IS_RESPONSE(msg->hdr.type)) { - pj_status_t status; - status = pj_stun_authenticate_response(buf, (unsigned)len, + pj_status_t status2; + status2 = pj_stun_authenticate_response(buf, (unsigned)len, msg, &key); - if (status != PJ_SUCCESS) { + if (status2 != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror(status, errmsg, sizeof(errmsg)); + pj_strerror(status2, errmsg, sizeof(errmsg)); PJ_LOG(1,(THIS_FILE, " Response authentication failed: %s", errmsg)); diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index f3137c9d..d2b9dcdb 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -1600,8 +1600,8 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( pj_ice_sess *ice, const pj_str_t *rem_ufrag, const pj_str_t *rem_passwd, - unsigned rcand_cnt, - const pj_ice_sess_cand rcand[]) + unsigned rem_cand_cnt, + const pj_ice_sess_cand rem_cand[]) { pj_ice_sess_checklist *clist; char buf[128]; @@ -1611,9 +1611,9 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( unsigned highest_comp = 0; pj_status_t status; - PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && rcand_cnt && rcand, - PJ_EINVAL); - PJ_ASSERT_RETURN(rcand_cnt + ice->rcand_cnt <= PJ_ICE_MAX_CAND, + PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && rem_cand_cnt && + rem_cand, PJ_EINVAL); + PJ_ASSERT_RETURN(rem_cand_cnt + ice->rcand_cnt <= PJ_ICE_MAX_CAND, PJ_ETOOMANY); pj_grp_lock_acquire(ice->grp_lock); @@ -1638,19 +1638,19 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( /* Save remote candidates */ ice->rcand_cnt = 0; - for (i=0; ircand[ice->rcand_cnt]; /* Ignore candidate which has no matching component ID */ - if (rcand[i].comp_id==0 || rcand[i].comp_id > ice->comp_cnt) { + if (rem_cand[i].comp_id==0 || rem_cand[i].comp_id > ice->comp_cnt) { continue; } - if (rcand[i].comp_id > highest_comp) - highest_comp = rcand[i].comp_id; + if (rem_cand[i].comp_id > highest_comp) + highest_comp = rem_cand[i].comp_id; - pj_memcpy(cn, &rcand[i], sizeof(pj_ice_sess_cand)); - pj_strdup(ice->pool, &cn->foundation, &rcand[i].foundation); + pj_memcpy(cn, &rem_cand[i], sizeof(pj_ice_sess_cand)); + pj_strdup(ice->pool, &cn->foundation, &rem_cand[i].foundation); ice->rcand_cnt++; } diff --git a/pjnath/src/pjnath/turn_session.c b/pjnath/src/pjnath/turn_session.c index 8ab3e315..b53a967c 100644 --- a/pjnath/src/pjnath/turn_session.c +++ b/pjnath/src/pjnath/turn_session.c @@ -1291,7 +1291,6 @@ static void on_allocate_success(pj_turn_session *sess, const pj_stun_xor_relayed_addr_attr *raddr_attr; const pj_stun_sockaddr_attr *mapped_attr; pj_str_t s; - pj_time_val timeout; /* Must have LIFETIME attribute */ lf_attr = (const pj_stun_lifetime_attr*) @@ -1396,6 +1395,7 @@ static void on_allocate_success(pj_turn_session *sess, /* Start keep-alive timer once allocation succeeds */ if (sess->state < PJ_TURN_STATE_DEALLOCATING) { + pj_time_val timeout; timeout.sec = sess->ka_interval; timeout.msec = 0; @@ -1771,14 +1771,14 @@ static struct ch_t *lookup_ch_by_addr(pj_turn_session *sess, ch->expiry.sec += PJ_TURN_PERM_TIMEOUT - sess->ka_interval - 1; if (bind_channel) { - pj_uint32_t hval = 0; + pj_uint32_t hval2 = 0; /* Register by channel number */ pj_assert(ch->num != PJ_TURN_INVALID_CHANNEL && ch->bound); if (pj_hash_get(sess->ch_table, &ch->num, - sizeof(ch->num), &hval)==0) { + sizeof(ch->num), &hval2)==0) { pj_hash_set(sess->pool, sess->ch_table, &ch->num, - sizeof(ch->num), hval, ch); + sizeof(ch->num), hval2, ch); } } } -- cgit v1.2.3