From 9a0a594d07f1a3654fba130db882fafec274e79e Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 24 Jul 2018 11:52:30 -0500 Subject: [PATCH] FS-11278 #resolve fix if clause does not guard compiler warning --- libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c | 2 +- libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c | 9 +++++++-- libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c index 43e36f3018..5fa444a227 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c @@ -1600,7 +1600,7 @@ int nua_client_next_request(nua_client_request_t *cr, int invite) for (; cr; cr = cr->cr_next) { if (cr->cr_method == sip_method_cancel) continue; - break; + break; } if (cr && !nua_client_request_in_progress(cr)) { diff --git a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c index 9b46dd09fd..a4f71207c5 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c +++ b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c @@ -1858,7 +1858,9 @@ int sdp_rtpmap_match(sdp_rtpmap_t const *a, sdp_rtpmap_t const *b) if (aparam == bparam) return 1; - if (!aparam) aparam = "1"; if (!bparam) bparam = "1"; + if (!aparam) aparam = "1"; + + if (!bparam) bparam = "1"; if (!su_casematch(aparam, bparam)) return 0; @@ -1895,7 +1897,10 @@ sdp_rtpmap_t *sdp_rtpmap_find_matching(sdp_rtpmap_t const *list, break; } - if (!lparam) lparam = "1"; if (!rparam) rparam = "1"; + if (!lparam) lparam = "1"; + + if (!rparam) rparam = "1"; + if (!su_casematch(lparam, rparam)) continue; diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c b/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c index 90a0541163..e1372e5888 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_socket_port.c @@ -170,10 +170,12 @@ void su_socket_port_deinit(su_port_t *self) self->sup_mbox_index = 0; if (self->sup_mbox[0] && self->sup_mbox[0] != INVALID_SOCKET) - su_close(self->sup_mbox[0]); self->sup_mbox[0] = INVALID_SOCKET; + su_close(self->sup_mbox[0]); + self->sup_mbox[0] = INVALID_SOCKET; #if HAVE_SOCKETPAIR if (self->sup_mbox[1] && self->sup_mbox[1] != INVALID_SOCKET) - su_close(self->sup_mbox[1]); self->sup_mbox[1] = INVALID_SOCKET; + su_close(self->sup_mbox[1]); + self->sup_mbox[1] = INVALID_SOCKET; #endif su_pthread_port_deinit(self);