fix compilation errors on windows

This commit is contained in:
Simon Morlat 2016-11-04 10:33:47 +01:00
parent 2504ad8379
commit a567e95ee1
3 changed files with 6 additions and 6 deletions

View file

@ -296,10 +296,10 @@ int linphone_dial_plan_lookup_ccc_from_iso(const char* iso) {
return -1;
}
const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_ushort(unsigned short ccc) {
const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_int(int ccc) {
int i;
char ccc_as_char[4] = {0};
snprintf(ccc_as_char,sizeof(ccc_as_char),"%i",ccc);
char ccc_as_char[16] = {0};
snprintf(ccc_as_char,sizeof(ccc_as_char)-1,"%i",ccc);
for(i=0;dial_plans[i].country!=NULL;++i){
if (strcmp(ccc_as_char,dial_plans[i].ccc)==0){
@ -316,7 +316,7 @@ const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *ccc) {
return &most_common_dialplan;
}
return linphone_dial_plan_by_ccc_as_ushort(strtol(ccc,NULL,10));
return linphone_dial_plan_by_ccc_as_int((int)strtol(ccc,NULL,10));
}
const LinphoneDialPlan* linphone_dial_plan_get_all() {

View file

@ -137,7 +137,7 @@ LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *cc
* Find best match for given CCC
* @return Return matching dial plan, or a generic one if none found
**/
LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_ushort(unsigned short ccc);
LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_int(int ccc);
/**

View file

@ -633,7 +633,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c
ccc = linphone_dial_plan_lookup_ccc_from_e164(flatten);
if (ccc>-1) { /*e164 like phone number*/
dialplan = *linphone_dial_plan_by_ccc_as_ushort(ccc);
dialplan = *linphone_dial_plan_by_ccc_as_int(ccc);
nationnal_significant_number = strstr(flatten, dialplan.ccc);
if (nationnal_significant_number) {
nationnal_significant_number +=strlen(dialplan.ccc);