From a36cade0849bfe69d67755b17fe6434cde5e2bf8 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 29 Mar 2017 14:22:46 +0200 Subject: [PATCH] Fix build with Clang on Linux. --- coreapi/account_creator.c | 24 ++++++++++++------------ coreapi/xmlrpc.c | 12 ++++++------ include/linphone/xmlrpc.h | 8 ++++---- tester/account_creator_tester.c | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 7b0e7d85f..5c48e7529 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -661,7 +661,7 @@ LinphoneRequestStatus linphone_account_creator_is_account_exist_custom(LinphoneA return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("get_phone_number_for_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account", LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgNone); @@ -697,7 +697,7 @@ static LinphoneXmlRpcRequest * _create_account_with_phone_custom(LinphoneAccount if (!creator->phone_number) { return NULL; } - request = linphone_xml_rpc_request_new_with_args("create_phone_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "create_phone_account", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, creator->password ? ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password) : "", @@ -713,7 +713,7 @@ static LinphoneXmlRpcRequest * _create_account_with_email_custom(LinphoneAccount if (!creator->username || !creator->email || !creator->password) { return NULL; } - request = linphone_xml_rpc_request_new_with_args("create_email_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "create_email_account", LinphoneXmlRpcArgString, creator->username, LinphoneXmlRpcArgString, creator->email, LinphoneXmlRpcArgString, ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password), @@ -775,14 +775,14 @@ LinphoneRequestStatus linphone_account_creator_activate_account_custom(LinphoneA } if (creator->phone_number) { - request = linphone_xml_rpc_request_new_with_args("activate_phone_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_account", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, creator->activation_code, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgNone); } else { - request = linphone_xml_rpc_request_new_with_args("activate_email_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_email_account", LinphoneXmlRpcArgString, creator->username, LinphoneXmlRpcArgString, creator->activation_code, linphone_proxy_config_get_domain(creator->proxy_cfg), @@ -819,7 +819,7 @@ LinphoneRequestStatus linphone_account_creator_is_account_activated_custom(Linph } return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("is_account_activated", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_account_activated", LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgNone); @@ -857,7 +857,7 @@ LinphoneRequestStatus linphone_account_creator_is_phone_number_used_custom(Linph } return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("is_phone_number_used", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_phone_number_used", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgNone); @@ -892,7 +892,7 @@ LinphoneRequestStatus linphone_account_creator_link_phone_number_with_account_cu } return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("link_phone_number_with_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "link_phone_number_with_account", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, creator->username, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), @@ -924,7 +924,7 @@ LinphoneRequestStatus linphone_account_creator_is_account_linked_custom(Linphone if (!creator->username || !linphone_proxy_config_get_domain(creator->proxy_cfg)) { return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("get_phone_number_for_account",LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account", LinphoneXmlRpcArgString, creator->username, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgNone); @@ -957,7 +957,7 @@ LinphoneRequestStatus linphone_account_creator_activate_phone_number_link_custom } return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("activate_phone_number_link", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_number_link", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, creator->username, LinphoneXmlRpcArgString, creator->activation_code, @@ -1000,7 +1000,7 @@ LinphoneRequestStatus linphone_account_creator_recover_phone_account_custom(Linp } return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("recover_phone_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "recover_phone_account", LinphoneXmlRpcArgString, creator->phone_number, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), LinphoneXmlRpcArgString, creator->language, @@ -1052,7 +1052,7 @@ LinphoneRequestStatus linphone_account_creator_update_password_custom(LinphoneAc const char * ha1 = ms_strdup(creator->ha1 ? creator->ha1 : ha1_for_passwd(username, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password) ); const char * new_ha1 = ms_strdup(ha1_for_passwd(username, linphone_proxy_config_get_domain(creator->proxy_cfg), new_pwd)); - request = linphone_xml_rpc_request_new_with_args("update_hash", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "update_hash", LinphoneXmlRpcArgString, username, LinphoneXmlRpcArgString, ha1, LinphoneXmlRpcArgString, new_ha1, diff --git a/coreapi/xmlrpc.c b/coreapi/xmlrpc.c index e65587d91..c7f8b7ea2 100644 --- a/coreapi/xmlrpc.c +++ b/coreapi/xmlrpc.c @@ -251,7 +251,7 @@ static void process_response_from_post_xml_rpc_request(void *data, const belle_h } -static LinphoneXmlRpcRequest * _linphone_xml_rpc_request_new(const char *method, LinphoneXmlRpcArgType return_type) { +static LinphoneXmlRpcRequest * _linphone_xml_rpc_request_new(LinphoneXmlRpcArgType return_type, const char *method) { LinphoneXmlRpcRequest *request = belle_sip_object_new(LinphoneXmlRpcRequest); request->callbacks = linphone_xml_rpc_request_cbs_new(); request->status = LinphoneXmlRpcStatusPending; @@ -306,18 +306,18 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneXmlRpcSession, belle_sip_object_t, ); -LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(const char *method, LinphoneXmlRpcArgType return_type) { - LinphoneXmlRpcRequest *request = _linphone_xml_rpc_request_new(method, return_type); +LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(LinphoneXmlRpcArgType return_type, const char *method) { + LinphoneXmlRpcRequest *request = _linphone_xml_rpc_request_new(return_type, method); format_request(request); return request; } -LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(const char *method, LinphoneXmlRpcArgType return_type, ...) { +LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgType return_type, const char *method, ...) { bool_t cont = TRUE; va_list args; LinphoneXmlRpcArgType arg_type; - LinphoneXmlRpcRequest *request = _linphone_xml_rpc_request_new(method, return_type); - va_start(args, return_type); + LinphoneXmlRpcRequest *request = _linphone_xml_rpc_request_new(return_type, method); + va_start(args, method); while (cont) { arg_type = va_arg(args, LinphoneXmlRpcArgType); switch (arg_type) { diff --git a/include/linphone/xmlrpc.h b/include/linphone/xmlrpc.h index efcf50ed1..706105a3e 100644 --- a/include/linphone/xmlrpc.h +++ b/include/linphone/xmlrpc.h @@ -43,19 +43,19 @@ typedef void (*LinphoneXmlRpcRequestCbsResponseCb)(LinphoneXmlRpcRequest *reques /** * Create a new LinphoneXmlRpcRequest object. - * @param[in] method The XML-RPC method to call. * @param[in] return_type The expected XML-RPC response type. + * @param[in] method The XML-RPC method to call. * @return A new LinphoneXmlRpcRequest object. **/ -LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(const char *method, LinphoneXmlRpcArgType return_type); +LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(LinphoneXmlRpcArgType return_type, const char *method); /** * Create a new LinphoneXmlRpcRequest object giving the arguments to the method call. - * @param[in] method The XML-RPC method to call. * @param[in] return_type The expected XML-RPC response type. + * @param[in] method The XML-RPC method to call. * @return A new LinphoneXmlRpcRequest object. **/ -LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(const char *method, LinphoneXmlRpcArgType return_type, ...); +LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgType return_type, const char *method, ...); /** * Acquire a reference to the XML-RPC request. diff --git a/tester/account_creator_tester.c b/tester/account_creator_tester.c index 4e1895ee8..233258abc 100644 --- a/tester/account_creator_tester.c +++ b/tester/account_creator_tester.c @@ -359,7 +359,7 @@ LinphoneRequestStatus get_activation_code_account_cb(LinphoneAccountCreator *cre return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("get_confirmation_key", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_confirmation_key", LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, creator->password, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg), @@ -397,7 +397,7 @@ LinphoneRequestStatus delete_account_cb(LinphoneAccountCreator *creator) { return LinphoneRequestMissingArguments; } - request = linphone_xml_rpc_request_new_with_args("delete_account", LinphoneXmlRpcArgString, + request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "delete_account", LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number, LinphoneXmlRpcArgString, creator->password, LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),