]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
silence clang unused function warnings and get rid of some unused functions
authorMichael Jerris <mike@jerris.com>
Thu, 1 May 2014 13:03:19 +0000 (09:03 -0400)
committerMichael Jerris <mike@jerris.com>
Thu, 1 May 2014 13:03:19 +0000 (09:03 -0400)
libs/sofia-sip/libsofia-sip-ua/iptsec/auth_module.c
libs/sofia-sip/libsofia-sip-ua/nta/nta.c
libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c
libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c
libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c
libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c
libs/sofia-sip/libsofia-sip-ua/sresolv/sres_cache.c
libs/sofia-sip/libsofia-sip-ua/su/su_timer.c
libs/sofia-sip/libsofia-sip-ua/tport/tport.c

index 9c1ca218b5634a4d6ea299b0810ca45b727916e9..9d29957cf0f022de97ddcb26e6756cdec5fe3016 100644 (file)
@@ -80,10 +80,19 @@ char const auth_internal_server_error[] = "Internal server error";
 static void auth_call_scheme_destructor(void *);
 static void auth_md5_hmac_key(auth_mod_t *am);
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_PROTOS_WITH(auth_htable, aht, auth_passwd_t, usize_t, unsigned);
 HTABLE_BODIES_WITH(auth_htable, aht, auth_passwd_t, APW_HASH,
                   usize_t, unsigned);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 /**Allocate an authentication module instance.
  *
  * The function auth_mod_alloc() allocates an authentication module object.
index d1a3e68cabbd0e982508ba9b3f715a956c759f3d..98d1ad25e16c7f4a847c478b9fbae317aed998bb 100644 (file)
@@ -4124,7 +4124,18 @@ static int leg_route(nta_leg_t *leg,
 static int leg_callback_default(nta_leg_magic_t*, nta_leg_t*,
                                nta_incoming_t*, sip_t const *);
 #define HTABLE_HASH_LEG(leg) ((leg)->leg_hash)
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_BODIES_WITH(leg_htable, lht, nta_leg_t, HTABLE_HASH_LEG, size_t, hash_value_t);
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 su_inline
 hash_value_t hash_istring(char const *, char const *, hash_value_t);
 
@@ -4881,6 +4892,7 @@ void leg_recv(nta_leg_t *leg, msg_t *msg, sip_t *sip, tport_t *tport)
     nta_incoming_destroy(irq);
 }
 
+#if 0
 /**Compare two SIP from/to fields.
  *
  * @retval nonzero if matching.
@@ -4897,6 +4909,7 @@ int addr_cmp(url_t const *a, url_t const *b)
       su_strcmp(a->url_port, b->url_port) ||
       su_strcmp(a->url_user, b->url_user);
 }
+#endif
 
 /** Get a leg by dialog.
  *
@@ -7207,9 +7220,18 @@ size_t incoming_mass_destroy(nta_agent_t *sa, incoming_queue_t *q)
 
 #define HTABLE_HASH_ORQ(orq) ((orq)->orq_hash)
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_BODIES_WITH(outgoing_htable, oht, nta_outgoing_t, HTABLE_HASH_ORQ,
                   size_t, hash_value_t);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 static int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq,
                              msg_t *msg, sip_t *sip,
                              tagi_t *tags);
@@ -10224,8 +10246,7 @@ su_inline void outgoing_destroy_resolver(nta_outgoing_t *orq)
 
   assert(orq->orq_resolver);
 
-  if (sr->sr_query)    /* Cancel resolver query */
-    sres_query_bind(sr->sr_query, NULL, NULL), sr->sr_query = NULL;
+  outgoing_cancel_resolver(orq);
 
   su_free(orq->orq_agent->sa_home, sr);
 
index 6a2cd5f80b152810059eead0975c715e611a5360..8b8d856ae3c48cf76365dc8c99922dfcf0d5acca 100644 (file)
@@ -243,9 +243,19 @@ static int hc_recv(nth_client_t * hc, msg_t *msg, http_t * http);
 HTABLE_PROTOS_WITH(hc_htable, hct, nth_client_t, uintptr_t, size_t);
 
 #define HTABLE_HASH_CLIENT(hc) ((uintptr_t)(hc)->hc_tport)
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_BODIES_WITH(hc_htable, hct, nth_client_t, HTABLE_HASH_CLIENT,
                   uintptr_t, size_t);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 static url_string_t const *hc_request_complete(nth_client_t * hc,
                                               msg_t *msg, http_t * http,
                                               http_method_t method,
index 0c9b6182dc8ef5af2c7be70ae8a098647eeccd0a..bbc61c46deee562ca74bce98a949054ec5bd5ab2 100644 (file)
@@ -200,9 +200,6 @@ static char const __func__[] = "nth";
 static server_t *server_create(url_t const *url,
                               tag_type_t tag, tag_value_t value, ...);
 void server_destroy(server_t *srv);
-su_inline int server_timer_init(server_t *srv);
-static void server_timer(su_root_magic_t *rm, su_timer_t *timer, server_t *srv);
-su_inline uint32_t server_now(server_t const *srv);
 static void server_request(server_t *srv, tport_t *tport, msg_t *msg,
                                    void *arg, su_time_t now);
 static nth_site_t **site_get_host(nth_site_t **, char const *host, char const *port);
@@ -775,44 +772,6 @@ void server_destroy(server_t *srv)
   su_home_unref(srv->srv_home);
 }
 
-/** Initialize server timer. */
-su_inline
-int server_timer_init(server_t *srv)
-{
-  if (0) {
-    srv->srv_timer = su_timer_create(su_root_task(srv->srv_root), SERVER_TICK);
-    return su_timer_set(srv->srv_timer, server_timer, srv);
-  }
-  return 0;
-}
-
-/**
- * Server timer routine.
- */
-static
-void server_timer(su_root_magic_t *rm, su_timer_t *timer, server_t *srv)
-{
-  uint32_t now;
-
-  su_timer_set(timer, server_timer, srv);
-
-  now = su_time_ms(su_now()); now += now == 0; srv->srv_now = now;
-
-  /* Xyzzy */
-
-  srv->srv_now = 0;
-}
-
-/** Get current timestamp in milliseconds */
-su_inline
-uint32_t server_now(server_t const *srv)
-{
-  if (srv->srv_now)
-    return srv->srv_now;
-  else
-    return su_time_ms(su_now());
-}
-
 /** Process incoming request message */
 static
 void server_request(server_t *srv,
index d9d09536acf04e7423ffd28eb6b60325f033f180..0e8c0dd64f8f4e280bd5433ef3f594d2576831f1 100644 (file)
@@ -63,7 +63,9 @@
 
 #include <sofia-sip/su_wait.h>
 
+#if 0
 su_inline int can_redirect(sip_contact_t const *m, sip_method_t method);
+#endif
 
 /**@internal
  *
@@ -1259,6 +1261,7 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
   return 0;  /* This was a final response that cannot be restarted. */
 }
 
+#if 0
 su_inline
 int can_redirect(sip_contact_t const *m, sip_method_t method)
 {
@@ -1274,6 +1277,7 @@ int can_redirect(sip_contact_t const *m, sip_method_t method)
   }
   return 0;
 }
+#endif
 
 /** @internal Add authorization data */
 static int nh_authorize(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...)
index c6751f55500d835b74b523184195d929cf6011a8..933d76249e327ab49f70861b623983b3b76c082d 100644 (file)
@@ -4590,12 +4590,6 @@ session_timer_set(nua_session_usage_t *ss, int uas)
   }
 }
 
-su_inline int
-session_timer_has_been_set(struct session_timer const *t)
-{
-  return t->timer_set;
-}
-
 /* ======================================================================== */
 
 /** Get SDP from a SIP message.
index 88a7fd389beb6f018024ffdcdc3bd4a46ab118ca..a06650b13e76218fceb08c6e0731e93e54c653fb 100644 (file)
@@ -1705,9 +1705,18 @@ sres_resolver_destructor(void *arg)
     res->res_updcb(res->res_async, INVALID_SOCKET, INVALID_SOCKET);
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_BODIES_WITH(sres_qtable, qt, sres_query_t, SRES_QUERY_HASH,
                   unsigned, size_t);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 /** Allocate a query structure */
 static
 sres_query_t *
index be07d61c7db0d692665cfd2f05f7b03ec3e89c7b..fdd51fd5370b8223b5f70c0035150ebb1bcb7ce0 100644 (file)
@@ -648,9 +648,18 @@ int sres_cache_set_srv_priority(sres_cache_t *cache,
   return ret;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HTABLE_BODIES_WITH(sres_htable, ht, sres_rr_hash_entry_t, SRES_HENTRY_HASH,
                   unsigned, size_t);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 static inline
 int sres_heap_earlier_entry(sres_rr_hash_entry_t const *a,
                            sres_rr_hash_entry_t const *b)
@@ -667,6 +676,11 @@ void sres_heap_set_entry(sres_rr_hash_entry_t **heap,
   heap[index] = entry;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HEAP_BODIES(static inline,
            sres_heap_t,
            sres_heap_,
@@ -675,3 +689,7 @@ HEAP_BODIES(static inline,
            sres_heap_set_entry,
            su_realloc,
            NULL);
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
index 54882e397b6e524938a82af15eaa182047cf5f52..0900afc60e576b3c5e58e53ed601ddb58147b3d4 100644 (file)
@@ -203,9 +203,18 @@ su_inline void *timers_alloc(void *argument, void *memory, size_t size)
     return free(memory), NULL;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
 HEAP_BODIES(su_inline, su_timer_queue_t, timers_, su_timer_t *,
            timers_less, timers_set, timers_alloc, NULL);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 /**@internal Set the timer.
  *
  * @retval 0 when successful (always)
index dd9c40c8020c6111b2ff357f9e9161913b010f6e..29e5cb0399bc57996dd3180058f14c8030339058 100644 (file)
@@ -115,10 +115,10 @@ su_inline int tp_cmp(tport_t const *a, tport_t const *b)
   return memcmp(a->tp_addr, b->tp_addr, a->tp_addrlen);
 }
 
-su_inline int tprb_is_inserted(tport_t const *a)
-{
-  return a->tp_dad != 0 || a->tp_left != 0 || a->tp_right != 0;
-}
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
 
 RBTREE_PROTOS(su_inline, tprb, tport_t);
 
@@ -127,6 +127,10 @@ RBTREE_BODIES(su_inline, tprb, tport_t,
              TP_IS_RED, TP_SET_RED, TP_IS_BLACK, TP_SET_BLACK, TP_COPY_COLOR,
              tp_cmp, TP_INSERT, TP_REMOVE);
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 static void tplist_insert(tport_t **list, tport_t *tp)
 {
   if (*list == NULL)
@@ -311,12 +315,6 @@ inline int tport_is_shutdown(tport_t const *self)
   return self->tp_closed || self->tp_send_close || self->tp_recv_close;
 }
 
-/** Test if transport is bound */
-su_inline int tport_is_bound(tport_t const *self)
-{
-  return self->tp_protoname != NULL;
-}
-
 /** Test if transport connection has been established. @NEW_1_12_5. */
 int tport_is_connected(tport_t const *self)
 {
@@ -348,12 +346,6 @@ su_inline unsigned tport_mtu(tport_t const *self)
   return self->tp_params->tpp_mtu;
 }
 
-su_inline
-int tport_has_sigcomp(tport_t const *self)
-{
-  return self->tp_name->tpn_comp != NULL;
-}
-
 /** Set IP TOS for socket */
 void tport_set_tos(su_socket_t socket, su_addrinfo_t *ai, int tos)
 {