Commit b9b283dc authored by Ghislain MARY's avatar Ghislain MARY

Compile source files as C++.

parent f2121d52
......@@ -229,7 +229,7 @@ void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, in
}
if (!obj->ha1 && obj->realm && obj->passwd && (obj->username || obj->userid) && store_ha1_passwd) {
/*compute ha1 to avoid storing clear text password*/
obj->ha1 = ms_malloc(33);
obj->ha1 = reinterpret_cast<char *>(ms_malloc(33));
sal_auth_compute_ha1(obj->userid ? obj->userid : obj->username, obj->realm, obj->passwd, obj->ha1);
}
if (obj->username != NULL) {
......
......@@ -78,7 +78,7 @@ const uint8_t * linphone_buffer_get_content(const LinphoneBuffer *buffer) {
void linphone_buffer_set_content(LinphoneBuffer *buffer, const uint8_t *content, size_t size) {
buffer->size = size;
if (buffer->content) belle_sip_free(buffer->content);
buffer->content = belle_sip_malloc(size + 1);
buffer->content = reinterpret_cast<uint8_t *>(belle_sip_malloc(size + 1));
memcpy(buffer->content, content, size);
((char *)buffer->content)[size] = '\0';
}
......
......@@ -36,90 +36,93 @@ endif()
set(LINPHONE_PRIVATE_HEADER_FILES
bellesip_sal/sal_impl.h
carddav.h
conference_private.h
contact_providers_priv.h
enum.h
lime.h
lpc2xml.h
offeranswer.h
CardDav.h
Conference.h
ContactProvider.h
Enum.h
Lime.h
Lpc2Xml.h
OfferAnswer.h
private.h
quality_reporting.h
sqlite3_bctbx_vfs.h
vcard_private.h
xml2lpc.h
QualityReporting.h
Sqlite3BctbxVfs.h
Vcard.h
Xml2Lpc.h
)
set(LINPHONE_SOURCE_FILES_C
account_creator.c
account_creator_service.c
address.c
authentication.c
bellesip_sal/sal_address_impl.c
bellesip_sal/sal_impl.c
bellesip_sal/sal_op_call.c
bellesip_sal/sal_op_call_transfer.c
bellesip_sal/sal_op_events.c
bellesip_sal/sal_op_impl.c
bellesip_sal/sal_op_info.c
bellesip_sal/sal_op_message.c
bellesip_sal/sal_op_presence.c
bellesip_sal/sal_op_publish.c
bellesip_sal/sal_op_registration.c
bellesip_sal/sal_sdp.c
buffer.c
callbacks.c
call_log.c
call_params.c
carddav.c
chat.c
chat_file_transfer.c
contactprovider.c
content.c
dial_plan.c
dict.c
ec-calibrator.c
echo-tester.c
enum.c
error_info.c
event.c
factory.c
friend.c
friendlist.c
im_notif_policy.c
info.c
ldapprovider.c
lime.c
im_encryption_engine.c
linphonecall.c
linphonecore.c
linphone_tunnel_config.c
localplayer.c
lpc2xml.c
lpconfig.c
lsd.c
message_storage.c
misc.c
nat_policy.c
offeranswer.c
payload_type.c
player.c
presence.c
proxy.c
quality_reporting.c
remote_provisioning.c
ringtoneplayer.c
sal.c
siplogin.c
sipsetup.c
sqlite3_bctbx_vfs.c
video_definition.c
xml2lpc.c
xml.c
xmlrpc.c
vtables.c
bellesip_sal/sal_address_impl.cc
bellesip_sal/sal_impl.cc
bellesip_sal/sal_op_call.cc
bellesip_sal/sal_op_call_transfer.cc
bellesip_sal/sal_op_events.cc
bellesip_sal/sal_op_impl.cc
bellesip_sal/sal_op_info.cc
bellesip_sal/sal_op_message.cc
bellesip_sal/sal_op_presence.cc
bellesip_sal/sal_op_publish.cc
bellesip_sal/sal_op_registration.cc
bellesip_sal/sal_sdp.cc
)
set(LINPHONE_SOURCE_FILES_CXX conference.cc)
set(LINPHONE_SOURCE_FILES_CXX
AccountCreator.cc
AccountCreatorService.cc
Address.cc
Authentication.cc
Buffer.cc
Call.cc
Callbacks.cc
CallLog.cc
CallParams.cc
CardDav.cc
Chat.cc
ChatFileTransfer.cc
Conference.cc
Config.cc
ContactProvider.cc
Content.cc
Core.cc
DialPlan.cc
Dict.cc
EcCalibrator.cc
EchoTester.cc
Enum.cc
ErrorInfo.cc
Event.cc
Factory.cc
Friend.cc
FriendList.cc
ImEncryptionEngine.cc
ImNotifPolicy.cc
Info.cc
LdapProvider.cc
Lime.cc
LocalPlayer.cc
Lpc2Xml.cc
Lsd.cc
MessageStorage.cc
Misc.cc
NatPolicy.cc
OfferAnswer.cc
PayloadType.cc
Player.cc
Presence.cc
Proxy.cc
QualityReporting.cc
RemoteProvisioning.cc
RingTonePlayer.cc
Sal.cc
SipLogin.cc
SipSetup.cc
Sqlite3BctbxVfs.cc
TunnelConfig.cc
VideoDefinition.cc
Vtables.cc
Xml.cc
Xml2Lpc.cc
XmlRpc.cc
)
if(ANDROID)
list(APPEND LINPHONE_SOURCE_FILES_CXX linphonecore_jni.cc)
set_source_files_properties(linphonecore_jni.cc PROPERTIES COMPILE_DEFINITIONS "USE_JAVAH")
......@@ -134,12 +137,12 @@ endif()
if(ENABLE_TUNNEL)
list(APPEND LINPHONE_SOURCE_FILES_CXX
linphone_tunnel.cc
Tunnel.cc
TunnelManager.cc
)
add_definitions(-DTUNNEL_ENABLED)
else()
list(APPEND LINPHONE_SOURCE_FILES_C linphone_tunnel_stubs.c)
list(APPEND LINPHONE_SOURCE_FILES_CXX TunnelStubs.cc)
endif()
bc_git_version(liblinphone ${PROJECT_VERSION})
......@@ -185,7 +188,7 @@ if(INTL_FOUND)
endif()
if(BELCARD_FOUND)
list(APPEND LIBS ${BELCARD_LIBRARIES})
list(APPEND LINPHONE_SOURCE_FILES_CXX vcard.cc)
list(APPEND LINPHONE_SOURCE_FILES_CXX Vcard.cc)
if(NOT MSVC)
list(APPEND STRICT_OPTIONS_CXX "-std=c++11")
endif()
......@@ -193,7 +196,7 @@ if(BELCARD_FOUND)
list(APPEND STRICT_OPTIONS_CXX "-stdlib=libc++")
endif()
else()
list(APPEND LINPHONE_SOURCE_FILES_C vcard_stubs.c)
list(APPEND LINPHONE_SOURCE_FILES_CXX VcardStubs.c)
endif()
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/sipsetup.h"
#include "linphone/lpconfig.h"
#include "private.h"
#include "conference_private.h"
#include "Conference.h"
#include <ortp/event.h>
#include <ortp/b64.h>
......@@ -44,6 +44,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <bctoolbox/defs.h>
inline OrtpRtcpXrStatSummaryFlag operator|(OrtpRtcpXrStatSummaryFlag a, OrtpRtcpXrStatSummaryFlag b) {
return static_cast<OrtpRtcpXrStatSummaryFlag>(static_cast<int>(a) | static_cast<int>(b));
}
static const char *EC_STATE_STORE = ".linphone.ecstate";
#define EC_STATE_MAX_LEN 1048576 // 1Mo
......@@ -186,7 +191,7 @@ static bool_t generate_b64_crypto_key(size_t key_length, char* key_out, size_t k
return FALSE;
}
b64_size = b64_encode((const char*)tmp, key_length, NULL, 0);
b64_size = b64::b64_encode((const char*)tmp, key_length, NULL, 0);
if (b64_size == 0) {
ms_error("Failed to get b64 result size");
ms_free(tmp);
......@@ -197,7 +202,7 @@ static bool_t generate_b64_crypto_key(size_t key_length, char* key_out, size_t k
ms_free(tmp);
return FALSE;
}
b64_size=b64_encode((const char*)tmp, key_length, key_out, key_out_size);
b64_size = b64::b64_encode((const char*)tmp, key_length, key_out, key_out_size);
if (b64_size == 0) {
ms_error("Failed to b64 encode key");
ms_free(tmp);
......@@ -588,7 +593,7 @@ static int setup_encryption_key(SalSrtpCryptoAlgo *crypto, MSCryptoSuite suite,
}
if (keylen==0 || !generate_b64_crypto_key(keylen, crypto->master_key, SAL_SRTP_KEY_SIZE)){
ms_error("Could not generate SRTP key.");
crypto->algo = 0;
crypto->algo = MS_CRYPTO_SUITE_INVALID;
return -1;
}
return 0;
......@@ -1116,9 +1121,9 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
linphone_core_get_text_port_range(call->core, &min_port, &max_port);
port_config_set(call,call->main_text_stream_index,min_port,max_port);
linphone_call_init_stats(call->audio_stats, LINPHONE_CALL_STATS_AUDIO);
linphone_call_init_stats(call->video_stats, LINPHONE_CALL_STATS_VIDEO);
linphone_call_init_stats(call->text_stats, LINPHONE_CALL_STATS_TEXT);
linphone_call_init_stats(call->audio_stats, LinphoneStreamTypeAudio);
linphone_call_init_stats(call->video_stats, LinphoneStreamTypeVideo);
linphone_call_init_stats(call->text_stats, LinphoneStreamTypeText);
if (call->dest_proxy == NULL) {
/* Try to define the destination proxy if it has not already been done to have a correct contact field in the SIP messages */
......@@ -1135,7 +1140,7 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
}
void linphone_call_init_stats(LinphoneCallStats *stats, int type) {
void linphone_call_init_stats(LinphoneCallStats *stats, LinphoneStreamType type) {
stats->type = type;
stats->received_rtcp = NULL;
stats->sent_rtcp = NULL;
......@@ -2712,7 +2717,7 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
framesize=lp_config_get_int(lc->config,"sound","ec_framesize",0);
audio_stream_set_echo_canceller_params(audiostream,len,delay,framesize);
if (audiostream->ec) {
char *statestr=ms_malloc0(EC_STATE_MAX_LEN);
char *statestr=(char *)ms_malloc0(EC_STATE_MAX_LEN);
if (lp_config_relative_file_exists(lc->config, EC_STATE_STORE)
&& lp_config_read_relative_file(lc->config, EC_STATE_STORE, statestr, EC_STATE_MAX_LEN) == 0) {
ms_filter_call_method(audiostream->ec, MS_ECHO_CANCELLER_SET_STATE_STRING, statestr);
......@@ -5312,9 +5317,10 @@ LinphoneStatus linphone_call_terminate(LinphoneCall *call) {
LinphoneStatus linphone_call_terminate_with_error_info(LinphoneCall *call , const LinphoneErrorInfo *ei){
SalErrorInfo sei={0};
SalErrorInfo sei;
LinphoneErrorInfo* p_ei = (LinphoneErrorInfo*) ei;
memset(&sei, 0, sizeof(sei));
ms_message("Terminate call [%p] which is currently in state %s", call, linphone_call_state_to_string(call->state));
switch (call->state) {
case LinphoneCallReleased:
......@@ -5352,7 +5358,7 @@ LinphoneStatus linphone_call_redirect(LinphoneCall *call, const char *redirect_u
char *real_url = NULL;
LinphoneCore *lc;
LinphoneAddress *real_parsed_url;
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (call->state != LinphoneCallIncomingReceived) {
ms_error("Bad state for call redirection.");
......@@ -5367,6 +5373,7 @@ LinphoneStatus linphone_call_redirect(LinphoneCall *call, const char *redirect_u
return -1;
}
memset(&sei, 0, sizeof(sei));
real_url = linphone_address_as_string(real_parsed_url);
sal_error_info_set(&sei,SalReasonRedirect, "SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(call->op, &sei, real_url);
......@@ -5390,9 +5397,11 @@ LinphoneStatus linphone_call_decline(LinphoneCall * call, LinphoneReason reason)
LinphoneStatus linphone_call_decline_with_error_info(LinphoneCall * call, const LinphoneErrorInfo *ei) {
SalErrorInfo sei = {0};
SalErrorInfo sub_sei = {0};
SalErrorInfo sei;
SalErrorInfo sub_sei;
memset(&sei, 0, sizeof(sei));
memset(&sub_sei, 0, sizeof(sub_sei));
sei.sub_sei = &sub_sei;
if ((call->state != LinphoneCallIncomingReceived) && (call->state != LinphoneCallIncomingEarlyMedia)) {
......@@ -6005,10 +6014,12 @@ void linphone_call_reinvite_to_recover_from_connection_loss(LinphoneCall *call)
}
void linphone_call_repair_if_broken(LinphoneCall *call){
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (!call->broken) return;
if (!call->core->media_network_reachable) return;
memset(&sei, 0, sizeof(sei));
/*Make sure that the proxy from which we received this call, or to which we routed this call is registered first*/
if (call->dest_proxy){
/*in all other cases, ie no proxy config, or a proxy config for which no registration was requested, we can start the
......@@ -6174,7 +6185,7 @@ void linphone_call_notify_info_message_received(LinphoneCall *call, const Linpho
linphone_core_notify_info_received(linphone_call_get_core(call), call, msg);
}
void linphone_call_notify_ack_processing(LinphoneCall *call, void *msg, bool_t is_received) {
void linphone_call_notify_ack_processing(LinphoneCall *call, LinphoneHeaders *msg, bool_t is_received) {
NOTIFY_IF_EXIST(ack_processing, call, msg, is_received)
}
......@@ -135,8 +135,8 @@ bctbx_list_t * call_logs_read_from_config_file(LinphoneCore *lc){
if (tmp) to=linphone_address_new(tmp);
if (!from || !to)
continue;
cl=linphone_call_log_new(lp_config_get_int(cfg,logsection,"dir",0),from,to);
cl->status=lp_config_get_int(cfg,logsection,"status",0);
cl=linphone_call_log_new(static_cast<LinphoneCallDir>(lp_config_get_int(cfg,logsection,"dir",0)),from,to);
cl->status=static_cast<LinphoneCallStatus>(lp_config_get_int(cfg,logsection,"status",0));
sec=lp_config_get_int64(cfg,logsection,"start_date_time",0);
if (sec) {
/*new call log format with date expressed in seconds */
......@@ -224,7 +224,7 @@ void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey){
}
char * linphone_call_log_to_str(LinphoneCallLog *cl){
char *status;
const char *status;
char *tmp;
char *from=linphone_address_as_string (cl->from);
char *to=linphone_address_as_string (cl->to);
......@@ -418,7 +418,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
static LinphoneCallLog * find_call_log_by_storage_id(bctbx_list_t *call_logs, unsigned int storage_id) {
bctbx_list_t *item;
for (item = call_logs; item != NULL; item = bctbx_list_next(item)) {
LinphoneCallLog *call_log = bctbx_list_get_data(item);
LinphoneCallLog *call_log = reinterpret_cast<LinphoneCallLog *>(bctbx_list_get_data(item));
if (call_log->storage_id == storage_id) return call_log;
}
return NULL;
......
......@@ -309,7 +309,8 @@ static void call_received(SalOp *h){
case LinphonePresenceActivityPermanentAbsence:
alt_contact = linphone_presence_model_get_contact(lc->presence_model);
if (alt_contact != NULL) {
SalErrorInfo sei = { 0 };
SalErrorInfo sei;
memset(&sei, 0, sizeof(sei));
sal_error_info_set(&sei,SalReasonRedirect, "SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(h, &sei,alt_contact);
ms_free(alt_contact);
......@@ -704,9 +705,10 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){
/* this callback is called when an incoming re-INVITE/ SIP UPDATE modifies the session*/
static void call_updated(LinphoneCore *lc, LinphoneCall *call, SalOp *op, bool_t is_update){
SalErrorInfo sei = { 0 };
SalErrorInfo sei;
SalMediaDescription *rmd=sal_call_get_remote_media_description(op);
memset(&sei, 0, sizeof(sei));
call->defer_update = lp_config_get_int(lc->config, "sip", "defer_update_default", FALSE);
switch(call->state){
......@@ -766,12 +768,13 @@ static void call_updating(SalOp *op, bool_t is_update){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
SalMediaDescription *rmd=sal_call_get_remote_media_description(op);
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (!call) {
ms_error("call_updating(): call doesn't exist anymore");
return ;
}
memset(&sei, 0, sizeof(sei));
linphone_call_fix_call_parameters(call, rmd);
if (call->state!=LinphoneCallPaused){
/*Refresh the local description, but in paused state, we don't change anything.*/
......@@ -825,7 +828,7 @@ static void call_ack_received(SalOp *op, SalCustomHeader *ack){
ms_warning("call_ack(): no call for which an ack is expected");
return;
}
linphone_call_notify_ack_processing(call, ack, TRUE);
linphone_call_notify_ack_processing(call, reinterpret_cast<LinphoneHeaders *>(ack), TRUE);
if (call->expect_media_in_ack){
switch(call->state){
case LinphoneCallStreamsRunning:
......@@ -847,7 +850,7 @@ static void call_ack_being_sent(SalOp *op, SalCustomHeader *ack){
ms_warning("call_ack(): no call for which an ack is supposed to be sent");
return;
}
linphone_call_notify_ack_processing(call, ack, FALSE);
linphone_call_notify_ack_processing(call, reinterpret_cast<LinphoneHeaders *>(ack), FALSE);
}
static void call_terminated(SalOp *op, const char *from){
......@@ -910,11 +913,11 @@ static int resume_call_after_failed_transfer(LinphoneCall *call){
static void call_failure(SalOp *op){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
const SalErrorInfo *ei=sal_op_get_error_info(op);
char *msg486=_("User is busy.");
char *msg480=_("User is temporarily unavailable.");
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
const char *msg486=_("User is busy.");
const char *msg480=_("User is temporarily unavailable.");
/*const char *retrymsg=_("%s. Retry after %i minute(s).");*/
const char *msg600=_("User does not want to be disturbed.");
const char *msg603=_("Call declined.");
const char *msg=ei->full_string;
LinphoneCall *referer;
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
......
......@@ -572,9 +572,9 @@ static LinphoneCardDavQuery* linphone_carddav_create_put_query(LinphoneCardDavCo
static char* generate_url_from_server_address_and_uid(const char *server_url) {
char *result = NULL;
if (server_url) {
char *uuid = ms_malloc(64);
char *uuid = reinterpret_cast<char *>(ms_malloc(64));
if (sal_generate_uuid(uuid, 64) == 0) {
char *url = ms_malloc(300);
char *url = reinterpret_cast<char *>(ms_malloc(300));
snprintf(url, 300, "%s/linphone-%s.vcf", server_url, uuid);
ms_debug("Generated url is %s", url);
result = ms_strdup(url);
......
......@@ -626,10 +626,10 @@ static void create_file_transfer_information_from_vnd_gsma_rcs_ft_http_xml(Linph
/* there is a key in the msg: file has been encrypted */
/* convert the key from base 64 */
xmlChar *keyb64 = xmlNodeListGetString(xmlMessageBody, cur->xmlChildrenNode, 1);
size_t keyLength = b64_decode((char *)keyb64, strlen((char *)keyb64), NULL, 0);
size_t keyLength = b64::b64_decode((char *)keyb64, strlen((char *)keyb64), NULL, 0);
uint8_t *keyBuffer = (uint8_t *)malloc(keyLength);
/* decode the key into local key buffer */
b64_decode((char *)keyb64, strlen((char *)keyb64), keyBuffer, keyLength);
b64::b64_decode((char *)keyb64, strlen((char *)keyb64), keyBuffer, keyLength);
linphone_content_set_key(msg->file_transfer_information, (char *)keyBuffer, keyLength);
/* duplicate key value into the linphone content private structure */
xmlFree(keyb64);
......@@ -1302,7 +1302,7 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) {
}
static char* utf8_to_char(uint32_t ic) {
char *result = ms_malloc(sizeof(char) * 5);
char *result = reinterpret_cast<char *>(ms_malloc(sizeof(char) * 5));
int size = 0;
if (ic < 0x80) {
result[0] = ic;
......
......@@ -293,11 +293,11 @@ static void linphone_chat_message_process_response_from_post_file(void *data,
->xmlChildrenNode; /* need to parse the children node to update the file-name
one */
/* convert key to base64 */
size_t b64Size = b64_encode(NULL, content_key_size, NULL, 0);
size_t b64Size = b64::b64_encode(NULL, content_key_size, NULL, 0);
char *keyb64 = (char *)ms_malloc0(b64Size + 1);
int xmlStringLength;
b64Size = b64_encode(content_key, content_key_size, keyb64, b64Size);
b64Size = b64::b64_encode(content_key, content_key_size, keyb64, b64Size);
keyb64[b64Size] = '\0'; /* libxml need a null terminated string */
/* add the node containing the key to the file-info node */
......
......@@ -25,7 +25,7 @@
#include "linphone/core.h"
#include "private.h"
#include "conference_private.h"
#include "Conference.h"
#include <mediastreamer2/msvolume.h>
#include <typeinfo>
#include <list>
......
......@@ -27,7 +27,7 @@
#include "private.h"
#include "bctoolbox/vfs.h"
#include "belle-sip/object.h"
#include "xml2lpc.h"
#include "Xml2Lpc.h"
#include <stdio.h>
#include <stdlib.h>
......@@ -59,7 +59,7 @@
#define lp_new0(type,n) (type*)calloc(sizeof(type),n)
#include "linphone/lpconfig.h"
#include "lpc2xml.h"
#include "Lpc2Xml.h"
typedef struct _LpItem{
char *key;
......@@ -263,9 +263,9 @@ static LpSection* linphone_config_parse_line(LpConfig* lpconfig, const char* lin
char *pos1,*pos2;
int nbs;
size_t size=strlen(line)+1;
char *secname=ms_malloc(size);
char *key=ms_malloc(size);
char *value=ms_malloc(size);
char *secname=reinterpret_cast<char *>(ms_malloc(size));
char *key=reinterpret_cast<char *>(ms_malloc(size));
char *value=reinterpret_cast<char *>(ms_malloc(size));
LpItem *item;
pos1=strchr(line,'[');
......@@ -1115,7 +1115,7 @@ const char** linphone_config_get_sections_names(LpConfig *lpconfig) {
int i;
ndev = bctbx_list_size(sections);
sections_names = ms_malloc((ndev + 1) * sizeof(const char *));
sections_names = reinterpret_cast<const char **>(ms_malloc((ndev + 1) * sizeof(const char *)));
for (i = 0; sections != NULL; sections = sections->next, i++) {
LpSection *section = (LpSection *)sections->data;
......
......@@ -14,7 +14,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "contact_providers_priv.h"
#include "ContactProvider.h"
#include "linphone/contactprovider.h"
#include <linphone/core.h>
......
......@@ -185,7 +185,7 @@ void linphone_content_set_key(LinphoneContent *content, const char *key, const s
content->key = NULL;
}
if (key != NULL) {
content->key = belle_sip_malloc(keyLength + 1);
content->key = reinterpret_cast<char *>(belle_sip_malloc(keyLength + 1));
memcpy(content->key, key, keyLength);
content->key[keyLength] = '\0';
content->keyLength = keyLength;
......
......@@ -22,12 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/sipsetup.h"
#include "linphone/lpconfig.h"
#include "private.h"
#include "quality_reporting.h"
#include "lime.h"
#include "conference_private.h"
#include "QualityReporting.h"
#include "Lime.h"
#include "Conference.h"
#ifdef SQLITE_STORAGE_ENABLED
#include "sqlite3_bctbx_vfs.h"
#include "Sqlite3BctbxVfs.h"
#endif
#include <math.h>
......@@ -92,6 +92,13 @@ static const char *liblinphone_version=
LIBLINPHONE_VERSION
#endif
;
inline OrtpLogLevel operator|=(OrtpLogLevel a, OrtpLogLevel b) {
int ia = static_cast<int>(a);
int ib = static_cast<int>(b);
return static_cast<OrtpLogLevel>(ia |= ib);
}
static OrtpLogFunc liblinphone_log_func = NULL;
static LinphoneLogCollectionState liblinphone_log_collection_state = LinphoneLogCollectionDisabled;
static char * liblinphone_log_collection_path = NULL;
......@@ -109,8 +116,8 @@ static void linphone_core_uninit(LinphoneCore *lc);
static void linphone_core_zrtp_cache_close(LinphoneCore *lc);
void linphone_core_zrtp_cache_db_init(LinphoneCore *lc, const char *fileName);
#include "enum.h"
#include "contact_providers_priv.h"
#include "Enum.h"
#include "ContactProvider.h"
const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc);
......@@ -1095,7 +1102,7 @@ static void build_sound_devices_table(LinphoneCore *lc){
int i;
const bctbx_list_t *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_card_manager(lc->factory));
ndev=bctbx_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
devices=reinterpret_cast<const char **>(ms_malloc((ndev+1)*sizeof(const char *)));
for (i=0;elem!=NULL;elem=elem->next,i++){
devices[i]=ms_snd_card_get_string_id((MSSndCard *)elem->data);
}
......@@ -1136,7 +1143,7 @@ static void sound_config_read(LinphoneCore *lc)
MSSndCard* card;
const char* delim=",";
size_t l=strlen(devid);
char* d=malloc(l+1);
char* d=reinterpret_cast<char *>(malloc(l+1));
char* i;
memcpy(d,devid,l+1);
for (l=0,i=strpbrk(d+l,delim);i;i=strpbrk(d+l,delim)){
......@@ -1325,8 +1332,8 @@ static void sip_config_read(LinphoneCore *lc) {
tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
linphone_core_set_guess_hostname(lc,tmp);
tmp=lp_config_get_int(lc->config,"sip","lime",FALSE);
linphone_core_enable_lime(lc,tmp);
tmp=lp_config_get_int(lc->config,"sip","lime",LinphoneLimeDisabled);
linphone_core_enable_lime(lc,static_cast<LinphoneLimeState>(tmp));
tmp=lp_config_get_int(lc->config,"sip","inc_timeout",30);
linphone_core_set_inc_timeout(lc,tmp);
......@@ -1435,7 +1442,7 @@ static void rtp_config_read(LinphoneCore *lc) {
adaptive_jitt_comp_enabled = lp_config_get_int(lc->config, "rtp", "video_adaptive_jitt_comp_enabled", TRUE);
linphone_core_enable_video_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
lc->rtp_conf.disable_upnp = lp_config_get_int(lc->config, "rtp", "disable_upnp", FALSE);
linphone_core_set_avpf_mode(lc,lp_config_get_int(lc->config,"rtp","avpf",0));
linphone_core_set_avpf_mode(lc,static_cast<LinphoneAVPFMode>(lp_config_get_int(lc->config,"rtp","avpf",LinphoneAVPFDisabled)));
if ((tmp=lp_config_get_string(lc->config,"rtp","audio_multicast_addr",NULL)))
linphone_core_set_audio_multicast_addr(lc,tmp);
else
......@@ -1695,7 +1702,7 @@ static void build_video_devices_table(LinphoneCore *lc){
/* retrieve all video devices */
elem=ms_web_cam_manager_get_list(ms_factory_get_web_cam_manager(lc->factory));
ndev=bctbx_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
devices=reinterpret_cast<const char **>(ms_malloc((ndev+1)*sizeof(const char *)));
for (i=0;elem!=NULL;elem=elem->next,i++){
devices[i]=ms_web_cam_get_string_id((MSWebCam *)elem->data);
}
......@@ -2103,7 +2110,7 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
if (strcmp(notified_event, "Presence") == 0) {
const bctbx_list_t* friendLists = linphone_core_get_friends_lists(lc);
while( friendLists != NULL ){
LinphoneFriendList* list = friendLists->data;
LinphoneFriendList* list = reinterpret_cast<LinphoneFriendList *>(friendLists->data);
ms_message("notify presence for list %p", list);
linphone_friend_list_notify_presence_received(list, lev, body);
friendLists = friendLists->next;
......@@ -2211,7 +2218,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
/* Create the http provider in dual stack mode (ipv4 and ipv6.
* If this creates problem, we may need to implement parallel ipv6/ ipv4 http requests in belle-sip.
*/
lc->http_provider = belle_sip_stack_create_http_provider(sal_get_stack_impl(lc->sal), "::0");
lc->http_provider = belle_sip_stack_create_http_provider(reinterpret_cast<belle_sip_stack_t *>(sal_get_stack_impl(lc