From 2a455a5fc7c84eda14e54a75fa57046dc2bbc258 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 19 Jan 2016 12:42:27 +0100 Subject: [PATCH] remove some warnings --- coreapi/TunnelManager.cc | 4 ++-- coreapi/chat.c | 4 ++-- coreapi/chat_file_transfer.c | 4 +--- coreapi/linphonecall.c | 8 ++------ gtk/friendlist.c | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 859394f17..d7ce537f5 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -163,7 +163,7 @@ TunnelManager::~TunnelManager(){ void TunnelManager::doRegistration(){ LinphoneProxyConfig* lProxy; - linphone_core_get_default_proxy(mCore, &lProxy); + lProxy = linphone_core_get_default_proxy_config(mCore); if (lProxy) { ms_message("TunnelManager: New registration"); lProxy->commit = TRUE; @@ -172,7 +172,7 @@ void TunnelManager::doRegistration(){ void TunnelManager::doUnregistration() { LinphoneProxyConfig *lProxy; - linphone_core_get_default_proxy(mCore, &lProxy); + lProxy = linphone_core_get_default_proxy_config(mCore); if(lProxy) { _linphone_proxy_config_unregister(lProxy); } diff --git a/coreapi/chat.c b/coreapi/chat.c index 77d63d32d..3cabe976c 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -675,7 +675,7 @@ bool_t linphone_chat_room_is_remote_composing(const LinphoneChatRoom *cr) { } LinphoneCore *linphone_chat_room_get_lc(LinphoneChatRoom *cr) { - return cr->lc; + return linphone_chat_room_get_core(cr); } LinphoneCore *linphone_chat_room_get_core(LinphoneChatRoom *cr) { @@ -704,7 +704,7 @@ LinphoneChatMessage *linphone_chat_room_create_message_2(LinphoneChatRoom *cr, c const char *external_body_url, LinphoneChatMessageState state, time_t time, bool_t is_read, bool_t is_incoming) { LinphoneChatMessage *msg = linphone_chat_room_create_message(cr, message); - LinphoneCore *lc = linphone_chat_room_get_lc(cr); + LinphoneCore *lc = linphone_chat_room_get_core(cr); msg->external_body_url = external_body_url ? ms_strdup(external_body_url) : NULL; msg->time = time; msg->is_read = is_read; diff --git a/coreapi/chat_file_transfer.c b/coreapi/chat_file_transfer.c index 03190ce7f..4dc39ec07 100644 --- a/coreapi/chat_file_transfer.c +++ b/coreapi/chat_file_transfer.c @@ -460,7 +460,7 @@ static void linphone_chat_process_response_from_get_file(void *data, const belle int _linphone_chat_room_start_http_transfer(LinphoneChatMessage *msg, const char* url, const char* action, const belle_http_request_listener_callbacks_t *cbs) { belle_generic_uri_t *uri = NULL; - char* ua; + const char* ua = linphone_core_get_user_agent(msg->chat_room->lc); if (url == NULL) { ms_warning("Cannot process file transfer msg: no file remote URI configured."); @@ -472,9 +472,7 @@ int _linphone_chat_room_start_http_transfer(LinphoneChatMessage *msg, const char goto error; } - ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version()); msg->http_request = belle_http_request_create(action, uri, belle_sip_header_create("User-Agent", ua), NULL); - ms_free(ua); if (msg->http_request == NULL) { ms_warning("Could not create http request for uri %s", url); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 3b734ef3f..2e9893568 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2325,11 +2325,9 @@ void linphone_call_init_audio_stream(LinphoneCall *call){ AudioStream *audiostream; const char *location; int dscp; - char rtcp_tool[128]={0}; + const char rtcp_tool=linphone_core_get_user_agent(call->core); char* cname; - snprintf(rtcp_tool,sizeof(rtcp_tool)-1,"%s-%s",linphone_core_get_user_agent_name(),linphone_core_get_user_agent_version()); - if (call->audiostream != NULL) return; if (call->sessions[call->main_audio_stream_index].rtp_session==NULL){ SalMulticastRole multicast_role = linphone_call_get_multicast_role(call,SalAudio); @@ -2423,9 +2421,7 @@ void linphone_call_init_video_stream(LinphoneCall *call){ #ifdef VIDEO_ENABLED LinphoneCore *lc=call->core; char* cname; - char rtcp_tool[128]; - - snprintf(rtcp_tool,sizeof(rtcp_tool)-1,"%s-%s",linphone_core_get_user_agent_name(),linphone_core_get_user_agent_version()); + const char *rtcp_tool = linphone_core_get_user_agent(call->core); if (call->videostream == NULL){ int video_recv_buf_size=lp_config_get_int(lc->config,"video","recv_buf_size",0); diff --git a/gtk/friendlist.c b/gtk/friendlist.c index c1a497c3d..906d80668 100644 --- a/gtk/friendlist.c +++ b/gtk/friendlist.c @@ -615,7 +615,7 @@ void linphone_gtk_show_directory_search(void){ GtkWidget *mw=linphone_gtk_get_main_window(); GtkWidget *search_box=linphone_gtk_get_widget(mw,"directory_search_box"); - linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg); + cfg = linphone_core_get_default_proxy_config(linphone_gtk_get_core()); if (cfg){ ssc=linphone_proxy_config_get_sip_setup_context(cfg); if (ssc!=NULL && sip_setup_context_get_capabilities(ssc) & SIP_SETUP_CAP_BUDDY_LOOKUP){