From 589c982aef3891ade0391c17dfbd76ac53b598fd Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 15 Sep 2021 08:37:00 +0800 Subject: [PATCH 1/3] fix build warning warning: address of array 'rr->srv_record' will always evaluate to 'true' --- libsofia-sip-ua/stun/stun_dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsofia-sip-ua/stun/stun_dns.c b/libsofia-sip-ua/stun/stun_dns.c index 86ef0b2c..82050bcd 100644 --- a/libsofia-sip-ua/stun/stun_dns.c +++ b/libsofia-sip-ua/stun/stun_dns.c @@ -92,7 +92,7 @@ static void priv_sres_cb(stun_dns_lookup_t *self, for (i = 0; answer && answer[i] != NULL; i++) { sres_srv_record_t *rr = (sres_srv_record_t *) answer[i]->sr_srv; - if (rr && rr->srv_record && rr->srv_record->r_type == sres_type_srv) { + if (rr && rr->srv_record->r_type == sres_type_srv) { const char *tcp_name = STUN_SRV_SERVICE_TCP; const char *udp_name = STUN_SRV_SERVICE_UDP; if ((self->stun_state & stun_dns_tls) == 0 && From 8e1059b788fe63b5fbb1df02320a94cde5fd31d5 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 15 Sep 2021 08:40:05 +0800 Subject: [PATCH 2/3] fix build warning: extra tokens at end of #endif directive --- libsofia-sip-ua/nua/nua_stack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsofia-sip-ua/nua/nua_stack.c b/libsofia-sip-ua/nua/nua_stack.c index e3138b3c..8671d678 100644 --- a/libsofia-sip-ua/nua/nua_stack.c +++ b/libsofia-sip-ua/nua/nua_stack.c @@ -240,7 +240,8 @@ void nua_stack_deinit(su_root_t *root, nua_t *nua) #if HAVE_SMIME /* Start NRC Boston */ sm_destroy(nua->sm); -#endif /* End NRC Boston */} +#endif +/* End NRC Boston */ } } From 2e86c5bcde19a6bba5d61ade244b7f8e4d50b918 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 15 Sep 2021 08:43:53 +0800 Subject: [PATCH 3/3] fix build warnings nua.c:1101:16: warning: address of array 'nh->nh_ds' will always evaluate to 'true' [-Wpointer-bool-conversion] if (nh && nh->nh_ds) ~~ ~~~~^~~~~ nua.c:1110:16: warning: address of array 'nh->nh_home' will always evaluate to 'true' [-Wpointer-bool-conversion] if (nh && nh->nh_home) ~~ ~~~~^~~~~~~ nua.c:1119:18: warning: address of array 'nua->nua_home' will always evaluate to 'true' [-Wpointer-bool-conversion] if (nua && nua->nua_home) ~~ ~~~~~^~~~~~~~ nua.c:1150:16: warning: address of array 'nh->nh_ds' will always evaluate to 'true' [-Wpointer-bool-conversion] if (nh && nh->nh_ds && nh->nh_ds->ds_usage) { ~~ ~~~~^~~~~ --- libsofia-sip-ua/nua/nua.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libsofia-sip-ua/nua/nua.c b/libsofia-sip-ua/nua/nua.c index 48360584..c67c573e 100644 --- a/libsofia-sip-ua/nua/nua.c +++ b/libsofia-sip-ua/nua/nua.c @@ -89,7 +89,7 @@ su_log_t nua_log[] = { SU_LOG_INIT("nua", "NUA_DEBUG", SU_DEBUG) }; * @param root Pointer to a root object * @param callback Pointer to event callback function * @param magic Pointer to callback context - * @param tag, value, ... List of tagged parameters + * @param tag, value, ... List of tagged parameters * * @retval !=NULL a pointer to a @nua stack object * @retval NULL upon an error @@ -1098,7 +1098,7 @@ nua_handle_t *nua_handle_by_call_id(nua_t *nua, const char *call_id) /** Get leg from dialog. */ const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh) { - if (nh && nh->nh_ds) + if (nh) return nh->nh_ds->ds_leg; else return NULL; @@ -1107,7 +1107,7 @@ const nta_leg_t *nua_get_dialog_state_leg(nua_handle_t *nh) /** Get su_home_t from nua handle. */ su_home_t *nua_handle_get_home(nua_handle_t *nh) { - if (nh && nh->nh_home) + if (nh) return nh->nh_home; else return NULL; @@ -1116,7 +1116,7 @@ su_home_t *nua_handle_get_home(nua_handle_t *nh) /** Get su_home_t from nua. */ su_home_t *nua_get_home(nua_t *nua) { - if (nua && nua->nua_home) + if (nua) return nua->nua_home; else return NULL; @@ -1147,7 +1147,7 @@ unsigned nua_handle_is_destroyed(nua_handle_t *nh) void nua_handle_dialog_usage_set_refresh_range(nua_handle_t *nh, unsigned min, unsigned max) { - if (nh && nh->nh_ds && nh->nh_ds->ds_usage) { + if (nh && nh->nh_ds->ds_usage) { nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, min, max); } }