From 01b214c5fba45cb3e46219fa5a240dff20fb627e Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 3 Jun 2022 12:14:45 +0200 Subject: [PATCH] sip: origin: Don't mix code and declarations Move (and reorder) declarations to avoid warnings triggered by -Wdeclaration-after-statement Closes #459 --- plugins/sip/calls-sip-origin.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c index 488f1ad..bfece4c 100644 --- a/plugins/sip/calls-sip-origin.c +++ b/plugins/sip/calls-sip-origin.c @@ -590,12 +590,17 @@ sip_i_state (int status, } if (r_sdp) { + g_autoptr (CallsSdpCryptoContext) ctx = NULL; g_autoptr (GList) remote_codecs = calls_sip_media_manager_get_codecs_from_sdp (origin->media_manager, r_sdp->sdp_media); - GList *preferred_codecs = calls_sip_media_manager_codec_candidates (origin->media_manager); g_autoptr (GList) codecs = NULL; GList *node; + GList *preferred_codecs = calls_sip_media_manager_codec_candidates (origin->media_manager); + const char *session_ip = NULL; + const char *media_ip = NULL; + int rtp_port; + int rtcp_port = 0; for (node = remote_codecs; node != NULL; node = node->next) { MediaCodecInfo *codec = node->data; @@ -605,12 +610,6 @@ sip_i_state (int status, } } - g_autoptr (CallsSdpCryptoContext) ctx = NULL; - const char *session_ip = NULL; - const char *media_ip = NULL; - int rtp_port; - int rtcp_port = 0; - g_debug ("Remote SDP was set to:\n%s", r_sdp_str); if (!codecs) {