]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sofia-lib: More Fix for -Wunused-but-set-variable required compiler. (Might need...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 24 Apr 2011 00:33:19 +0000 (20:33 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 24 Apr 2011 00:33:19 +0000 (20:33 -0400)
14 files changed:
libs/sofia-sip/libsofia-sip-ua/msg/msg_date.c
libs/sofia-sip/libsofia-sip-ua/nta/nta.c
libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c
libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c
libs/sofia-sip/libsofia-sip-ua/stun/stun.c
libs/sofia-sip/libsofia-sip-ua/stun/stun_dns.c
libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
libs/sofia-sip/libsofia-sip-ua/su/su_localinfo.c
libs/sofia-sip/libsofia-sip-ua/tport/tport.c
libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c
libs/sofia-sip/libsofia-sip-ua/url/url.c

index a665e9d495252363784f7e7f568fddfee9e18f52..5a8f354fa51f69ddb0a7cc95e19e9fa5896117cd 100644 (file)
@@ -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)) {
index 543f0e135a115e1de98f3995d9bcd7823d607581..b96ec2ba5bf657a6ddedda4efa14ae0a23d612cc 100644 (file)
@@ -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) {
index 032c0a04f2b73486f8da85b487a56b2558690ee4..a35669dd3b31eae9e75fc7bc5c147954e62b1e4d 100644 (file)
@@ -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)
index b6e0c013859fed4f48c2d42904156f8b210e73f8..6455f4b5c837cb5bfb9742c19b6957ad8f348377 100644 (file)
@@ -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;
index e2852b446b8d7e254b24af462da2da8ca9ed9188..e94c6b6758bbdbba2003d7c15b764e80e0c82807 100644 (file)
@@ -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);
   }
 
index e00d3912d8bbd74bfd1f6b8d92f025168ed15456..4152669bfde2667bbf89a1e440497c698a2240bd 100644 (file)
@@ -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;
index e494571f54f7ac3b30cd6c5dfd2de1e81de6159a..d719a68b90815a33d382ae2e441ff23e9d832a22 100644 (file)
@@ -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) {
index 09ecff41cb633019c1590cff5fb0907ac458318c..d2fabe33296875ac094a5ccef7f3b7fb7de3b0f7 100644 (file)
@@ -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:
index bfbfe77e412ca3cf38edafbbdfbb763b0bfbb799..86ef0b2c37c35d310fc29323e3190f70ddee4438 100644 (file)
@@ -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;
   }
index edc47e5da96a722ad158ead44068307a9e184eca..51259ade1a7802a4218abade642bd6b665c6d951 100644 (file)
@@ -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);
index de7279e4932950c67fe1debc543c8514b54f39d5..523599c7a773f618094a32c38716b35292c6e78e 100644 (file)
@@ -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;
 
index a33b77f3e2d3663bd83a594f7b4ad8d3efa76fb6..8ebab4fd316ea5742bc88b9a388b3acec06cddb6 100644 (file)
@@ -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);
index 55f67a9e2c66e4e4042f9b6ec8ac251a4ba06eb2..3233e1c616ab14c21e9be01d3f6d1a3b80943a6a 100644 (file)
@@ -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);
index bef523e5c92c818179bdbb3620b642901286b39c..71544735e11d1ffcfd33bb43a1a28b66930ef0bf 100644 (file)
@@ -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] == ':') {