summaryrefslogtreecommitdiff
path: root/pjsip/src
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/src')
-rw-r--r--pjsip/src/pjsip-simple/evsub_msg.c12
-rw-r--r--pjsip/src/pjsip-simple/rpid.c4
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c2
-rw-r--r--pjsip/src/pjsip-ua/sip_reg.c2
-rw-r--r--pjsip/src/pjsip-ua/sip_replaces.c6
-rw-r--r--pjsip/src/pjsip-ua/sip_timer.c12
-rw-r--r--pjsip/src/pjsip/sip_auth_client.c3
-rw-r--r--pjsip/src/pjsip/sip_auth_msg.c4
-rw-r--r--pjsip/src/pjsip/sip_endpoint.c6
-rw-r--r--pjsip/src/pjsip/sip_msg.c54
-rw-r--r--pjsip/src/pjsip/sip_multipart.c6
-rw-r--r--pjsip/src/pjsip/sip_parser.c15
-rw-r--r--pjsip/src/pjsip/sip_tel_uri.c6
-rw-r--r--pjsip/src/pjsip/sip_transaction.c30
-rw-r--r--pjsip/src/pjsip/sip_transport.c4
-rw-r--r--pjsip/src/pjsip/sip_transport_tcp.c4
-rw-r--r--pjsip/src/pjsip/sip_transport_tls.c4
-rw-r--r--pjsip/src/pjsip/sip_transport_udp.c7
-rw-r--r--pjsip/src/pjsip/sip_ua_layer.c18
-rw-r--r--pjsip/src/pjsip/sip_uri.c12
-rw-r--r--pjsip/src/pjsip/sip_util.c4
-rw-r--r--pjsip/src/pjsip/sip_util_proxy.c2
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c19
-rw-r--r--pjsip/src/pjsua-lib/pjsua_aud.c10
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c2
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c6
-rw-r--r--pjsip/src/pjsua-lib/pjsua_dump.c14
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c4
-rw-r--r--pjsip/src/pjsua-lib/pjsua_pres.c4
-rw-r--r--pjsip/src/test/msg_test.c12
-rw-r--r--pjsip/src/test/transport_test.c13
-rw-r--r--pjsip/src/test/tsx_basic_test.c2
-rw-r--r--pjsip/src/test/txdata_test.c2
-rw-r--r--pjsip/src/test/uri_test.c11
34 files changed, 166 insertions, 150 deletions
diff --git a/pjsip/src/pjsip-simple/evsub_msg.c b/pjsip/src/pjsip-simple/evsub_msg.c
index df2dd550..b44a715f 100644
--- a/pjsip/src/pjsip-simple/evsub_msg.c
+++ b/pjsip/src/pjsip-simple/evsub_msg.c
@@ -62,7 +62,7 @@ static int pjsip_event_hdr_print( pjsip_event_hdr *hdr,
{
char *p = buf;
char *endbuf = buf+size;
- int printed;
+ pj_ssize_t printed;
const pjsip_parser_const_t *pc = pjsip_parser_const();
copy_advance(p, hdr->name);
@@ -76,10 +76,10 @@ static int pjsip_event_hdr_print( pjsip_event_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
&pc->pjsip_TOKEN_SPEC, ';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_event_hdr* pjsip_event_hdr_clone( pj_pool_t *pool,
@@ -161,7 +161,7 @@ static int pjsip_sub_state_hdr_print(pjsip_sub_state_hdr *hdr,
{
char *p = buf;
char *endbuf = buf+size;
- int printed;
+ pj_ssize_t printed;
const pjsip_parser_const_t *pc = pjsip_parser_const();
copy_advance(p, hdr->name);
@@ -189,11 +189,11 @@ static int pjsip_sub_state_hdr_print(pjsip_sub_state_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_sub_state_hdr*
diff --git a/pjsip/src/pjsip-simple/rpid.c b/pjsip/src/pjsip-simple/rpid.c
index 08218fd0..f02b1372 100644
--- a/pjsip/src/pjsip-simple/rpid.c
+++ b/pjsip/src/pjsip-simple/rpid.c
@@ -66,7 +66,7 @@ static void update_namespaces(pjpidf_pres *pres,
/* Comparison function to find node name substring */
static pj_bool_t substring_match(const pj_xml_node *node,
const char *part_name,
- int part_len)
+ pj_ssize_t part_len)
{
pj_str_t end_name;
@@ -88,7 +88,7 @@ static pj_xml_node *find_node(const pj_xml_node *parent,
{
const pj_xml_node *node = parent->node_head.next,
*head = (pj_xml_node*) &parent->node_head;
- int part_len = pj_ansi_strlen(part_name);
+ pj_ssize_t part_len = pj_ansi_strlen(part_name);
while (node != head) {
if (substring_match(node, part_name, part_len))
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index 1d7bf29c..c457f02e 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -2468,7 +2468,7 @@ PJ_DEF(pj_status_t) pjsip_inv_process_redirect( pjsip_inv_session *inv,
dlg->remote.info->uri, tmp, TMP_LEN);
if (len < 1) {
pj_ansi_strcpy(tmp, "<-error: uri too long->");
- len = pj_ansi_strlen(tmp);
+ len = (int)pj_ansi_strlen(tmp);
}
pj_strdup2_with_null(dlg->pool, &dlg->remote.info_str, tmp);
diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c
index bc7d115e..efc209b6 100644
--- a/pjsip/src/pjsip-ua/sip_reg.c
+++ b/pjsip/src/pjsip-ua/sip_reg.c
@@ -995,7 +995,7 @@ static pj_int32_t calculate_response_expiration(const pjsip_regc *regc,
* if we don't have exact Contact header count, or
* from the request as the last resort.
*/
- unsigned our_contact_cnt;
+ pj_size_t our_contact_cnt;
our_contact_cnt = pj_list_size(&regc->contact_hdr_list);
diff --git a/pjsip/src/pjsip-ua/sip_replaces.c b/pjsip/src/pjsip-ua/sip_replaces.c
index 38793762..b117dd32 100644
--- a/pjsip/src/pjsip-ua/sip_replaces.c
+++ b/pjsip/src/pjsip-ua/sip_replaces.c
@@ -72,7 +72,7 @@ static int replaces_hdr_print( pjsip_replaces_hdr *hdr,
{
char *p = buf;
char *endbuf = buf+size;
- int printed;
+ pj_ssize_t printed;
const pjsip_parser_const_t *pc = pjsip_parser_const();
copy_advance(p, hdr->name);
@@ -92,10 +92,10 @@ static int replaces_hdr_print( pjsip_replaces_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
&pc->pjsip_TOKEN_SPEC, ';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_replaces_hdr* replaces_hdr_clone( pj_pool_t *pool,
diff --git a/pjsip/src/pjsip-ua/sip_timer.c b/pjsip/src/pjsip-ua/sip_timer.c
index dee41155..06bfaf06 100644
--- a/pjsip/src/pjsip-ua/sip_timer.c
+++ b/pjsip/src/pjsip-ua/sip_timer.c
@@ -117,7 +117,7 @@ static int se_hdr_print(pjsip_sess_expires_hdr *hdr,
{
char *p = buf;
char *endbuf = buf+size;
- int printed;
+ pj_ssize_t printed;
const pjsip_parser_const_t *pc = pjsip_parser_const();
const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name;
@@ -149,10 +149,10 @@ static int se_hdr_print(pjsip_sess_expires_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
&pc->pjsip_TOKEN_SPEC, ';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_sess_expires_hdr* se_hdr_clone(pj_pool_t *pool,
@@ -183,7 +183,7 @@ static int min_se_hdr_print(pjsip_min_se_hdr *hdr,
{
char *p = buf;
char *endbuf = buf+size;
- int printed;
+ pj_ssize_t printed;
const pjsip_parser_const_t *pc = pjsip_parser_const();
/* Print header name and value */
@@ -202,10 +202,10 @@ static int min_se_hdr_print(pjsip_min_se_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
&pc->pjsip_TOKEN_SPEC, ';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_min_se_hdr* min_se_hdr_clone(pj_pool_t *pool,
diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c
index 3cea533b..b337e1ef 100644
--- a/pjsip/src/pjsip/sip_auth_client.c
+++ b/pjsip/src/pjsip/sip_auth_client.c
@@ -36,7 +36,8 @@
/* A macro just to get rid of type mismatch between char and unsigned char */
-#define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, len)
+#define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, \
+ (unsigned)len)
/* Logging. */
#define THIS_FILE "sip_auth_client.c"
diff --git a/pjsip/src/pjsip/sip_auth_msg.c b/pjsip/src/pjsip/sip_auth_msg.c
index 349947bf..0f37fae2 100644
--- a/pjsip/src/pjsip/sip_auth_msg.c
+++ b/pjsip/src/pjsip/sip_auth_msg.c
@@ -65,7 +65,7 @@ PJ_DEF(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_p
static int print_digest_credential(pjsip_digest_credential *cred, char *buf, pj_size_t size)
{
- int printed;
+ pj_ssize_t printed;
char *startbuf = buf;
char *endbuf = buf + size;
const pjsip_parser_const_t *pc = pjsip_parser_const();
@@ -227,7 +227,7 @@ PJ_DEF(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_poo
static int print_digest_challenge( pjsip_digest_challenge *chal,
char *buf, pj_size_t size)
{
- int printed;
+ pj_ssize_t printed;
char *startbuf = buf;
char *endbuf = buf + size;
const pjsip_parser_const_t *pc = pjsip_parser_const();
diff --git a/pjsip/src/pjsip/sip_endpoint.c b/pjsip/src/pjsip/sip_endpoint.c
index 63f296f9..7a3a3a38 100644
--- a/pjsip/src/pjsip/sip_endpoint.c
+++ b/pjsip/src/pjsip/sip_endpoint.c
@@ -916,8 +916,8 @@ on_return:
* receives a message from the network.
*/
static void endpt_on_rx_msg( pjsip_endpoint *endpt,
- pj_status_t status,
- pjsip_rx_data *rdata )
+ pj_status_t status,
+ pjsip_rx_data *rdata )
{
pjsip_msg *msg = rdata->msg_info.msg;
pjsip_process_rdata_param proc_prm;
@@ -1204,7 +1204,7 @@ PJ_DEF(void) pjsip_endpt_log_error( pjsip_endpoint *endpt,
{
#if PJ_LOG_MAX_LEVEL > 0
char newformat[256];
- int len;
+ pj_size_t len;
va_list marker;
va_start(marker, format);
diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c
index 0625cf8d..597488e8 100644
--- a/pjsip/src/pjsip/sip_msg.c
+++ b/pjsip/src/pjsip/sip_msg.c
@@ -399,7 +399,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
char *buf, pj_size_t size)
{
char *p=buf, *end=buf+size;
- int len;
+ pj_size_t len;
pjsip_hdr *hdr;
pj_str_t clen_hdr = { "Content-Length: ", 16};
@@ -497,7 +497,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
}
pj_memcpy(p, ctype_hdr.ptr, ctype_hdr.slen);
p += ctype_hdr.slen;
- p += print_media_type(p, end-p, media);
+ p += print_media_type(p, (unsigned)(end-p), media);
*p++ = '\r';
*p++ = '\n';
@@ -535,7 +535,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
*/
if (clen_pos) {
char tmp[16];
- len = pj_utoa(len, tmp);
+ len = pj_utoa((unsigned long)len, tmp);
if (len > CLEN_SPACE) len = CLEN_SPACE;
pj_memcpy(clen_pos+CLEN_SPACE-len, tmp, len);
}
@@ -762,7 +762,7 @@ static int pjsip_generic_string_hdr_print( pjsip_generic_string_hdr *hdr,
p += hdr->hvalue.slen;
*p = '\0';
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_generic_string_hdr* pjsip_generic_string_hdr_clone( pj_pool_t *pool,
@@ -844,7 +844,7 @@ static int pjsip_generic_int_hdr_print( pjsip_generic_int_hdr *hdr,
p += pj_utoa(hdr->ivalue, p);
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_generic_int_hdr* pjsip_generic_int_hdr_clone( pj_pool_t *pool,
@@ -923,7 +923,7 @@ static int pjsip_generic_array_hdr_print( pjsip_generic_array_hdr *hdr,
}
}
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_generic_array_hdr* pjsip_generic_array_hdr_clone( pj_pool_t *pool,
@@ -1071,7 +1071,7 @@ static int pjsip_clen_hdr_print( pjsip_clen_hdr *hdr,
p += len;
*p = '\0';
- return p-buf;
+ return (int)(p-buf);
}
static pjsip_clen_hdr* pjsip_clen_hdr_clone( pj_pool_t *pool, const pjsip_clen_hdr *rhs)
@@ -1141,7 +1141,7 @@ static int pjsip_cseq_hdr_print( pjsip_cseq_hdr *hdr, char *buf, pj_size_t size)
*p = '\0';
- return p-buf;
+ return (int)(p-buf);
}
static pjsip_cseq_hdr* pjsip_cseq_hdr_clone( pj_pool_t *pool,
@@ -1212,7 +1212,7 @@ static int pjsip_contact_hdr_print( pjsip_contact_hdr *hdr, char *buf,
*p++ = ':';
*p++ = ' ';
*p++ = '*';
- return p - buf;
+ return (int)(p - buf);
} else {
int printed;
@@ -1262,15 +1262,15 @@ static int pjsip_contact_hdr_print( pjsip_contact_hdr *hdr, char *buf,
buf += printed + 9;
}
- printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,
- &pc->pjsip_TOKEN_SPEC,
- &pc->pjsip_TOKEN_SPEC,
- ';');
+ printed = (int)pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,
+ &pc->pjsip_TOKEN_SPEC,
+ &pc->pjsip_TOKEN_SPEC,
+ ';');
if (printed < 0)
return printed;
buf += printed;
- return buf-startbuf;
+ return (int)(buf-startbuf);
}
}
@@ -1359,7 +1359,7 @@ static int print_media_type(char *buf, unsigned len,
p += printed;
- return p-buf;
+ return (int)(p-buf);
}
@@ -1387,11 +1387,11 @@ static int pjsip_ctype_hdr_print( pjsip_ctype_hdr *hdr,
*p++ = ':';
*p++ = ' ';
- len = print_media_type(p, buf+size-p, &hdr->media);
+ len = print_media_type(p, (unsigned)(buf+size-p), &hdr->media);
p += len;
*p = '\0';
- return p-buf;
+ return (int)(p-buf);
}
static pjsip_ctype_hdr* pjsip_ctype_hdr_clone( pj_pool_t *pool,
@@ -1511,7 +1511,7 @@ PJ_DEF(pjsip_to_hdr*) pjsip_fromto_hdr_set_to( pjsip_fromto_hdr *hdr )
static int pjsip_fromto_hdr_print( pjsip_fromto_hdr *hdr,
char *buf, pj_size_t size)
{
- int printed;
+ pj_ssize_t printed;
char *startbuf = buf;
char *endbuf = buf + size;
const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name;
@@ -1538,7 +1538,7 @@ static int pjsip_fromto_hdr_print( pjsip_fromto_hdr *hdr,
return -1;
buf += printed;
- return buf-startbuf;
+ return (int)(buf-startbuf);
}
static pjsip_fromto_hdr* pjsip_fromto_hdr_clone( pj_pool_t *pool,
@@ -1692,7 +1692,7 @@ PJ_DEF(pjsip_route_hdr*) pjsip_routing_hdr_set_route( pjsip_routing_hdr *hdr )
static int pjsip_routing_hdr_print( pjsip_routing_hdr *hdr,
char *buf, pj_size_t size )
{
- int printed;
+ pj_ssize_t printed;
char *startbuf = buf;
char *endbuf = buf + size;
const pjsip_parser_const_t *pc = pjsip_parser_const();
@@ -1734,7 +1734,7 @@ static int pjsip_routing_hdr_print( pjsip_routing_hdr *hdr,
return -1;
buf += printed;
- return buf-startbuf;
+ return (int)(buf-startbuf);
}
static pjsip_routing_hdr* pjsip_routing_hdr_clone( pj_pool_t *pool,
@@ -1831,7 +1831,7 @@ static int pjsip_retry_after_hdr_print(pjsip_retry_after_hdr *hdr,
char *endbuf = buf + size;
const pj_str_t *hname = &hdr->name;
const pjsip_parser_const_t *pc = pjsip_parser_const();
- int printed;
+ pj_ssize_t printed;
if ((pj_ssize_t)size < hdr->name.slen + 2+11)
return -1;
@@ -1866,11 +1866,11 @@ static int pjsip_retry_after_hdr_print(pjsip_retry_after_hdr *hdr,
&pc->pjsip_TOKEN_SPEC,
';');
if (printed < 0)
- return printed;
+ return (int)printed;
p += printed;
- return p - buf;
+ return (int)(p - buf);
}
static pjsip_retry_after_hdr* pjsip_retry_after_hdr_clone(pj_pool_t *pool,
@@ -1976,7 +1976,7 @@ PJ_DEF(pjsip_via_hdr*) pjsip_via_hdr_create( pj_pool_t *pool )
static int pjsip_via_hdr_print( pjsip_via_hdr *hdr,
char *buf, pj_size_t size)
{
- int printed;
+ pj_ssize_t printed;
char *startbuf = buf;
char *endbuf = buf + size;
pj_str_t sip_ver = { "SIP/2.0/", 8 };
@@ -2064,7 +2064,7 @@ static int pjsip_via_hdr_print( pjsip_via_hdr *hdr,
return -1;
buf += printed;
- return buf-startbuf;
+ return (int)(buf-startbuf);
}
static pjsip_via_hdr* pjsip_via_hdr_clone( pj_pool_t *pool,
@@ -2208,7 +2208,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_msg_body_create( pj_pool_t *pool,
body->data = pj_pool_alloc(pool, text->slen);
pj_memcpy(body->data, text->ptr, text->slen);
- body->len = text->slen;
+ body->len = (unsigned)text->slen;
body->clone_data = &pjsip_clone_text_data;
body->print_body = &pjsip_print_text_body;
diff --git a/pjsip/src/pjsip/sip_multipart.c b/pjsip/src/pjsip/sip_multipart.c
index 45c7fcaa..5d0e5660 100644
--- a/pjsip/src/pjsip/sip_multipart.c
+++ b/pjsip/src/pjsip/sip_multipart.c
@@ -109,7 +109,7 @@ static int multipart_print_body(struct pjsip_msg_body *msg_body,
}
pj_memcpy(p, ctype_hdr.ptr, ctype_hdr.slen);
p += ctype_hdr.slen;
- p += pjsip_media_type_print(p, end-p, media);
+ p += pjsip_media_type_print(p, (unsigned)(end-p), media);
*p++ = '\r';
*p++ = '\n';
@@ -168,7 +168,7 @@ static int multipart_print_body(struct pjsip_msg_body *msg_body,
#undef SIZE_LEFT
- return p - buf;
+ return (int)(p - buf);
}
static void* multipart_clone_data(pj_pool_t *pool, const void *data,
@@ -489,7 +489,7 @@ static pjsip_multipart_part *parse_multipart_part(pj_pool_t *pool,
if (start_body < end) {
part->body->data = start_body;
- part->body->len = end - start_body;
+ part->body->len = (unsigned)(end - start_body);
} else {
part->body->data = (void*)"";
part->body->len = 0;
diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c
index 66548424..33db355a 100644
--- a/pjsip/src/pjsip/sip_parser.c
+++ b/pjsip/src/pjsip/sip_parser.c
@@ -245,13 +245,13 @@ PJ_DEF(void) pjsip_concat_param_imp(pj_str_t *param, pj_pool_t *pool,
int sepchar)
{
char *new_param, *p;
- int len;
+ pj_size_t len;
len = param->slen + pname->slen + pvalue->slen + 3;
p = new_param = (char*) pj_pool_alloc(pool, len);
if (param->slen) {
- int old_len = param->slen;
+ pj_size_t old_len = param->slen;
pj_memcpy(p, param->ptr, old_len);
p += old_len;
}
@@ -560,7 +560,7 @@ static pj_status_t int_register_parser( const char *name,
rec.hname[rec.hname_len] = '\0';
/* Calculate hash value. */
- rec.hname_hash = pj_hash_calc(0, rec.hname, rec.hname_len);
+ rec.hname_hash = pj_hash_calc(0, rec.hname, (unsigned)rec.hname_len);
/* Get the pos to insert the new handler. */
for (pos=0; pos < handler_count; ++pos) {
@@ -595,7 +595,8 @@ PJ_DEF(pj_status_t) pjsip_register_hdr_parser( const char *hname,
const char *hshortname,
pjsip_parse_hdr_func *fptr)
{
- unsigned i, len;
+ unsigned i;
+ pj_size_t len;
char hname_lcase[PJSIP_MAX_HNAME_LEN+1];
pj_status_t status;
@@ -681,7 +682,7 @@ static pjsip_parse_hdr_func* find_handler(const pj_str_t *hname)
}
/* First, common case, try to find handler with exact name */
- hash = pj_hash_calc(0, hname->ptr, hname->slen);
+ hash = pj_hash_calc(0, hname->ptr, (unsigned)hname->slen);
handler = find_handler_imp(hash, hname);
if (handler)
return handler;
@@ -1064,7 +1065,7 @@ parse_headers:
&ctype_hdr->media);
body->data = scanner->curptr;
- body->len = scanner->end - scanner->curptr;
+ body->len = (unsigned)(scanner->end - scanner->curptr);
body->print_body = &pjsip_print_text_body;
body->clone_data = &pjsip_clone_text_data;
}
@@ -2278,7 +2279,7 @@ PJ_DEF(void*) pjsip_parse_hdr( pj_pool_t *pool, const pj_str_t *hname,
PJ_END
if (parsed_len) {
- *parsed_len = (scanner.curptr - scanner.begin);
+ *parsed_len = (unsigned)(scanner.curptr - scanner.begin);
}
pj_scan_fini(&scanner);
diff --git a/pjsip/src/pjsip/sip_tel_uri.c b/pjsip/src/pjsip/sip_tel_uri.c
index 606e18c3..466a6995 100644
--- a/pjsip/src/pjsip/sip_tel_uri.c
+++ b/pjsip/src/pjsip/sip_tel_uri.c
@@ -210,9 +210,9 @@ static pj_ssize_t tel_uri_print( pjsip_uri_context_e context,
/* Print other parameters. */
- printed = pjsip_param_print_on(&uri->other_param, buf, (endbuf-buf),
- &pjsip_TEL_PNAME_SPEC,
- &pjsip_TEL_PVALUE_SPEC, ';');
+ printed = (int)pjsip_param_print_on(&uri->other_param, buf, (endbuf-buf),
+ &pjsip_TEL_PNAME_SPEC,
+ &pjsip_TEL_PVALUE_SPEC, ';');
if (printed < 0)
return -1;
buf += printed;
diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c
index 70c75342..ec189815 100644
--- a/pjsip/src/pjsip/sip_transaction.c
+++ b/pjsip/src/pjsip/sip_transaction.c
@@ -272,7 +272,7 @@ static pj_status_t create_tsx_key_2543( pj_pool_t *pool,
{
#define SEPARATOR '$'
char *key, *p;
- int len;
+ pj_ssize_t len;
pj_size_t len_required;
pj_str_t *host;
@@ -541,7 +541,7 @@ static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx)
*/
if(pj_hash_get_lower(mod_tsx_layer.htable,
tsx->transaction_key.ptr,
- tsx->transaction_key.slen,
+ (unsigned)tsx->transaction_key.slen,
NULL))
{
pj_mutex_unlock(mod_tsx_layer.mutex);
@@ -561,7 +561,8 @@ static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx)
#ifdef PRECALC_HASH
pj_hash_set_lower( tsx->pool, mod_tsx_layer.htable,
tsx->transaction_key.ptr,
- tsx->transaction_key.slen, tsx->hashed_key, tsx);
+ (unsigned)tsx->transaction_key.slen,
+ tsx->hashed_key, tsx);
#else
pj_hash_set_lower( tsx->pool, mod_tsx_layer.htable,
tsx->transaction_key.ptr,
@@ -598,7 +599,8 @@ static void mod_tsx_layer_unregister_tsx( pjsip_transaction *tsx)
/* Register the transaction to the hash table. */
#ifdef PRECALC_HASH
pj_hash_set_lower( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr,
- tsx->transaction_key.slen, tsx->hashed_key, NULL);
+ (unsigned)tsx->transaction_key.slen, tsx->hashed_key,
+ NULL);
#else
pj_hash_set_lower( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr,
tsx->transaction_key.slen, 0, NULL);
@@ -644,8 +646,8 @@ PJ_DEF(pjsip_transaction*) pjsip_tsx_layer_find_tsx( const pj_str_t *key,
pj_mutex_lock(mod_tsx_layer.mutex);
tsx = (pjsip_transaction*)
- pj_hash_get_lower( mod_tsx_layer.htable, key->ptr, key->slen,
- &hval );
+ pj_hash_get_lower( mod_tsx_layer.htable, key->ptr,
+ (unsigned)key->slen, &hval );
pj_mutex_unlock(mod_tsx_layer.mutex);
TSX_TRACE_((THIS_FILE,
@@ -778,7 +780,8 @@ static pj_bool_t mod_tsx_layer_on_rx_request(pjsip_rx_data *rdata)
pj_mutex_lock( mod_tsx_layer.mutex );
tsx = (pjsip_transaction*)
- pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
+ pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, (unsigned)key.slen,
+ &hval );
TSX_TRACE_((THIS_FILE,
@@ -828,7 +831,8 @@ static pj_bool_t mod_tsx_layer_on_rx_response(pjsip_rx_data *rdata)
pj_mutex_lock( mod_tsx_layer.mutex );
tsx = (pjsip_transaction*)
- pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
+ pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, (unsigned)key.slen,
+ &hval );
TSX_TRACE_((THIS_FILE,
@@ -1845,9 +1849,9 @@ static void send_msg_callback( pjsip_send_state *send_state,
pjsip_status_code sc;
pj_str_t err;
- tsx->transport_err = -sent;
+ tsx->transport_err = (pj_status_t)-sent;
- err =pj_strerror(-sent, errmsg, sizeof(errmsg));
+ err =pj_strerror((pj_status_t)-sent, errmsg, sizeof(errmsg));
PJ_LOG(2,(tsx->obj_name,
"Failed to send %s! err=%d (%s)",
@@ -1887,7 +1891,7 @@ static void send_msg_callback( pjsip_send_state *send_state,
}
} else {
- PJ_PERROR(2,(tsx->obj_name, -sent,
+ PJ_PERROR(2,(tsx->obj_name, (pj_status_t)-sent,
"Temporary failure in sending %s, "
"will try next server",
pjsip_tx_data_get_info(send_state->tdata)));
@@ -1934,7 +1938,7 @@ static void transport_callback(void *token, pjsip_tx_data *tdata,
pj_time_val delay = {0, 0};
char errmsg[PJ_ERR_MSG_SIZE];
- pj_strerror(-sent, errmsg, sizeof(errmsg));
+ pj_strerror((pj_status_t)-sent, errmsg, sizeof(errmsg));
PJ_LOG(2,(tsx->obj_name, "Transport failed to send %s! Err=%d (%s)",
pjsip_tx_data_get_info(tdata), -sent, errmsg));
@@ -1943,7 +1947,7 @@ static void transport_callback(void *token, pjsip_tx_data *tdata,
* See https://trac.pjsip.org/repos/ticket/1646
*/
lock_timer(tsx);
- tsx->transport_err = -sent;
+ tsx->transport_err = (pj_status_t)-sent;
tsx_cancel_timer(tsx, &tsx->timeout_timer);
tsx_schedule_timer(tsx, &tsx->timeout_timer, &delay,
TRANSPORT_ERR_TIMER);
diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c
index 7915f5e6..7caa2e99 100644
--- a/pjsip/src/pjsip/sip_transport.c
+++ b/pjsip/src/pjsip/sip_transport.c
@@ -1626,7 +1626,7 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr,
pj_bzero(&rdata->msg_info, sizeof(rdata->msg_info));
pj_list_init(&rdata->msg_info.parse_err);
rdata->msg_info.msg_buf = current_pkt;
- rdata->msg_info.len = remaining_len;
+ rdata->msg_info.len = (int)remaining_len;
/* For TCP transport, check if the whole message has been received. */
if ((tr->flag & PJSIP_TRANSPORT_DATAGRAM) == 0) {
@@ -1646,7 +1646,7 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr,
}
/* Update msg_info. */
- rdata->msg_info.len = msg_fragment_size;
+ rdata->msg_info.len = (int)msg_fragment_size;
/* Null terminate packet */
saved = current_pkt[msg_fragment_size];
diff --git a/pjsip/src/pjsip/sip_transport_tcp.c b/pjsip/src/pjsip/sip_transport_tcp.c
index 38bd42ae..22359858 100644
--- a/pjsip/src/pjsip/sip_transport_tcp.c
+++ b/pjsip/src/pjsip/sip_transport_tcp.c
@@ -826,7 +826,7 @@ static pj_status_t tcp_destroy(pjsip_transport *transport,
static pj_status_t tcp_start_read(struct tcp_transport *tcp)
{
pj_pool_t *pool;
- pj_ssize_t size;
+ pj_uint32_t size;
pj_sockaddr *rem_addr;
void *readbuf[1];
pj_status_t status;
@@ -1113,7 +1113,7 @@ static pj_bool_t on_data_sent(pj_activesock_t *asock,
bytes_sent));
status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) :
- -bytes_sent;
+ (pj_status_t)-bytes_sent;
tcp_init_shutdown(tcp, status);
diff --git a/pjsip/src/pjsip/sip_transport_tls.c b/pjsip/src/pjsip/sip_transport_tls.c
index 06244e53..dc83ab8b 100644
--- a/pjsip/src/pjsip/sip_transport_tls.c
+++ b/pjsip/src/pjsip/sip_transport_tls.c
@@ -834,7 +834,7 @@ static pj_status_t tls_destroy(pjsip_transport *transport,
static pj_status_t tls_start_read(struct tls_transport *tls)
{
pj_pool_t *pool;
- pj_ssize_t size;
+ pj_uint32_t size;
pj_sockaddr *rem_addr;
void *readbuf[1];
pj_status_t status;
@@ -1219,7 +1219,7 @@ static pj_bool_t on_data_sent(pj_ssl_sock_t *ssock,
bytes_sent));
status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) :
- -bytes_sent;
+ (pj_status_t)-bytes_sent;
tls_init_shutdown(tls, status);
diff --git a/pjsip/src/pjsip/sip_transport_udp.c b/pjsip/src/pjsip/sip_transport_udp.c
index 9256a25b..0f964a7d 100644
--- a/pjsip/src/pjsip/sip_transport_udp.c
+++ b/pjsip/src/pjsip/sip_transport_udp.c
@@ -96,7 +96,7 @@ static void init_rdata(struct udp_transport *tp, unsigned rdata_index,
/* Init tp_info part. */
rdata->tp_info.pool = pool;
rdata->tp_info.transport = &tp->base;
- rdata->tp_info.tp_data = (void*)(long)rdata_index;
+ rdata->tp_info.tp_data = (void*)(pj_ssize_t)rdata_index;
rdata->tp_info.op_key.rdata = rdata;
pj_ioqueue_op_key_init(&rdata->tp_info.op_key.op_key,
sizeof(pj_ioqueue_op_key_t));
@@ -193,7 +193,7 @@ static void udp_on_read_complete( pj_ioqueue_key_t *key,
/* Report error to endpoint. */
PJSIP_ENDPT_LOG_ERROR((rdata->tp_info.transport->endpt,
rdata->tp_info.transport->obj_name,
- -bytes_read,
+ (pj_status_t)-bytes_read,
"Warning: pj_ioqueue_recvfrom()"
" callback error"));
}
@@ -215,7 +215,8 @@ static void udp_on_read_complete( pj_ioqueue_key_t *key,
unsigned rdata_index;
rdata_tp = (struct udp_transport*)rdata->tp_info.transport;
- rdata_index = (unsigned)(unsigned long)rdata->tp_info.tp_data;
+ rdata_index = (unsigned)(unsigned long)(pj_ssize_t)
+ rdata->tp_info.tp_data;
pj_pool_reset(rdata_pool);
init_rdata(rdata_tp, rdata_index, rdata_pool, &rdata);
diff --git a/pjsip/src/pjsip/sip_ua_layer.c b/pjsip/src/pjsip/sip_ua_layer.c
index 073b25e3..021005a4 100644
--- a/pjsip/src/pjsip/sip_ua_layer.c
+++ b/pjsip/src/pjsip/sip_ua_layer.c
@@ -304,7 +304,7 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua,
dlg_set = (struct dlg_set*)
pj_hash_get_lower( mod_ua.dlg_table,
dlg->local.info->tag.ptr,
- dlg->local.info->tag.slen,
+ (unsigned)dlg->local.info->tag.slen,
&dlg->local.tag_hval);
if (dlg_set) {
@@ -329,7 +329,7 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua,
/* Register the dialog set in the hash table. */
pj_hash_set_np_lower(mod_ua.dlg_table,
dlg->local.info->tag.ptr,
- dlg->local.info->tag.slen,
+ (unsigned)dlg->local.info->tag.slen,
dlg->local.tag_hval, dlg_set->ht_entry,
dlg_set);
}
@@ -346,7 +346,7 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua,
pj_hash_set_np_lower(mod_ua.dlg_table,
dlg->local.info->tag.ptr,
- dlg->local.info->tag.slen,
+ (unsigned)dlg->local.info->tag.slen,
dlg->local.tag_hval, dlg_set->ht_entry, dlg_set);
}
@@ -392,8 +392,8 @@ PJ_DEF(pj_status_t) pjsip_ua_unregister_dlg( pjsip_user_agent *ua,
/* If dialog list is empty, remove the dialog set from the hash table. */
if (pj_list_empty(&dlg_set->dlg_list)) {
pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr,
- dlg->local.info->tag.slen, dlg->local.tag_hval,
- NULL);
+ (unsigned)dlg->local.info->tag.slen,
+ dlg->local.tag_hval, NULL);
/* Return dlg_set to free nodes. */
pj_list_push_back(&mod_ua.free_dlgset_nodes, dlg_set);
@@ -455,7 +455,7 @@ PJ_DEF(pjsip_dialog*) pjsip_ua_find_dialog(const pj_str_t *call_id,
/* Lookup the dialog set. */
dlg_set = (struct dlg_set*)
pj_hash_get_lower(mod_ua.dlg_table, local_tag->ptr,
- local_tag->slen, NULL);
+ (unsigned)local_tag->slen, NULL);
if (dlg_set == NULL) {
/* Not found */
pj_mutex_unlock(mod_ua.mutex);
@@ -568,8 +568,8 @@ static struct dlg_set *find_dlg_set_for_msg( pjsip_rx_data *rdata )
/* Lookup the dialog set. */
dlg_set = (struct dlg_set*)
- pj_hash_get_lower(mod_ua.dlg_table, tag->ptr, tag->slen,
- NULL);
+ pj_hash_get_lower(mod_ua.dlg_table, tag->ptr,
+ (unsigned)tag->slen, NULL);
return dlg_set;
}
}
@@ -769,7 +769,7 @@ retry_on_deadlock:
dlg_set = (struct dlg_set*)
pj_hash_get_lower(mod_ua.dlg_table,
rdata->msg_info.from->tag.ptr,
- rdata->msg_info.from->tag.slen,
+ (unsigned)rdata->msg_info.from->tag.slen,
NULL);
if (!dlg_set) {
diff --git a/pjsip/src/pjsip/sip_uri.c b/pjsip/src/pjsip/sip_uri.c
index df125bae..0870186c 100644
--- a/pjsip/src/pjsip/sip_uri.c
+++ b/pjsip/src/pjsip/sip_uri.c
@@ -358,9 +358,9 @@ static pj_ssize_t pjsip_url_print( pjsip_uri_context_e context,
}
/* Other param. */
- printed = pjsip_param_print_on(&url->other_param, buf, endbuf-buf,
- &pc->pjsip_PARAM_CHAR_SPEC,
- &pc->pjsip_PARAM_CHAR_SPEC, ';');
+ printed = (int)pjsip_param_print_on(&url->other_param, buf, endbuf-buf,
+ &pc->pjsip_PARAM_CHAR_SPEC,
+ &pc->pjsip_PARAM_CHAR_SPEC, ';');
if (printed < 0)
return -1;
buf += printed;
@@ -371,9 +371,9 @@ static pj_ssize_t pjsip_url_print( pjsip_uri_context_e context,
* - PJSIP_URI_IN_OTHER
*/
if (context == PJSIP_URI_IN_CONTACT_HDR || context == PJSIP_URI_IN_OTHER) {
- printed = pjsip_param_print_on(&url->header_param, buf, endbuf-buf,
- &pc->pjsip_HDR_CHAR_SPEC,
- &pc->pjsip_HDR_CHAR_SPEC, '?');
+ printed = (int)pjsip_param_print_on(&url->header_param, buf, endbuf-buf,
+ &pc->pjsip_HDR_CHAR_SPEC,
+ &pc->pjsip_HDR_CHAR_SPEC, '?');
if (printed < 0)
return -1;
buf += printed;
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c
index 411251d0..520d8732 100644
--- a/pjsip/src/pjsip/sip_util.c
+++ b/pjsip/src/pjsip/sip_util.c
@@ -274,7 +274,7 @@ static void init_request_throw( pjsip_endpoint *endpt,
body->content_type.subtype = str_PLAIN;
body->data = pj_pool_alloc(tdata->pool, param_text->slen );
pj_memcpy(body->data, param_text->ptr, param_text->slen);
- body->len = param_text->slen;
+ body->len = (unsigned)param_text->slen;
body->print_body = &pjsip_print_text_body;
msg->body = body;
}
@@ -1301,7 +1301,7 @@ stateless_send_resolver_callback( pj_status_t status,
}
/* Check if request message is larger than 1300 bytes. */
- len = tdata->buf.cur - tdata->buf.start;
+ len = (int)(tdata->buf.cur - tdata->buf.start);
if (len >= PJSIP_UDP_SIZE_THRESHOLD) {
int i;
int count = tdata->dest_info.addr.count;
diff --git a/pjsip/src/pjsip/sip_util_proxy.c b/pjsip/src/pjsip/sip_util_proxy.c
index 240cf18b..2264accb 100644
--- a/pjsip/src/pjsip/sip_util_proxy.c
+++ b/pjsip/src/pjsip/sip_util_proxy.c
@@ -370,7 +370,7 @@ PJ_DEF(pj_str_t) pjsip_calculate_branch_id( pjsip_rx_data *rdata )
*/
pj_md5_init(&ctx);
pj_md5_update(&ctx, (pj_uint8_t*)rdata->msg_info.via->branch_param.ptr,
- rdata->msg_info.via->branch_param.slen);
+ (unsigned)rdata->msg_info.via->branch_param.slen);
pj_md5_final(&ctx, digest);
branch.ptr = (char*)
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();
diff --git a/pjsip/src/test/msg_test.c b/pjsip/src/test/msg_test.c
index 51d002db..e0448462 100644
--- a/pjsip/src/test/msg_test.c
+++ b/pjsip/src/test/msg_test.c
@@ -247,7 +247,7 @@ static pj_status_t test_entry( pj_pool_t *pool, struct test_msg *entry )
pjsip_msg *parsed_msg, *ref_msg = NULL;
static pjsip_msg *print_msg;
pj_status_t status = PJ_SUCCESS;
- int len;
+ pj_ssize_t len;
pj_str_t str1, str2;
pjsip_hdr *hdr1, *hdr2;
pj_timestamp t1, t2;
@@ -809,7 +809,7 @@ static pjsip_msg *create_msg1(pj_pool_t *pool)
"c=IN IP4 pc33.atlanta.com\r\n"
"m=audio 3456 RTP/AVP 0 1 3 99\r\n"
"a=rtpmap:0 PCMU/8000\r\n";
- body->len = pj_ansi_strlen((const char*) body->data);
+ body->len = (unsigned)pj_ansi_strlen((const char*) body->data);
body->print_body = &pjsip_print_text_body;
return msg;
@@ -1888,7 +1888,8 @@ static int hdr_test(void)
for (i=0; i<PJ_ARRAY_SIZE(hdr_test_data); ++i) {
struct hdr_test_t *test = &hdr_test_data[i];
pj_str_t hname;
- int len, parsed_len;
+ pj_size_t len;
+ int parsed_len;
pj_pool_t *pool;
pjsip_hdr *parsed_hdr1=NULL, *parsed_hdr2=NULL;
char *input, *output;
@@ -1994,7 +1995,8 @@ int msg_test(void)
unsigned parse;
unsigned print;
} run[COUNT];
- unsigned i, max, avg_len;
+ unsigned i, max;
+ int avg_len;
char desc[250];
pj_status_t status;
@@ -2016,7 +2018,7 @@ int msg_test(void)
/* Calculate average message length */
for (i=0, avg_len=0; i<PJ_ARRAY_SIZE(test_array); ++i) {
- avg_len += test_array[i].len;
+ avg_len += (int)test_array[i].len;
}
avg_len /= PJ_ARRAY_SIZE(test_array);
diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c
index a1cb6056..ab22c5ef 100644
--- a/pjsip/src/test/transport_test.c
+++ b/pjsip/src/test/transport_test.c
@@ -163,7 +163,7 @@ static void send_msg_callback(pjsip_send_state *stateless_data,
if (sent < 1) {
/* Obtain the error code. */
- send_status = -sent;
+ send_status = (int)-sent;
} else {
send_status = PJ_SUCCESS;
}
@@ -415,7 +415,7 @@ static pj_status_t rt_send_request(int thread_id)
pjsip_endpt_cancel_timer(endpt, &rt_test_data[thread_id].timeout_timer);
}
timeout_delay.sec = 100; timeout_delay.msec = 0;
- rt_test_data[thread_id].timeout_timer.user_data = (void*)1;
+ rt_test_data[thread_id].timeout_timer.user_data = (void*)(pj_ssize_t)1;
pjsip_endpt_schedule_timer(endpt, &rt_test_data[thread_id].timeout_timer,
&timeout_delay);
@@ -445,7 +445,7 @@ static pj_bool_t rt_on_rx_response(pjsip_rx_data *rdata)
if (!rt_stop) {
pj_time_val tx_delay = { 0, 0 };
pj_assert(rt_test_data[thread_id].tx_timer.user_data == NULL);
- rt_test_data[thread_id].tx_timer.user_data = (void*)1;
+ rt_test_data[thread_id].tx_timer.user_data = (void*)(pj_ssize_t)1;
pjsip_endpt_schedule_timer(endpt, &rt_test_data[thread_id].tx_timer,
&tx_delay);
}
@@ -468,7 +468,7 @@ static void rt_timeout_timer( pj_timer_heap_t *timer_heap,
if (rt_test_data[entry->id].tx_timer.user_data == NULL) {
pj_time_val delay = { 0, 0 };
- rt_test_data[entry->id].tx_timer.user_data = (void*)1;
+ rt_test_data[entry->id].tx_timer.user_data = (void*)(pj_ssize_t)1;
pjsip_endpt_schedule_timer(endpt, &rt_test_data[entry->id].tx_timer,
&delay);
}
@@ -585,7 +585,8 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
}
/* Create thread, suspended. */
- status = pj_thread_create(pool, "rttest%p", &rt_worker_thread, (void*)(long)i, 0,
+ status = pj_thread_create(pool, "rttest%p", &rt_worker_thread,
+ (void*)(pj_ssize_t)i, 0,
PJ_THREAD_SUSPENDED, &rt_test_data[i].thread);
if (status != PJ_SUCCESS) {
app_perror(" error: unable to create thread", status);
@@ -599,7 +600,7 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
pj_thread_resume(rt_test_data[i].thread);
/* Schedule first message transmissions. */
- rt_test_data[i].tx_timer.user_data = (void*)1;
+ rt_test_data[i].tx_timer.user_data = (void*)(pj_ssize_t)1;
pjsip_endpt_schedule_timer(endpt, &rt_test_data[i].tx_timer, &delay);
}
diff --git a/pjsip/src/test/tsx_basic_test.c b/pjsip/src/test/tsx_basic_test.c
index 2de73d75..baae9fd3 100644
--- a/pjsip/src/test/tsx_basic_test.c
+++ b/pjsip/src/test/tsx_basic_test.c
@@ -160,7 +160,7 @@ int tsx_basic_test(struct tsx_test_param *param)
struct tsx_test_state
{
- int pool_cnt;
+ pj_size_t pool_cnt;
};
static void save_tsx_test_state(struct tsx_test_state *st)
diff --git a/pjsip/src/test/txdata_test.c b/pjsip/src/test/txdata_test.c
index 6e87b86d..f7f73651 100644
--- a/pjsip/src/test/txdata_test.c
+++ b/pjsip/src/test/txdata_test.c
@@ -431,7 +431,7 @@ static int txdata_test_uri_params(void)
pjsip_via_hdr *via;
pjsip_parser_err_report err_list;
pjsip_msg *msg;
- int len;
+ pj_ssize_t len;
pj_status_t status;
PJ_LOG(3,(THIS_FILE, " header param in URI to create request"));
diff --git a/pjsip/src/test/uri_test.c b/pjsip/src/test/uri_test.c
index eda3c0e9..c647764c 100644
--- a/pjsip/src/test/uri_test.c
+++ b/pjsip/src/test/uri_test.c
@@ -1039,7 +1039,8 @@ int uri_test(void)
unsigned print;
unsigned cmp;
} run[COUNT];
- unsigned i, max, avg_len;
+ unsigned i, max;
+ pj_ssize_t avg_len;
char desc[200];
pj_status_t status;
@@ -1074,12 +1075,12 @@ int uri_test(void)
"<tt>pjsip_parse_uri()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), (int)avg_len);
report_ival("uri-parse-per-sec", max, "URI/sec", desc);
/* URI parsing bandwidth */
- report_ival("uri-parse-bandwidth-mb", avg_len*max/1000000, "MB/sec",
+ report_ival("uri-parse-bandwidth-mb", (int)avg_len*max/1000000, "MB/sec",
"URI parsing bandwidth in megabytes (number of megabytes "
"worth of URI that can be parsed per second)");
@@ -1094,7 +1095,7 @@ int uri_test(void)
"<tt>pjsip_uri_print()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), (int)avg_len);
report_ival("uri-print-per-sec", max, "URI/sec", desc);
@@ -1108,7 +1109,7 @@ int uri_test(void)
"<tt>pjsip_uri_cmp()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), (int)avg_len);
report_ival("uri-cmp-per-sec", max, "URI/sec", desc);