diff options
author | Riza Sulistyo <riza@teluu.com> | 2013-06-19 06:47:43 +0000 |
---|---|---|
committer | Riza Sulistyo <riza@teluu.com> | 2013-06-19 06:47:43 +0000 |
commit | d7aa4332dae06ae890053dd13239ddabee46b86c (patch) | |
tree | 34c599b317369bcc33827d5ee1200604a6599164 /pjsip/src/pjsua-lib | |
parent | 7949b9e53b97281cfa4526ffe5cf7c7d887b7025 (diff) |
Re #1680: Add initial support for Win64
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4537 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_acc.c | 19 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_aud.c | 10 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 2 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_core.c | 6 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_dump.c | 14 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 4 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_pres.c | 4 |
7 files changed, 32 insertions, 27 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 842ad179..ccd272e6 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -299,7 +299,7 @@ static pj_status_t initialize_acc(unsigned acc_id) */ #if PJSUA_ADD_ICE_TAGS if (acc_cfg->ice_cfg.enable_ice) { - unsigned new_len; + pj_ssize_t new_len; pj_str_t new_prm; new_len = acc_cfg->contact_params.slen + 10; @@ -320,12 +320,13 @@ static pj_status_t initialize_acc(unsigned acc_id) if (acc_cfg->use_rfc5626) { if (acc_cfg->rfc5626_instance_id.slen==0) { const pj_str_t *hostname; - pj_uint32_t hval, pos; + pj_uint32_t hval; + pj_size_t pos; char instprm[] = ";+sip.instance=\"<urn:uuid:00000000-0000-0000-0000-0000CCDDEEFF>\""; hostname = pj_gethostname(); pos = pj_ansi_strlen(instprm) - 10; - hval = pj_hash_calc(0, hostname->ptr, hostname->slen); + hval = pj_hash_calc(0, hostname->ptr, (unsigned)hostname->slen); pj_val_to_hex_digit( ((char*)&hval)[0], instprm+pos+0); pj_val_to_hex_digit( ((char*)&hval)[1], instprm+pos+2); pj_val_to_hex_digit( ((char*)&hval)[2], instprm+pos+4); @@ -334,7 +335,7 @@ static pj_status_t initialize_acc(unsigned acc_id) pj_strdup2(acc->pool, &acc->rfc5626_instprm, instprm); } else { const char *prmname = ";+sip.instance=\""; - unsigned len; + pj_size_t len; len = pj_ansi_strlen(prmname) + acc_cfg->rfc5626_instance_id.slen + 1; acc->rfc5626_instprm.ptr = (char*)pj_pool_alloc(acc->pool, len+1); @@ -350,7 +351,7 @@ static pj_status_t initialize_acc(unsigned acc_id) acc->rfc5626_regprm = pj_str(";reg-id=1"); } else { const char *prmname = ";reg-id="; - unsigned len; + pj_size_t len; len = pj_ansi_strlen(prmname) + acc_cfg->rfc5626_reg_id.slen; acc->rfc5626_regprm.ptr = (char*)pj_pool_alloc(acc->pool, len+1); @@ -997,7 +998,8 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, /* Global outbound proxy */ if (global_route_crc != acc->global_route_crc) { - unsigned i, rcnt; + unsigned i; + pj_size_t rcnt; /* Remove the outbound proxies from the route set */ rcnt = pj_list_size(&acc->route_set); @@ -1362,7 +1364,7 @@ done: /* Need to use outbound, append the contact with +sip.instance and * reg-id parameters. */ - unsigned len; + pj_ssize_t len; pj_str_t reg_contact; acc->rfc5626_status = OUTBOUND_WANTED; @@ -1682,7 +1684,8 @@ void update_service_route(pjsua_acc *acc, pjsip_rx_data *rdata) const pj_str_t HNAME = { "Service-Route", 13 }; const pj_str_t HROUTE = { "Route", 5 }; pjsip_uri *uri[PJSUA_ACC_MAX_PROXIES]; - unsigned i, uri_cnt = 0, rcnt; + unsigned i, uri_cnt = 0; + pj_size_t rcnt; /* Find and parse Service-Route headers */ for (;;) { diff --git a/pjsip/src/pjsua-lib/pjsua_aud.c b/pjsip/src/pjsua-lib/pjsua_aud.c index beda1013..d81ac9ab 100644 --- a/pjsip/src/pjsua-lib/pjsua_aud.c +++ b/pjsip/src/pjsua-lib/pjsua_aud.c @@ -554,7 +554,7 @@ static void dtmf_callback(pjmedia_stream *strm, void *user_data, if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { pjsua_call_id call_id; - call_id = (pjsua_call_id)(long)user_data; + call_id = (pjsua_call_id)(pj_ssize_t)user_data; pjsua_var.ua_cfg.cb.on_dtmf_digit(call_id, digit); } @@ -638,7 +638,7 @@ pj_status_t pjsua_aud_channel_update(pjsua_call_media *call_med, if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { pjmedia_stream_set_dtmf_callback(call_med->strm.a.stream, &dtmf_callback, - (void*)(long)(call->index)); + (void*)(pj_ssize_t)(call->index)); } /* Get the port interface of the first stream in the session. @@ -1046,7 +1046,8 @@ PJ_DEF(pj_status_t) pjsua_player_create( const pj_str_t *filename, pj_memcpy(path, filename->ptr, filename->slen); path[filename->slen] = '\0'; - pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); + pool = pjsua_pool_create(get_basename(path, (unsigned)filename->slen), 1000, + 1000); if (!pool) { status = PJ_ENOMEM; goto on_error; @@ -1334,7 +1335,8 @@ PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename, pj_memcpy(path, filename->ptr, filename->slen); path[filename->slen] = '\0'; - pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); + pool = pjsua_pool_create(get_basename(path, (unsigned)filename->slen), 1000, + 1000); if (!pool) { status = PJ_ENOMEM; goto on_return; diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 953a6195..d91ec0ab 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -386,7 +386,7 @@ on_make_call_med_tp_complete(pjsua_call_id call_id, if (status != PJ_SUCCESS) { pj_str_t err_str; - int title_len; + pj_ssize_t title_len; call->last_code = PJSIP_SC_TEMPORARILY_UNAVAILABLE; pj_strcpy2(&call->last_text, "Media init error: "); diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index c52f347e..348c9d51 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -85,7 +85,7 @@ PJ_DEF(void) pjsua_logging_config_default(pjsua_logging_config *cfg) PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_SPACE | PJ_LOG_HAS_THREAD_SWC | PJ_LOG_HAS_INDENT; -#if defined(PJ_WIN32) && PJ_WIN32 != 0 +#if (defined(PJ_WIN32) && PJ_WIN32 != 0) || (defined(PJ_WIN64) && PJ_WIN64 != 0) cfg->decor |= PJ_LOG_HAS_COLOR; #endif } @@ -2679,7 +2679,7 @@ PJ_DEF(pj_status_t) pjsua_verify_url(const char *c_url) pjsip_uri *p; pj_pool_t *pool; char *url; - int len = (c_url ? pj_ansi_strlen(c_url) : 0); + pj_size_t len = (c_url ? pj_ansi_strlen(c_url) : 0); if (!len) return PJSIP_EINVALIDURI; @@ -2703,7 +2703,7 @@ PJ_DEF(pj_status_t) pjsua_verify_sip_url(const char *c_url) pjsip_uri *p; pj_pool_t *pool; char *url; - int len = (c_url ? pj_ansi_strlen(c_url) : 0); + pj_size_t len = (c_url ? pj_ansi_strlen(c_url) : 0); if (!len) return PJSIP_EINVALIDURI; diff --git a/pjsip/src/pjsua-lib/pjsua_dump.c b/pjsip/src/pjsua-lib/pjsua_dump.c index 518326e8..2f8ef73c 100644 --- a/pjsip/src/pjsua-lib/pjsua_dump.c +++ b/pjsip/src/pjsua-lib/pjsua_dump.c @@ -130,7 +130,7 @@ static unsigned dump_media_stat(const char *indent, if (len < 1 || len > end-p) { *p = '\0'; - return (p-buf); + return (unsigned)(p-buf); } p += len; @@ -188,7 +188,7 @@ static unsigned dump_media_stat(const char *indent, if (len < 1 || len > end-p) { *p = '\0'; - return (p-buf); + return (unsigned)(p-buf); } p += len; @@ -203,11 +203,11 @@ static unsigned dump_media_stat(const char *indent, ); if (len < 1 || len > end-p) { *p = '\0'; - return (p-buf); + return (unsigned)(p-buf); } p += len; - return (p-buf); + return (unsigned)(p-buf); } @@ -447,7 +447,7 @@ static void dump_media_session(const char *indent, if (has_stat) { - len = dump_media_stat(indent, p, end-p, &stat, + len = dump_media_stat(indent, p, (unsigned)(end-p), &stat, rx_info, tx_info); p += len; } @@ -948,7 +948,7 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, print_call(indent, call_id, tmp, sizeof(tmp)); - len = pj_ansi_strlen(tmp); + len = (int)pj_ansi_strlen(tmp); pj_ansi_strcpy(buffer, tmp); p += len; @@ -993,7 +993,7 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, /* Dump session statistics */ if (with_media) - dump_media_session(indent, p, end-p, call); + dump_media_session(indent, p, (unsigned)(end-p), call); pjsip_dlg_dec_lock(dlg); diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index dd0054bb..d1b39a11 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -592,7 +592,7 @@ static void ice_init_complete_cb(void *user_data) /* Deferred callback to notify ICE negotiation failure */ static void ice_failed_nego_cb(void *user_data) { - int call_id = (int)(long)user_data; + int call_id = (int)(pj_ssize_t)user_data; pjsua_call *call = NULL; pjsip_dialog *dlg = NULL; @@ -641,7 +641,7 @@ static void on_ice_complete(pjmedia_transport *tp, if (call && pjsua_var.ua_cfg.cb.on_call_media_state) { /* Defer the callback to a timer */ pjsua_schedule_timer2(&ice_failed_nego_cb, - (void*)(long)call->index, 1); + (void*)(pj_ssize_t)call->index, 1); } } /* Check if default ICE transport address is changed */ diff --git a/pjsip/src/pjsua-lib/pjsua_pres.c b/pjsip/src/pjsua-lib/pjsua_pres.c index 47bcd4bc..d4af27df 100644 --- a/pjsip/src/pjsua-lib/pjsua_pres.c +++ b/pjsip/src/pjsua-lib/pjsua_pres.c @@ -223,7 +223,7 @@ PJ_DEF(pj_status_t) pjsua_enum_buddies( pjsua_buddy_id ids[], PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, pjsua_buddy_info *info) { - unsigned total=0; + pj_size_t total=0; struct buddy_lock lck; pjsua_buddy *buddy; pj_status_t status; @@ -1065,7 +1065,7 @@ PJ_DEF(pj_status_t) pjsua_pres_notify( pjsua_acc_id acc_id, PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); PJ_LOG(4,(THIS_FILE, "Acc %d: sending NOTIFY for srv_pres=0x%p..", - acc_id, (int)(long)srv_pres)); + acc_id, (int)(pj_ssize_t)srv_pres)); pj_log_push_indent(); PJSUA_LOCK(); |