Commit 3a6f8976 authored by Benjamin REIS's avatar Benjamin REIS

cast to fix build

parent 6f149544
......@@ -45,7 +45,7 @@ static const char* ha1_for_passwd(const char* username, const char* realm, const
static unsigned int validate_uri(const char* username, const char* domain, const char* display_name) {
LinphoneAddress* addr;
int status = 0;
unsigned int status = 0;
LinphoneProxyConfig* proxy = linphone_proxy_config_new();
linphone_proxy_config_set_identity(proxy, "sip:?@domain.com");
......
......@@ -641,7 +641,7 @@ static int sal_add_listen_port(Sal *ctx, SalAddress* addr, bool_t is_tunneled){
sal_transport_to_string(sal_address_get_transport(addr)));
}
if (lp) {
belle_sip_listening_point_set_keep_alive(lp,ctx->keep_alive);
belle_sip_listening_point_set_keep_alive(lp,(int)ctx->keep_alive);
result = belle_sip_provider_add_listening_point(ctx->prov,lp);
if (sal_address_get_transport(addr)==SalTransportTLS) {
set_tls_properties(ctx);
......@@ -716,7 +716,7 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value){
for (iterator=belle_sip_provider_get_listening_points(ctx->prov);iterator!=NULL;iterator=iterator->next) {
lp=(belle_sip_listening_point_t*)iterator->data;
if (ctx->use_tcp_tls_keep_alive || strcasecmp(belle_sip_listening_point_get_transport(lp),"udp")==0) {
belle_sip_listening_point_set_keep_alive(lp,ctx->keep_alive);
belle_sip_listening_point_set_keep_alive(lp,(int)ctx->keep_alive);
}
}
}
......@@ -1079,7 +1079,7 @@ int sal_generate_uuid(char *uuid, size_t len) {
return -1;
}
for (i = 0; i < 6; i++)
written+=snprintf(uuid+written,len-written,"%2.2x", uuid_struct.node[i]);
written+=snprintf(uuid+written,len-(size_t)written,"%2.2x", uuid_struct.node[i]);
uuid[len-1]='\0';
return 0;
}
......@@ -1106,7 +1106,7 @@ static void make_supported_header(Sal *sal){
const char *tag=(const char*)it->data;
size_t taglen=strlen(tag);
if (alltags==NULL || (written+taglen+1>=buflen)) alltags=reinterpret_cast<char *>(ms_realloc(alltags,(buflen=buflen*2)));
written+=snprintf(alltags+written,buflen-written,it->next ? "%s, " : "%s",tag);
written+=(size_t)snprintf(alltags+written,buflen-written,it->next ? "%s, " : "%s",tag);
}
if (alltags){
sal->supported=belle_sip_header_create("Supported",alltags);
......@@ -1287,7 +1287,7 @@ unsigned char * sal_get_random_bytes(unsigned char *ret, size_t size){
}
char *sal_get_random_token(int size){
return belle_sip_random_token(reinterpret_cast<char *>(ms_malloc(size)),size);
return belle_sip_random_token(reinterpret_cast<char *>(ms_malloc((size_t)size)),(size_t)size);
}
unsigned int sal_get_random(void){
......
......@@ -52,7 +52,7 @@ static void subscribe_refresher_listener (belle_sip_refresher_t* refresher
if (status_code == 503) { /*refresher returns 503 for IO error*/
reason = SalReasonIOError;
}
sal_error_info_set(&op->error_info, reason, "SIP", status_code,reason_phrase,NULL);
sal_error_info_set(&op->error_info, reason, "SIP", (int)status_code,reason_phrase,NULL);
op->base.root->callbacks.subscribe_response(op,sss, will_retry);
}else if (status_code==0){
op->base.root->callbacks.on_expire(op);
......
......@@ -36,7 +36,7 @@ static void publish_refresher_listener (belle_sip_refresher_t* refresher
sip_etag_string = belle_sip_header_get_unparsed_value(sip_etag);
}
sal_op_set_entity_tag(op, sip_etag_string);
sal_error_info_set(&op->error_info,SalReasonUnknown, "SIP", status_code,reason_phrase,NULL);
sal_error_info_set(&op->error_info,SalReasonUnknown, "SIP", (int)status_code,reason_phrase,NULL);
sal_op_assign_recv_headers(op,(belle_sip_message_t*)response);
op->base.root->callbacks.on_publish_response(op);
}
......
......@@ -32,7 +32,7 @@ static void register_refresher_listener (belle_sip_refresher_t* refresher
/*only take first one for now*/
op->auth_info=sal_auth_info_create((belle_sip_auth_event_t*)(belle_sip_refresher_get_auth_events(refresher)->data));
}
sal_error_info_set(&op->error_info,SalReasonUnknown, "SIP", status_code,reason_phrase,NULL);
sal_error_info_set(&op->error_info,SalReasonUnknown, "SIP", (int)status_code,reason_phrase,NULL);
if (status_code>=200){
sal_op_assign_recv_headers(op,(belle_sip_message_t*)response);
}
......
......@@ -42,7 +42,7 @@ static void add_ice_candidates(belle_sdp_media_description_t *md, const SalStrea
return;
}
if (candidate->raddr[0] != '\0') {
nb = snprintf(buffer + nb, sizeof(buffer) - nb, " raddr %s rport %d", candidate->raddr, candidate->rport);
nb = snprintf(buffer + nb, sizeof(buffer) - (size_t)nb, " raddr %s rport %d", candidate->raddr, candidate->rport);
if (nb < 0) {
ms_error("Cannot add ICE candidate attribute!");
return;
......@@ -63,7 +63,7 @@ static void add_ice_remote_candidates(belle_sdp_media_description_t *md, const S
for (i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES; i++) {
candidate = &desc->ice_remote_candidates[i];
if ((candidate->addr[0] != '\0') && (candidate->port != 0)) {
offset = snprintf(ptr, buffer + sizeof(buffer) - ptr, "%s%d %s %d", (i > 0) ? " " : "", i + 1, candidate->addr, candidate->port);
offset = snprintf(ptr, (size_t)(buffer + sizeof(buffer) - ptr), "%s%d %s %d", (i > 0) ? " " : "", i + 1, candidate->addr, candidate->port);
if (offset < 0) {
ms_error("Cannot add ICE remote-candidates attribute!");
return;
......
......@@ -137,7 +137,7 @@ bctbx_list_t * call_logs_read_from_config_file(LinphoneCore *lc){
continue;
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);
sec=(uint64_t)lp_config_get_int64(cfg,logsection,"start_date_time",0);
if (sec) {
/*new call log format with date expressed in seconds */
cl->start_date_time=(time_t)sec;
......
......@@ -162,7 +162,7 @@ void create_file_transfer_information_from_vnd_gsma_rcs_ft_http_xml(LinphoneChat
while (cur != NULL) {
if (!xmlStrcmp(cur->name, (const xmlChar *)"file-size")) {
xmlChar *fileSizeString = xmlNodeListGetString(xmlMessageBody, cur->xmlChildrenNode, 1);
linphone_content_set_size(content, strtol((const char *)fileSizeString, NULL, 10));
linphone_content_set_size(content, (size_t)strtol((const char *)fileSizeString, NULL, 10));
xmlFree(fileSizeString);
}
......
......@@ -318,7 +318,7 @@ int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibration
ms_error("Echo calibration is still on going !");
return -1;
}
rate = lp_config_get_int(lc->config,"sound","echo_cancellation_rate",8000);
rate = (unsigned int)lp_config_get_int(lc->config,"sound","echo_cancellation_rate",8000);
lc->ecc=ec_calibrator_new(lc->factory, lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard,rate,cb,audio_init_cb,audio_uninit_cb,cb_data);
lc->ecc->play_cool_tones = !!lp_config_get_int(lc->config, "sound", "ec_calibrator_cool_tones", 0);
ec_calibrator_start(lc->ecc);
......
......@@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
static char *create_enum_domain(const char *number){
long len=(long)strlen(number);
char *domain=reinterpret_cast<char *>(ms_malloc((len*2)+10));
char *domain=reinterpret_cast<char *>(ms_malloc((size_t)(len*2)+10));
long i,j;
for (i=0,j=len-1;j>=0;j--){
......
......@@ -93,21 +93,21 @@ int lime_getCachedSndKeysByURI(void *cachedb, limeURIKeys_t *associatedKeys) {
/* retrieve values : peerZid, sndKey, sndSId, sndIndex, valid from columns 1,2,3,4,5 */
length = sqlite3_column_bytes(sqlStmt, 1);
if (length==12) { /* peerZID */
memcpy(currentPeerKey->peerZID, sqlite3_column_blob(sqlStmt, 1), length);
memcpy(currentPeerKey->peerZID, sqlite3_column_blob(sqlStmt, 1), (size_t)length);
} else { /* something wrong with that one, skip it */
continue;
}
length = sqlite3_column_bytes(sqlStmt, 2);
if (length==32) { /* sndKey */
memcpy(currentPeerKey->key, sqlite3_column_blob(sqlStmt, 2), length);
memcpy(currentPeerKey->key, sqlite3_column_blob(sqlStmt, 2), (size_t)length);
} else { /* something wrong with that one, skip it */
continue;
}
length = sqlite3_column_bytes(sqlStmt, 3);
if (length==32) { /* sndSId */
memcpy(currentPeerKey->sessionId, sqlite3_column_blob(sqlStmt, 3), length);
memcpy(currentPeerKey->sessionId, sqlite3_column_blob(sqlStmt, 3), (size_t)length);
} else { /* something wrong with that one, skip it */
continue;
}
......@@ -126,14 +126,14 @@ int lime_getCachedSndKeysByURI(void *cachedb, limeURIKeys_t *associatedKeys) {
length = sqlite3_column_bytes(sqlStmt, 5);
if (length==8) { /* sndIndex : 8 bytes of a int64_t, stored as a blob in big endian */
uint8_t *validity = (uint8_t *)sqlite3_column_blob(sqlStmt, 5);
validityTimeSpec.tv_sec = ((uint64_t)(validity[0]))<<56 |
validityTimeSpec.tv_sec = (int64_t)(((uint64_t)(validity[0]))<<56 |
((uint64_t)(validity[1]))<<48 |
((uint64_t)(validity[2]))<<40 |
((uint64_t)(validity[3]))<<32 |
((uint64_t)(validity[4]))<<24 |
((uint64_t)(validity[5]))<<16 |
((uint64_t)(validity[6]))<<8 |
((uint64_t)(validity[7]));
((uint64_t)(validity[7])));
} else { /* something wrong with that one, skip it */
continue;
}
......@@ -210,7 +210,7 @@ int lime_getCachedRcvKeyByZid(void *cachedb, limeKey_t *associatedKey, const cha
/* retrieve values : rcvKey, rcvSId, rcvIndex from columns 1,2,3 */
length = sqlite3_column_bytes(sqlStmt, 1);
if (length==32) { /* rcvKey */
memcpy(associatedKey->key, sqlite3_column_blob(sqlStmt, 1), length);
memcpy(associatedKey->key, sqlite3_column_blob(sqlStmt, 1), (size_t)length);
} else { /* something wrong */
sqlite3_finalize(sqlStmt);
return LIME_NO_VALID_KEY_FOUND_FOR_PEER;
......@@ -218,7 +218,7 @@ int lime_getCachedRcvKeyByZid(void *cachedb, limeKey_t *associatedKey, const cha
length = sqlite3_column_bytes(sqlStmt, 2);
if (length==32) { /* rcvSId */
memcpy(associatedKey->sessionId, sqlite3_column_blob(sqlStmt, 2), length);
memcpy(associatedKey->sessionId, sqlite3_column_blob(sqlStmt, 2), (size_t)length);
} else { /* something wrong */
sqlite3_finalize(sqlStmt);
return LIME_NO_VALID_KEY_FOUND_FOR_PEER;
......@@ -275,7 +275,7 @@ int lime_setCachedKey(void *cachedb, limeKey_t *associatedKey, uint8_t role, uin
/* shall we update valid column? Enforce only when receiver, if timeSpan is 0, just ignore */
if (validityTimeSpan > 0 && role == LIME_RECEIVER) {
bctbx_get_utc_cur_time(&currentTime);
bctbx_timespec_add(&currentTime, validityTimeSpan);
bctbx_timespec_add(&currentTime, (int64_t)validityTimeSpan);
/* store the int64_t in big endian in the cache(cache is not typed, all data seen as blob) */
colValues[3][0] = (uint8_t)((currentTime.tv_sec>>56)&0xFF);
colValues[3][1] = (uint8_t)((currentTime.tv_sec>>48)&0xFF);
......@@ -566,8 +566,8 @@ int lime_createMultipartMessage(void *cachedb, const char *contentType, uint8_t
/* dump the whole message doc into the output */
xmlDocDumpFormatMemoryEnc(xmlOutputMessage, &local_output, &xmlStringLength, "UTF-8", 0);
*output = (uint8_t *)ms_malloc(xmlStringLength + 1);
memcpy(*output, local_output, xmlStringLength);
*output = (uint8_t *)ms_malloc((size_t)xmlStringLength + 1);
memcpy(*output, local_output, (size_t)xmlStringLength);
(*output)[xmlStringLength] = '\0';
xmlFree(local_output);
......
......@@ -125,4 +125,4 @@ void set_playback_gain_db(AudioStream *st, float gain){
if (st->volrecv){
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_DB_GAIN,&gain);
}else ms_warning("Could not apply playback gain: gain control wasn't activated.");
}
}
\ No newline at end of file
......@@ -510,8 +510,8 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) {
void linphone_core_set_log_level_mask(unsigned int loglevel) {
//we only have 2 domain for now ortp and belle-sip
bctbx_set_log_level_mask(ORTP_LOG_DOMAIN, loglevel);
bctbx_set_log_level_mask("bzrtp", loglevel); /*need something to set log lvel for all domains*/
bctbx_set_log_level_mask(ORTP_LOG_DOMAIN, (int)loglevel);
bctbx_set_log_level_mask("bzrtp", (int)loglevel); /*need something to set log lvel for all domains*/
sal_set_log_level((OrtpLogLevel)loglevel);
}
unsigned int linphone_core_get_log_level_mask(void) {
......@@ -535,7 +535,7 @@ static int _open_log_collection_file_with_idx(int idx) {
return -1;
}
liblinphone_log_collection_file_size = statbuf.st_size;
liblinphone_log_collection_file_size = (size_t)statbuf.st_size;
return 0;
}
......@@ -623,7 +623,7 @@ static void linphone_core_log_collection_handler(const char *domain, OrtpLogLeve
1900 + lt->tm_year, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, (int)(tp.tv_usec / 1000), lname, msg);
fflush(liblinphone_log_collection_file);
if (ret > 0) {
liblinphone_log_collection_file_size += ret;
liblinphone_log_collection_file_size += (size_t)ret;
if (liblinphone_log_collection_file_size > liblinphone_log_collection_max_file_size) {
_close_log_collection_file();
_open_log_collection_file();
......@@ -945,7 +945,7 @@ static size_t get_size_of_file_to_upload(const char *filename) {
fstat(fileno(output_file), &statbuf);
fclose(output_file);
ms_free(output_filename);
return statbuf.st_size;
return (size_t)statbuf.st_size;
}
void linphone_core_upload_log_collection(LinphoneCore *core) {
......@@ -1382,7 +1382,7 @@ static void sip_config_read(LinphoneCore *lc) {
!!lp_config_get_int(lc->config,"sip","register_only_when_upnp_is_ok",1);
lc->sip_conf.ping_with_options= !!lp_config_get_int(lc->config,"sip","ping_with_options",0);
lc->sip_conf.auto_net_state_mon = !!lp_config_get_int(lc->config,"sip","auto_net_state_mon",1);
lc->sip_conf.keepalive_period = lp_config_get_int(lc->config,"sip","keepalive_period",10000);
lc->sip_conf.keepalive_period = (unsigned int)lp_config_get_int(lc->config,"sip","keepalive_period",10000);
lc->sip_conf.tcp_tls_keepalive = !!lp_config_get_int(lc->config,"sip","tcp_tls_keepalive",0);
linphone_core_enable_keep_alive(lc, (lc->sip_conf.keepalive_period > 0));
sal_use_one_matching_codec_policy(lc->sal, !!lp_config_get_int(lc->config,"sip","only_one_codec",0));
......@@ -3161,7 +3161,7 @@ void linphone_core_iterate(LinphoneCore *lc){
if (lc->prevtime_ms == 0){
lc->prevtime_ms = curtime_ms;
}
if ((diff_time=curtime_ms-lc->prevtime_ms) >= 1000){
if ((diff_time=(int64_t)(curtime_ms-lc->prevtime_ms)) >= 1000){
one_second_elapsed=TRUE;
if (diff_time>3000){
/*since monotonic time doesn't increment while machine is sleeping, we don't want to catchup too much*/
......@@ -3199,7 +3199,7 @@ void linphone_core_iterate(LinphoneCore *lc){
}
if (lc->ringstream && lc->ringstream_autorelease && lc->dmfs_playing_start_time!=0
&& (curtime_ms/1000 - lc->dmfs_playing_start_time)>5){
&& (curtime_ms/1000 - (uint64_t)lc->dmfs_playing_start_time)>5){
MSPlayerState state;
bool_t stop=TRUE;
if (lc->ringstream->source && ms_filter_call_method(lc->ringstream->source,MS_PLAYER_GET_STATE,&state)==0){
......@@ -4762,8 +4762,8 @@ static void toggle_video_preview(LinphoneCore *lc, bool_t val){
if (!vdef || linphone_video_definition_is_undefined(vdef)) {
vdef = linphone_core_get_preferred_video_definition(lc);
}
vsize.width = linphone_video_definition_get_width(vdef);
vsize.height = linphone_video_definition_get_height(vdef);
vsize.width = (int)linphone_video_definition_get_width(vdef);
vsize.height = (int)linphone_video_definition_get_height(vdef);
lc->previewstream=video_preview_new(lc->factory);
video_preview_set_size(lc->previewstream,vsize);
if (display_filter)
......@@ -5325,7 +5325,7 @@ void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVide
void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize) {
linphone_core_set_preferred_video_definition(lc,
linphone_factory_find_supported_video_definition(linphone_factory_get(), vsize.width, vsize.height));
linphone_factory_find_supported_video_definition(linphone_factory_get(), (unsigned int)vsize.width, (unsigned int)vsize.height));
}
void linphone_core_set_preview_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef) {
......@@ -5354,7 +5354,7 @@ void linphone_core_set_preview_video_definition(LinphoneCore *lc, LinphoneVideoD
void linphone_core_set_preview_video_size(LinphoneCore *lc, MSVideoSize vsize) {
linphone_core_set_preview_video_definition(lc,
linphone_factory_find_supported_video_definition(linphone_factory_get(), vsize.width, vsize.height));
linphone_factory_find_supported_video_definition(linphone_factory_get(), (unsigned int)vsize.width, (unsigned int)vsize.height));
}
const LinphoneVideoDefinition * linphone_core_get_preview_video_definition(const LinphoneCore *lc) {
......@@ -5363,8 +5363,8 @@ const LinphoneVideoDefinition * linphone_core_get_preview_video_definition(const
MSVideoSize linphone_core_get_preview_video_size(const LinphoneCore *lc) {
MSVideoSize vsize = { 0 };
vsize.width = linphone_video_definition_get_width(lc->video_conf.preview_vdef);
vsize.height = linphone_video_definition_get_height(lc->video_conf.preview_vdef);
vsize.width = (int)linphone_video_definition_get_width(lc->video_conf.preview_vdef);
vsize.height = (int)linphone_video_definition_get_height(lc->video_conf.preview_vdef);
return vsize;
}
......@@ -5386,7 +5386,7 @@ LinphoneVideoDefinition * linphone_core_get_current_preview_video_definition(con
if (lc->previewstream) {
vsize = video_preview_get_current_size(lc->previewstream);
}
return linphone_factory_find_supported_video_definition(linphone_factory_get(), vsize.width, vsize.height);
return linphone_factory_find_supported_video_definition(linphone_factory_get(), (unsigned int)vsize.width, (unsigned int)vsize.height);
#else
ms_error("Video support is disabled");
return NULL;
......@@ -5429,8 +5429,8 @@ const LinphoneVideoDefinition * linphone_core_get_preferred_video_definition(con
MSVideoSize linphone_core_get_preferred_video_size(const LinphoneCore *lc) {
MSVideoSize vsize = { 0 };
vsize.width = linphone_video_definition_get_width(lc->video_conf.vdef);
vsize.height = linphone_video_definition_get_height(lc->video_conf.vdef);
vsize.width = (int)linphone_video_definition_get_width(lc->video_conf.vdef);
vsize.height = (int)linphone_video_definition_get_height(lc->video_conf.vdef);
return vsize;
}
......
......@@ -48,7 +48,7 @@ static xmlChar* convert_iso_to_utf8(const char *in) {
ms_free(out);
return NULL;
} else {
out = reinterpret_cast<xmlChar *>(ms_realloc(out, out_size + 1));
out = reinterpret_cast<xmlChar *>(ms_realloc(out, (size_t)out_size + 1));
out[out_size] = '\0';
}
}
......
......@@ -209,14 +209,14 @@ static int linphone_chat_message_store_content(LinphoneChatMessage *msg) {
);
linphone_sql_request(lc->db, buf);
sqlite3_free(buf);
id = (unsigned int) sqlite3_last_insert_rowid (lc->db);
id = (int) sqlite3_last_insert_rowid (lc->db);
}
return id;
}
unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
LinphoneCore *lc=linphone_chat_room_get_core(linphone_chat_message_get_chat_room(msg));
int id = 0;
unsigned int id = 0;
if (lc->db){
int content_id = -1;
......
......@@ -320,7 +320,7 @@ unsigned int linphone_core_get_audio_features(LinphoneCore *lc){
if (ret==AUDIO_STREAM_FEATURE_ALL){
/*since call recording is specified before creation of the stream in linphonecore,
* it will be requested on demand. It is not necessary to include it all the time*/
ret&=~AUDIO_STREAM_FEATURE_MIXED_RECORDING;
ret&=(unsigned int) ~AUDIO_STREAM_FEATURE_MIXED_RECORDING;
}
return ret;
}
......@@ -640,7 +640,7 @@ const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc){
char *pos;
char *nextpos;
char *params;
int found=0;
unsigned long found=0;
MSCryptoSuite *result=NULL;
pos=tmp;
do{
......
......@@ -373,7 +373,7 @@ static void presence_model_get_activity(const LinphonePresencePerson *person, st
if (st->current_idx != (unsigned)-1) {
unsigned int size = (unsigned int)bctbx_list_size(person->activities);
if (st->requested_idx < (st->current_idx + size)) {
st->activity = (LinphonePresenceActivity *)bctbx_list_nth_data(person->activities, st->requested_idx - st->current_idx);
st->activity = (LinphonePresenceActivity *)bctbx_list_nth_data(person->activities, (int)(st->requested_idx - st->current_idx));
st->current_idx = (unsigned)-1;
} else {
st->current_idx += size;
......@@ -621,7 +621,7 @@ LinphonePresenceService * linphone_presence_model_get_nth_service(const Linphone
if ((model == NULL) || (idx >= linphone_presence_model_get_nb_services(model)))
return NULL;
return (LinphonePresenceService *)bctbx_list_nth_data(model->services, idx);
return (LinphonePresenceService *)bctbx_list_nth_data(model->services, (int)idx);
}
LinphoneStatus linphone_presence_model_add_service(LinphonePresenceModel *model, LinphonePresenceService *service) {
......@@ -647,7 +647,7 @@ LinphonePresencePerson * linphone_presence_model_get_nth_person(const LinphonePr
if ((model == NULL) || (idx >= linphone_presence_model_get_nb_persons(model)))
return NULL;
return (LinphonePresencePerson *)bctbx_list_nth_data(model->persons, idx);
return (LinphonePresencePerson *)bctbx_list_nth_data(model->persons, (int)idx);
}
LinphoneStatus linphone_presence_model_add_person(LinphonePresenceModel *model, LinphonePresencePerson *person) {
......@@ -783,7 +783,7 @@ LinphonePresenceNote * linphone_presence_service_get_nth_note(const LinphonePres
if ((service == NULL) || (idx >= linphone_presence_service_get_nb_notes(service)))
return NULL;
return (LinphonePresenceNote *)bctbx_list_nth_data(service->notes, idx);
return (LinphonePresenceNote *)bctbx_list_nth_data(service->notes, (int)idx);
}
LinphoneStatus linphone_presence_service_add_note(LinphonePresenceService *service, LinphonePresenceNote *note) {
......@@ -844,7 +844,7 @@ unsigned int linphone_presence_person_get_nb_activities(const LinphonePresencePe
LinphonePresenceActivity * linphone_presence_person_get_nth_activity(const LinphonePresencePerson *person, unsigned int idx) {
if ((person == NULL) || (idx >= linphone_presence_person_get_nb_activities(person)))
return NULL;
return (LinphonePresenceActivity *)bctbx_list_nth_data(person->activities, idx);
return (LinphonePresenceActivity *)bctbx_list_nth_data(person->activities, (int)idx);
}
LinphoneStatus linphone_presence_person_add_activity(LinphonePresencePerson *person, LinphonePresenceActivity *activity) {
......@@ -870,7 +870,7 @@ unsigned int linphone_presence_person_get_nb_notes(const LinphonePresencePerson
LinphonePresenceNote * linphone_presence_person_get_nth_note(const LinphonePresencePerson *person, unsigned int idx) {
if ((person == NULL) || (idx >= linphone_presence_person_get_nb_notes(person)))
return NULL;
return (LinphonePresenceNote *)bctbx_list_nth_data(person->notes, idx);
return (LinphonePresenceNote *)bctbx_list_nth_data(person->notes, (int)idx);
}
LinphoneStatus linphone_presence_person_add_note(LinphonePresencePerson *person, LinphonePresenceNote *note) {
......@@ -895,7 +895,7 @@ unsigned int linphone_presence_person_get_nb_activities_notes(const LinphonePres
LinphonePresenceNote * linphone_presence_person_get_nth_activities_note(const LinphonePresencePerson *person, unsigned int idx) {
if ((person == NULL) || (idx >= linphone_presence_person_get_nb_activities_notes(person)))
return NULL;
return (LinphonePresenceNote *)bctbx_list_nth_data(person->activities_notes, idx);
return (LinphonePresenceNote *)bctbx_list_nth_data(person->activities_notes, (int)idx);
}
LinphoneStatus linphone_presence_person_add_activities_note(LinphonePresencePerson *person, LinphonePresenceNote *note) {
......@@ -1275,7 +1275,7 @@ static int process_pidf_xml_presence_services(xmlparsing_context_t *xml_ctx, Lin
if (service != NULL) {
if (timestamp_str != NULL) presence_service_set_timestamp(service, parse_timestamp(timestamp_str));
if (contact_str != NULL) linphone_presence_service_set_contact(service, contact_str);
process_pidf_xml_presence_service_notes(xml_ctx, service, i);
process_pidf_xml_presence_service_notes(xml_ctx, service, (unsigned int)i);
linphone_presence_model_add_service(model, service);
linphone_presence_service_unref(service);
}
......@@ -1415,9 +1415,9 @@ static int process_pidf_xml_presence_persons(xmlparsing_context_t *xml_ctx, Linp
person = presence_person_new(person_id_str, timestamp);
if (person != NULL) {
err = process_pidf_xml_presence_person_activities(xml_ctx, person, i);
err = process_pidf_xml_presence_person_activities(xml_ctx, person, (unsigned int)i);
if (err == 0) {
err = process_pidf_xml_presence_person_notes(xml_ctx, person, i);
err = process_pidf_xml_presence_person_notes(xml_ctx, person, (unsigned int)i);
}
if (err == 0) {
presence_model_add_person(model, person);
......
......@@ -119,7 +119,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
cfg->reg_sendregister = lc ? !!lp_config_get_default_int(lc->config, "proxy", "reg_sendregister", 1) : 1;
cfg->dial_prefix = dial_prefix ? ms_strdup(dial_prefix) : NULL;
cfg->dial_escape_plus = lc ? !!lp_config_get_default_int(lc->config, "proxy", "dial_escape_plus", 0) : 0;
cfg->privacy = lc ? lp_config_get_default_int(lc->config, "proxy", "privacy", LinphonePrivacyDefault) : LinphonePrivacyDefault;
cfg->privacy = lc ? (LinphonePrivacyMask)lp_config_get_default_int(lc->config, "proxy", "privacy", LinphonePrivacyDefault) : LinphonePrivacyDefault;
cfg->identity_address = identity ? linphone_address_new(identity) : NULL;
cfg->reg_identity = cfg->identity_address ? linphone_address_as_string(cfg->identity_address) : NULL;
cfg->reg_proxy = proxy ? ms_strdup(proxy) : NULL;
......@@ -1146,7 +1146,7 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
lp_config_set_int(config, key, "avpf_rr_interval", cfg->avpf_rr_interval);
lp_config_set_int(config,key,"dial_escape_plus",cfg->dial_escape_plus);
lp_config_set_string(config,key,"dial_prefix",cfg->dial_prefix);
lp_config_set_int(config,key,"privacy",cfg->privacy);
lp_config_set_int(config,key,"privacy",(int)cfg->privacy);
if (cfg->refkey) lp_config_set_string(config,key,"refkey",cfg->refkey);
lp_config_set_int(config, key, "publish_expires", cfg->publish_expires);
......@@ -1167,8 +1167,8 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
#define CONFIGURE_BOOL_VALUE(cfg,config,key,param,param_name) \
linphone_proxy_config_enable_##param(cfg, !!lp_config_get_int(config,key,param_name,linphone_proxy_config_##param##_enabled(cfg)));
#define CONFIGURE_INT_VALUE(cfg,config,key,param,param_name) \
linphone_proxy_config_set_##param(cfg, !!lp_config_get_int(config,key,param_name,linphone_proxy_config_get_##param(cfg)));
#define CONFIGURE_INT_VALUE(cfg,config,key,param,param_name, param_type) \
linphone_proxy_config_set_##param(cfg, (param_type)lp_config_get_int(config,key,param_name,(int)linphone_proxy_config_get_##param(cfg)));
LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc, int index)
{
......@@ -1194,26 +1194,26 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc
CONFIGURE_BOOL_VALUE(cfg,config,key,quality_reporting,"quality_reporting_enabled")
CONFIGURE_STRING_VALUE(cfg,config,key,quality_reporting_collector,"quality_reporting_collector")
CONFIGURE_INT_VALUE(cfg,config,key,quality_reporting_interval,"quality_reporting_interval")
CONFIGURE_INT_VALUE(cfg,config,key,quality_reporting_interval,"quality_reporting_interval",int)
CONFIGURE_STRING_VALUE(cfg,config,key,contact_parameters,"contact_parameters")
CONFIGURE_STRING_VALUE(cfg,config,key,contact_uri_parameters,"contact_uri_parameters")
CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires")
CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires", int)
CONFIGURE_BOOL_VALUE(cfg,config,key,register,"reg_sendregister")
CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"publish")
linphone_proxy_config_set_avpf_mode(cfg,static_cast<LinphoneAVPFMode>(lp_config_get_int(config,key,"avpf",linphone_proxy_config_get_avpf_mode(cfg))));
CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval")
CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus")
CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval",uint8_t)
CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus",bool_t)
CONFIGURE_STRING_VALUE(cfg,config,key,dial_prefix,"dial_prefix")
tmp=lp_config_get_string(config,key,"type",NULL);
if (tmp!=NULL && strlen(tmp)>0)
linphone_proxy_config_set_sip_setup(cfg,tmp);
CONFIGURE_INT_VALUE(cfg,config,key,privacy,"privacy")
CONFIGURE_INT_VALUE(cfg,config,key,privacy,"privacy",LinphonePrivacyMask)
CONFIGURE_STRING_VALUE(cfg,config,key,ref_key,"refkey")
CONFIGURE_INT_VALUE(cfg,config,key,publish_expires,"publish_expires")
CONFIGURE_INT_VALUE(cfg,config,key,publish_expires,"publish_expires",int)
nat_policy_ref = lp_config_get_string(config, key, "nat_policy_ref", NULL);
if (nat_policy_ref != NULL) {
......@@ -1235,7 +1235,7 @@ static void linphone_proxy_config_activate_sip_setup(LinphoneProxyConfig *cfg){
ms_error("Invalid identity for this proxy configuration.");
return;
}
caps=sip_setup_context_get_capabilities(ssc);
caps=(unsigned int)sip_setup_context_get_capabilities(ssc);
if (caps & SIP_SETUP_CAP_ACCOUNT_MANAGER){
if (sip_setup_context_login_account(ssc,cfg->reg_identity,NULL,NULL)!=0){
{
......
......@@ -896,7 +896,7 @@ static int line_get_value(const char *input, const char *key, char *value, size_
char *equal;
size_t len;
if (!end) len=strlen(input);
else len=end +1 -input;
else len=(size_t)(end + 1 - input);
*read=len;
strncpy(line,input,MIN(len,sizeof(line)));
equal=strchr(line,'=');
......
......@@ -121,7 +121,7 @@ unsigned int sip_setup_get_capabilities(SipSetup *s){
}
int sip_setup_context_get_capabilities(SipSetupContext *ctx){
return ctx->funcs->capabilities;
return (int)ctx->funcs->capabilities;
}
LinphoneStatus sip_setup_context_create_account(SipSetupContext * ctx, const char *uri, const char *passwd, const char *email, int suscribe){
......
......@@ -77,13 +77,13 @@ static int sqlite3bctbx_Read(sqlite3_file *p, void *buf, int count, sqlite_int64
int ret;
sqlite3_bctbx_file_t *pFile = (sqlite3_bctbx_file_t*) p;
if (pFile){
ret = (int)bctbx_file_read(pFile->pbctbx_file, buf, count, (off_t)offset);
ret = (int)bctbx_file_read(pFile->pbctbx_file, buf, (size_t)count, (off_t)offset);
if( ret==count ){
return SQLITE_OK;
}
else if( ret >= 0 ){
/*fill in unread portion of buffer, as requested by sqlite3 documentation*/
memset(((uint8_t*)buf) + ret, 0, count-ret);
memset(((uint8_t*)buf) + ret, 0, (size_t)(count-ret));
return SQLITE_IOERR_SHORT_READ;
}else {
......@@ -106,7 +106,7 @@ static int sqlite3bctbx_Write(sqlite3_file *p, const void *buf, int count, sqlit
sqlite3_bctbx_file_t *pFile = (sqlite3_bctbx_file_t*) p;
int ret;
if (pFile ){
ret = (int)bctbx_file_write(pFile->pbctbx_file, buf, count, (off_t)offset);
ret = (int)bctbx_file_write(pFile->pbctbx_file, buf, (size_t)count, (off_t)offset);
if(ret > 0 ) return SQLITE_OK;
else {
return SQLITE_IOERR_WRITE;
......
......@@ -53,6 +53,10 @@ namespace Utils {
LINPHONE_PUBLIC float stof (const std::string &str, size_t *idx = 0);
LINPHONE_PUBLIC bool stob (const std::string &str);
LINPHONE_PUBLIC int stoi (const char *str, size_t *idx = 0, int base = 10);
LINPHONE_PUBLIC double stod (const char *str, size_t *idx = 0);
LINPHONE_PUBLIC float stof (const char *str, size_t *idx = 0);
LINPHONE_PUBLIC std::string stringToLower (const std::string &str);
// Return a buffer allocated with new.
......
......@@ -176,8 +176,8 @@ MSVideoSize linphone_call_params_get_received_video_size (const LinphoneCallPara
MSVideoSize vsize;
LinphoneVideoDefinition *vdef = GET_MEDIA_CPP_PTR(params)->getReceivedVideoDefinition();
if (vdef) {
vsize.width = linphone_video_definition_get_width(vdef);
vsize.height = linphone_video_definition_get_height(vdef);
vsize.width = static_cast<int>(linphone_video_definition_get_width(vdef));
vsize.height = static_cast<int>(linphone_video_definition_get_height(vdef));
} else {
vsize.width = MS_VIDEO_SIZE_UNKNOWN_W;
vsize.height = MS_VIDEO_SIZE_UNKNOWN_H;
......@@ -206,8 +206,8 @@ MSVideoSize linphone_call_params_get_sent_video_size (const LinphoneCallParams *
MSVideoSize vsize;
LinphoneVideoDefinition *vdef = GET_MEDIA_CPP_PTR(params)->getSentVideoDefinition();
if (vdef) {
vsize.width = linphone_video_definition_get_width(vdef);
vsize.height = linphone_video_definition_get_height(vdef);
vsize.width = static_cast<int>(linphone_video_definition_get_width(vdef));
vsize.height = static_cast<int>(linphone_video_definition_get_height(vdef));
} else {
vsize.width = MS_VIDEO_SIZE_UNKNOWN_W;
vsize.height = MS_VIDEO_SIZE_UNKNOWN_H;
......@@ -457,11 +457,11 @@ void linphone_call_params_set_update_call_when_ice_completed (LinphoneCallParams
}
void linphone_call_params_set_sent_vsize (LinphoneCallParams *params, MSVideoSize vsize) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setSentVideoDefinition(linphone_video_definition_new(vsize.width, vsize.height, nullptr));
GET_MEDIA_CPP_PRIVATE_PTR(params)->setSentVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
}
void linphone_call_params_set_recv_vsize (LinphoneCallParams *params, MSVideoSize vsize) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReceivedVideoDefinition(linphone_video_definition_new(vsize.width, vsize.height, nullptr));
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReceivedVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
}
void linphone_call_params_set_sent_video_definition (LinphoneCallParams *params, LinphoneVideoDefinition *vdef) {
......
......@@ -105,7 +105,7 @@ void IsComposing::parse (const string &text) {
}
void IsComposing::startIdleTimer () {
int duration = getIdleTimerDuration();
unsigned int duration = getIdleTimerDuration();
if (!idleTimer) {
idleTimer = sal_create_timer(core->sal, idleTimerExpired, this,
duration * 1000, "composing idle timeout");
......@@ -115,7 +115,7 @@ void IsComposing::startIdleTimer () {
}
void IsComposing::startRefreshTimer () {
int duration = getRefreshTimerDuration();
unsigned int duration = getRefreshTimerDuration();
if (!refreshTimer) {
refreshTimer = sal_create_timer(core->sal, refreshTimerExpired, this,
duration * 1000, "composing refresh timeout");
......@@ -125,9 +125,9 @@ void IsComposing::startRefreshTimer () {
}
void IsComposing::startRemoteRefreshTimer (const char *refreshStr) {
int duration = getRemoteRefreshTimerDuration();
unsigned int duration = getRemoteRefreshTimerDuration();
if (refreshStr)
duration = atoi(refreshStr);
duration = static_cast<unsigned int>(stoi(refreshStr));
if (!remoteRefreshTimer) {
remoteRefreshTimer = sal_create_timer(core->sal, remoteRefreshTimerExpired, this,
duration * 1000, "composing remote refresh timeout");
......@@ -180,16 +180,19 @@ void IsComposing::stopRemoteRefreshTimer () {
// -----------------------------------------------------------------------------
int IsComposing::getIdleTimerDuration () {
return lp_config_get_int(core->config, "sip", "composing_idle_timeout", defaultIdleTimeout);
unsigned int IsComposing::getIdleTimerDuration () {
int idleTimerDuration = lp_config_get_int(core->config, "sip", "composing_idle_timeout", defaultIdleTimeout);
return idleTimerDuration < 0 ? 0 : static_cast<unsigned int>(idleTimerDuration);
}
int IsComposing::getRefreshTimerDuration () {
return lp_config_get_int(core->config, "sip", "composing_refresh_timeout", defaultRefreshTimeout);
unsigned int IsComposing::getRefreshTimerDuration () {
int refreshTimerDuration = lp_config_get_int(core->config, "sip", "composing_refresh_timeout", defaultRefreshTimeout);
return refreshTimerDuration < 0 ? 0 : static_cast<unsigned int>(refreshTimerDuration);
}
int IsComposing::getRemoteRefreshTimerDuration () {