sofia-lib: More Fix for -Wunused-but-set-variable required compiler. (Might need to be ported back to sofia)
This commit is contained in:
parent
d3e3b39739
commit
626a99f994
|
@ -182,7 +182,7 @@ int time_d(char const **ss,
|
|||
issize_t msg_date_d(char const **ss, msg_time_t *date)
|
||||
{
|
||||
char const *s = *ss;
|
||||
char const *wkday;
|
||||
//char const *wkday;
|
||||
char const *tz;
|
||||
unsigned long day, year, hour, min, sec;
|
||||
int mon;
|
||||
|
@ -190,7 +190,8 @@ issize_t msg_date_d(char const **ss, msg_time_t *date)
|
|||
if (!IS_TOKEN(*s) || !date)
|
||||
return -1;
|
||||
|
||||
wkday = s; skip_token(&s); if (*s == ',') s++;
|
||||
//wkday = s;
|
||||
skip_token(&s); if (*s == ',') s++;
|
||||
while (IS_LWS(*s)) s++;
|
||||
|
||||
if (is_digit(*s)) {
|
||||
|
|
|
@ -2307,7 +2307,7 @@ int agent_init_via(nta_agent_t *self, tport_t *primaries, int use_maddr)
|
|||
|
||||
/* Set via fields for the tports */
|
||||
for (tp = primaries; tp; tp = tport_next(tp)) {
|
||||
int maddr, first_via;
|
||||
int maddr;
|
||||
tp_name_t tpn[1];
|
||||
char const *comp = NULL;
|
||||
|
||||
|
@ -2339,8 +2339,6 @@ int agent_init_via(nta_agent_t *self, tport_t *primaries, int use_maddr)
|
|||
|
||||
if (tport_has_tls(tp)) self->sa_tport_tls = 1;
|
||||
|
||||
first_via = 1;
|
||||
|
||||
ai = tport_get_address(tp);
|
||||
|
||||
for (; ai; ai = ai->ai_next) {
|
||||
|
|
|
@ -1743,7 +1743,7 @@ static int nua_prack_client_request(nua_client_request_t *cr,
|
|||
nua_client_request_t *cri;
|
||||
int offer_sent = 0, answer_sent = 0, retval;
|
||||
int status = 0; char const *phrase = "PRACK Sent";
|
||||
uint32_t rseq = 0;
|
||||
//uint32_t rseq = 0;
|
||||
|
||||
if (du == NULL) /* Call terminated */
|
||||
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
|
||||
|
@ -1754,8 +1754,8 @@ static int nua_prack_client_request(nua_client_request_t *cr,
|
|||
|
||||
cri = du->du_cr;
|
||||
|
||||
if (sip->sip_rack)
|
||||
rseq = sip->sip_rack->ra_response;
|
||||
// if (sip->sip_rack)
|
||||
// rseq = sip->sip_rack->ra_response;
|
||||
|
||||
if (cri->cr_offer_recv && !cri->cr_answer_sent) {
|
||||
if (nh->nh_soa == NULL)
|
||||
|
|
|
@ -1883,12 +1883,11 @@ static char *next(char **message, const char *sep, const char *strip)
|
|||
|
||||
static int parsing_error(sdp_parser_t *p, char const *fmt, ...)
|
||||
{
|
||||
int n;
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
||||
memset(p->pr_error, 0, sizeof(p->pr_error));
|
||||
n = vsnprintf(p->pr_error, sizeof(p->pr_error), fmt, ap);
|
||||
vsnprintf(p->pr_error, sizeof(p->pr_error), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
p->pr_ok = 0;
|
||||
|
|
|
@ -685,9 +685,8 @@ static void printing_error(sdp_printer_t *p, const char *fmt, ...)
|
|||
va_list ap;
|
||||
|
||||
if (p->pr_ok) {
|
||||
int n;
|
||||
va_start(ap, fmt);
|
||||
n = vsnprintf(p->pr_buffer, p->pr_bsiz, fmt, ap);
|
||||
vsnprintf(p->pr_buffer, p->pr_bsiz, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
|
|
@ -1010,7 +1010,6 @@ int soa_sdp_mode_set(sdp_session_t const *user,
|
|||
int retval = 0, i, j;
|
||||
int hold_all;
|
||||
int inactive_all;
|
||||
int inactive = 0;
|
||||
char const *hold_media = NULL;
|
||||
sdp_mode_t send_mode, recv_mode;
|
||||
|
||||
|
@ -1029,7 +1028,6 @@ int soa_sdp_mode_set(sdp_session_t const *user,
|
|||
|
||||
for (sm = session->sdp_media; sm; sm = sm->m_next, rm = rm_next, i++) {
|
||||
rm_next = rm ? rm->m_next : NULL;
|
||||
inactive = 0;
|
||||
|
||||
if (sm->m_rejected)
|
||||
continue;
|
||||
|
|
|
@ -3632,10 +3632,10 @@ sres_decode_msg(sres_resolver_t *res,
|
|||
* for the side effects in m */
|
||||
for (i = 0; i < m->m_qdcount; i++) {
|
||||
char name[1024];
|
||||
uint16_t qtype, qclass;
|
||||
//uint16_t qtype, qclass;
|
||||
m_get_domain(name, sizeof(name), m, 0); /* Query domain */
|
||||
qtype = m_get_uint16(m); /* Query type */
|
||||
qclass = m_get_uint16(m); /* Query class */
|
||||
//qtype = m_get_uint16(m); /* Query type */
|
||||
//qclass = m_get_uint16(m); /* Query class */
|
||||
}
|
||||
|
||||
if (m->m_error) {
|
||||
|
|
|
@ -673,12 +673,12 @@ static stun_request_t *stun_request_create(stun_discovery_t *sd)
|
|||
|
||||
void stun_request_destroy(stun_request_t *req)
|
||||
{
|
||||
stun_handle_t *sh;
|
||||
//stun_handle_t *sh;
|
||||
assert(req);
|
||||
|
||||
enter;
|
||||
|
||||
sh = req->sr_handle;
|
||||
//sh = req->sr_handle;
|
||||
|
||||
if (x_is_inserted(req, sr))
|
||||
x_remove(req, sr);
|
||||
|
@ -1140,14 +1140,14 @@ static stun_discovery_t *stun_discovery_create(stun_handle_t *sh,
|
|||
|
||||
static int stun_discovery_destroy(stun_discovery_t *sd)
|
||||
{
|
||||
stun_handle_t *sh;
|
||||
//stun_handle_t *sh;
|
||||
|
||||
enter;
|
||||
|
||||
if (!sd)
|
||||
return errno = EFAULT, -1;
|
||||
|
||||
sh = sd->sd_handle;
|
||||
//sh = sd->sd_handle;
|
||||
|
||||
if (sd->sd_timer)
|
||||
su_timer_destroy(sd->sd_timer), sd->sd_timer = NULL;
|
||||
|
@ -1883,7 +1883,7 @@ static int process_test_lifetime(stun_request_t *req, stun_msg_t *binding_respon
|
|||
stun_discovery_t *sd = req->sr_discovery;
|
||||
stun_request_t *new;
|
||||
stun_handle_t *sh = req->sr_handle;
|
||||
su_localinfo_t *li;
|
||||
//su_localinfo_t *li;
|
||||
su_sockaddr_t *sa;
|
||||
su_timer_t *sockfdy_timer = NULL;
|
||||
su_socket_t sockfdy = sd->sd_socket2;
|
||||
|
@ -1954,7 +1954,7 @@ static int process_test_lifetime(stun_request_t *req, stun_msg_t *binding_respon
|
|||
/* Rock, we come from sockfdx */
|
||||
process_binding_request(req, binding_response);
|
||||
|
||||
li = &req->sr_localinfo;
|
||||
//li = &req->sr_localinfo;
|
||||
sa = req->sr_local_addr;
|
||||
stun_free_message(binding_response);
|
||||
|
||||
|
@ -1981,7 +1981,7 @@ static int process_test_lifetime(stun_request_t *req, stun_msg_t *binding_respon
|
|||
|
||||
static int action_bind(stun_request_t *req, stun_msg_t *binding_response)
|
||||
{
|
||||
su_localinfo_t *li = NULL;
|
||||
//su_localinfo_t *li = NULL;
|
||||
su_sockaddr_t *sa = NULL;
|
||||
stun_discovery_t *sd = req->sr_discovery;
|
||||
stun_handle_t *sh = req->sr_handle;
|
||||
|
@ -1992,7 +1992,7 @@ static int action_bind(stun_request_t *req, stun_msg_t *binding_response)
|
|||
|
||||
process_binding_request(req, binding_response);
|
||||
|
||||
li = &req->sr_localinfo;
|
||||
//li = &req->sr_localinfo;
|
||||
sa = req->sr_local_addr;
|
||||
|
||||
memcpy(sd->sd_addr_seen_outside, sa, sizeof(su_sockaddr_t));
|
||||
|
@ -3039,7 +3039,7 @@ int stun_process_request(su_socket_t s, stun_msg_t *req,
|
|||
su_sockaddr_t mod_addr[1] = {{ 0 }}, src_addr[1] = {{ 0 }}, chg_addr[1] = {{ 0 }};
|
||||
stun_attr_t *tmp, m_attr[1], s_attr[1], c_attr[1], **p;
|
||||
su_sockaddr_t to_addr;
|
||||
int c, i;
|
||||
int i;
|
||||
|
||||
tmp = stun_get_attr(req->stun_attr, RESPONSE_ADDRESS);
|
||||
|
||||
|
@ -3071,20 +3071,20 @@ int stun_process_request(su_socket_t s, stun_msg_t *req,
|
|||
/* SOURCE-ADDRESS depends on CHANGE_REQUEST */
|
||||
tmp = stun_get_attr(req->stun_attr, CHANGE_REQUEST);
|
||||
if (!tmp) {
|
||||
c = 0;
|
||||
//c = 0;
|
||||
}
|
||||
else {
|
||||
switch (((stun_attr_changerequest_t *) tmp->pattr)->value) {
|
||||
case STUN_CR_CHANGE_IP:
|
||||
c = 1;
|
||||
//c = 1;
|
||||
break;
|
||||
|
||||
case STUN_CR_CHANGE_PORT:
|
||||
c = 2;
|
||||
//c = 2;
|
||||
break;
|
||||
|
||||
case STUN_CR_CHANGE_IP | STUN_CR_CHANGE_PORT: /* bitwise or */
|
||||
c = 3;
|
||||
//c = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -163,7 +163,10 @@ stun_dns_lookup_t *stun_dns_lookup(stun_magic_t *magic,
|
|||
query = sres_query(self->stun_sres, priv_sres_cb, self,
|
||||
sres_type_srv,
|
||||
srvname);
|
||||
}
|
||||
if (query) {
|
||||
/* TODO Just so compiler doesn't give error */
|
||||
}
|
||||
}
|
||||
else {
|
||||
su_free(NULL, self), self = NULL;
|
||||
}
|
||||
|
|
|
@ -429,13 +429,13 @@ void *sub_alloc(su_home_t *home,
|
|||
|
||||
if (sub == NULL || 3 * sub->sub_used > 2 * sub->sub_n) {
|
||||
/* Resize the hash table */
|
||||
size_t i, n, n2, used;
|
||||
size_t i, n, n2;
|
||||
su_block_t *b2;
|
||||
|
||||
if (sub)
|
||||
n = home->suh_blocks->sub_n, n2 = 4 * n + 3, used = sub->sub_used;
|
||||
n = home->suh_blocks->sub_n, n2 = 4 * n + 3; //, used = sub->sub_used;
|
||||
else
|
||||
n = 0, n2 = SUB_N, used = 0;
|
||||
n = 0, n2 = SUB_N; //, used = 0;
|
||||
|
||||
#if 0
|
||||
printf("su_alloc(home = %p): realloc block hash of size %d\n", home, n2);
|
||||
|
|
|
@ -194,7 +194,8 @@ static void li_sort(su_localinfo_t *i, su_localinfo_t **rresult);
|
|||
int su_getlocalinfo(su_localinfo_t const *hints,
|
||||
su_localinfo_t **return_localinfo)
|
||||
{
|
||||
int error = 0, ip4 = 0, ip6 = 0;
|
||||
int error = 0, ip4 = 0;
|
||||
int ip6 = 0;
|
||||
su_localinfo_t *result = NULL, **rr = &result;
|
||||
su_localinfo_t hh[1] = {{ 0 }};
|
||||
|
||||
|
@ -231,7 +232,11 @@ int su_getlocalinfo(su_localinfo_t const *hints,
|
|||
break;
|
||||
|
||||
case 0:
|
||||
ip6 = ip4 = 1;
|
||||
ip4 = 1;
|
||||
#if SU_HAVE_IN6
|
||||
ip6 = 1;
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -260,6 +265,9 @@ int su_getlocalinfo(su_localinfo_t const *hints,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (ip6) {
|
||||
/* Required to make compiler happy */
|
||||
}
|
||||
if (!result)
|
||||
error = ELI_NOADDRESS;
|
||||
|
||||
|
|
|
@ -1595,7 +1595,7 @@ int tport_bind_server(tport_master_t *mr,
|
|||
{
|
||||
char hostname[TPORT_HOSTPORTSIZE];
|
||||
char const *canon = NULL, *host, *service;
|
||||
int error = 0, not_supported, family = 0;
|
||||
int error = 0, family = 0;
|
||||
tport_primary_t *pri = NULL, **tbf;
|
||||
su_addrinfo_t *ai, *res = NULL;
|
||||
unsigned port, port0, port1, old;
|
||||
|
@ -1691,8 +1691,6 @@ int tport_bind_server(tport_master_t *mr,
|
|||
break;
|
||||
}
|
||||
|
||||
not_supported = 0;
|
||||
|
||||
if (port0 == 0 && port == 0) {
|
||||
port = port1 = ntohs(su->su_port);
|
||||
assert(public != tport_type_server || port != 0);
|
||||
|
|
|
@ -170,10 +170,10 @@ void tport_stun_bind_cb(tport_primary_t *pri,
|
|||
stun_action_t action,
|
||||
stun_state_t event)
|
||||
{
|
||||
tport_master_t *mr;
|
||||
//tport_master_t *mr;
|
||||
SU_DEBUG_3(("%s: %s\n", __func__, stun_str_state(event)));
|
||||
|
||||
mr = pri->pri_master;
|
||||
//mr = pri->pri_master;
|
||||
|
||||
if (event == stun_discovery_done) {
|
||||
tport_stun_bind_done(pri, sh, sd);
|
||||
|
|
|
@ -567,7 +567,7 @@ static
|
|||
int _url_d(url_t *url, char *s)
|
||||
{
|
||||
size_t n, p;
|
||||
char *s0, rest_c, *host, *user;
|
||||
char rest_c, *host, *user;
|
||||
int have_authority = 1;
|
||||
|
||||
memset(url, 0, sizeof(*url));
|
||||
|
@ -578,8 +578,6 @@ int _url_d(url_t *url, char *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
s0 = s;
|
||||
|
||||
n = strcspn(s, ":/?#");
|
||||
|
||||
if (n && s[n] == ':') {
|
||||
|
|
Loading…
Reference in New Issue