Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1264)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1266)
@@ -204,5 +204,5 @@
     pjsua_acc *acc;
     pjsua_call *call;
-    unsigned call_id;
+    int call_id = -1;
     pj_str_t contact;
     pjsip_tx_data *tdata;
@@ -211,5 +211,5 @@
 
     /* Check that account is valid */
-    PJ_ASSERT_RETURN(acc_id>=0 || acc_id<PJ_ARRAY_SIZE(pjsua_var.acc), 
+    PJ_ASSERT_RETURN(acc_id>=0 || acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc), 
 		     PJ_EINVAL);
 
@@ -231,10 +231,10 @@
 
     /* Find free call slot. */
-    for (call_id=0; call_id<pjsua_var.ua_cfg.max_calls; ++call_id) {
+    for (call_id=0; call_id<(int)pjsua_var.ua_cfg.max_calls; ++call_id) {
 	if (pjsua_var.calls[call_id].inv == NULL)
 	    break;
     }
 
-    if (call_id == pjsua_var.ua_cfg.max_calls) {
+    if (call_id == (int)pjsua_var.ua_cfg.max_calls) {
 	pjsua_perror(THIS_FILE, "Error making file", PJ_ETOOMANY);
 	PJSUA_UNLOCK();
@@ -508,5 +508,5 @@
 
 	/* Get the replaced call instance */
-	replaced_call = replaced_dlg->mod_data[pjsua_var.mod.id];
+	replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id];
 
 	/* Notify application */
@@ -691,5 +691,5 @@
 
 	/* Get the replaced call instance */
-	replaced_call = replaced_dlg->mod_data[pjsua_var.mod.id];
+	replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id];
 
 	/* Notify application */
@@ -1378,5 +1378,5 @@
 		      dest_dlg->remote.info->tag.slen +
 		      dest_dlg->local.info->tag.slen + 32 
-		      < sizeof(str_dest_buf), PJSIP_EURITOOLONG);
+		      < (long)sizeof(str_dest_buf), PJSIP_EURITOOLONG);
 
     /* Print URI */
@@ -1384,5 +1384,5 @@
     str_dest.slen = 1;
 
-    uri = pjsip_uri_get_uri(dest_dlg->remote.info->uri);
+    uri = (pjsip_uri*) pjsip_uri_get_uri(dest_dlg->remote.info->uri);
     len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, uri, 
 		          str_dest_buf+1, sizeof(str_dest_buf)-1);
@@ -1510,5 +1510,5 @@
 
     /* Create IM data and attach to the request. */
-    im_data = pj_pool_zalloc(tdata->pool, sizeof(*im_data));
+    im_data = PJ_POOL_ZALLOC_T(tdata->pool, pjsua_im_data);
     im_data->acc_id = call->acc_id;
     im_data->call_id = call_id;
@@ -1935,5 +1935,5 @@
     PJSUA_LOCK();
 
-    call = inv->dlg->mod_data[pjsua_var.mod.id];
+    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
 
     if (!call) {
@@ -2105,5 +2105,5 @@
     PJSUA_LOCK();
 
-    call = inv->dlg->mod_data[pjsua_var.mod.id];
+    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
 
     if (status != PJ_SUCCESS) {
@@ -2232,5 +2232,5 @@
     PJSUA_LOCK();
 
-    call = inv->dlg->mod_data[pjsua_var.mod.id];
+    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
 
     /*
@@ -2315,5 +2315,5 @@
 	pjsua_call *call;
 
-	call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+	call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
 
 	/* Must be receipt of response message */
@@ -2378,5 +2378,5 @@
 	pj_status_t status;
 
-	call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+	call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
 
 	/* When subscription is terminated, clear the xfer_sub member of 
@@ -2422,5 +2422,5 @@
 
 	    /* Try to parse the content */
-	    status = pjsip_parse_status_line(body->data, body->len, 
+	    status = pjsip_parse_status_line((char*)body->data, body->len, 
 					     &status_line);
 	    if (status != PJ_SUCCESS) {
@@ -2467,5 +2467,5 @@
 	pjsua_call *call;
 
-	call = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+	call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
 	if (!call)
 	    return;
@@ -2502,5 +2502,5 @@
     pjsip_evsub *sub;
 
-    existing_call = inv->dlg->mod_data[pjsua_var.mod.id];
+    existing_call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
 
     /* Find the Refer-To header */
@@ -2529,5 +2529,6 @@
      * request.
      */
-    ref_by_hdr = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by, 
+    ref_by_hdr = (pjsip_hdr*)
+		 pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by, 
 					    NULL);
 
@@ -2656,5 +2657,6 @@
      */
     if (ref_by_hdr != NULL) {
-	pjsip_hdr *dup = pjsip_hdr_clone(rdata->tp_info.pool, ref_by_hdr);
+	pjsip_hdr *dup = (pjsip_hdr*)
+			 pjsip_hdr_clone(rdata->tp_info.pool, ref_by_hdr);
 	pj_list_push_back(&msg_data.hdr_list, dup);
     }
@@ -2711,5 +2713,5 @@
 					    pjsip_event *e)
 {
-    pjsua_call *call = inv->dlg->mod_data[pjsua_var.mod.id];
+    pjsua_call *call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
 
     PJSUA_LOCK();
@@ -2773,5 +2775,5 @@
 	    pjsua_im_data *im_data;
 
-	    im_data = tsx->mod_data[pjsua_var.mod.id];
+	    im_data = (pjsua_im_data*) tsx->mod_data[pjsua_var.mod.id];
 	    /* im_data can be NULL if this is typing indication */
 
