summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip
diff options
context:
space:
mode:
authorRiza Sulistyo <riza@teluu.com>2013-06-19 06:47:43 +0000
committerRiza Sulistyo <riza@teluu.com>2013-06-19 06:47:43 +0000
commitd7aa4332dae06ae890053dd13239ddabee46b86c (patch)
tree34c599b317369bcc33827d5ee1200604a6599164 /pjsip/src/pjsip
parent7949b9e53b97281cfa4526ffe5cf7c7d887b7025 (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/pjsip')
-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
16 files changed, 93 insertions, 86 deletions
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*)