Index: pjproject/trunk/build.symbian/pjsdp.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjsdp.mmp	(revision 1240)
+++ pjproject/trunk/build.symbian/pjsdp.mmp	(revision 1240)
@@ -0,0 +1,29 @@
+TARGET 		pjsdp.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjmedia\src\pjmedia
+
+OPTION		CW -lang c++
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_EXPORTING
+
+//
+// Platform independent source
+//
+SOURCE		errno.c
+SOURCE		sdp.c
+SOURCE		sdp_cmp.c
+SOURCE		sdp_neg.c
+
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjmedia\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
Index: pjproject/trunk/build.symbian/pjsip.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjsip.mmp	(revision 1240)
+++ pjproject/trunk/build.symbian/pjsip.mmp	(revision 1240)
@@ -0,0 +1,46 @@
+TARGET 		pjsip.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// PJSIP-CORE files
+
+SOURCE	sip_auth_client.c
+SOURCE	sip_auth_msg.c
+SOURCE	sip_auth_parser.c
+SOURCE	sip_auth_server.c
+SOURCE	sip_dialog.c
+SOURCE	sip_endpoint.c
+SOURCE	sip_errno.c
+SOURCE	sip_msg.c
+SOURCE	sip_parser.c
+SOURCE	sip_resolve.c
+SOURCE	sip_tel_uri.c
+SOURCE	sip_transaction.c
+SOURCE	sip_transport.c
+SOURCE	sip_transport_loop.c
+SOURCE	sip_transport_tcp.c
+SOURCE	sip_transport_udp.c
+SOURCE	sip_ua_layer.c
+SOURCE	sip_uri.c
+SOURCE	sip_util.c
+SOURCE	sip_util_proxy.c
+SOURCE	sip_util_statefull.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: pjproject/trunk/build.symbian/pjsip_simple.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjsip_simple.mmp	(revision 1240)
+++ pjproject/trunk/build.symbian/pjsip_simple.mmp	(revision 1240)
@@ -0,0 +1,35 @@
+TARGET 		pjsip_simple.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip-simple
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+//OPTION		CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE	errno.c
+SOURCE	evsub.c
+SOURCE	evsub_msg.c
+SOURCE	iscomposing.c
+SOURCE	pidf.c
+SOURCE	presence.c
+SOURCE	presence_body.c
+SOURCE	publishc.c
+SOURCE	xpidf.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: pjproject/trunk/build.symbian/pjsip_ua.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjsip_ua.mmp	(revision 1240)
+++ pjproject/trunk/build.symbian/pjsip_ua.mmp	(revision 1240)
@@ -0,0 +1,31 @@
+TARGET 		pjsip_ua.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip-ua
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+//OPTION		CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE	sip_inv.c
+SOURCE	sip_reg.c
+SOURCE	sip_replaces.c
+SOURCE	sip_xfer.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include 
+SYSTEMINCLUDE	..\pjmedia\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: pjproject/trunk/pjlib/include/pj/config_site_sample.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/config_site_sample.h	(revision 1239)
+++ pjproject/trunk/pjlib/include/pj/config_site_sample.h	(revision 1240)
@@ -27,4 +27,10 @@
 #endif
 
+/*
+ * Typical configuration for Symbian OS target
+ */
+#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+#   define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
+#endif
 
 
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 1239)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 1240)
@@ -104,5 +104,5 @@
     PJ_ASSERT_RETURN(pool && name, NULL);
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
     pj_strdup2(pool, &attr->name, name);
 
@@ -124,5 +124,5 @@
     PJ_ASSERT_RETURN(pool && rhs, NULL);
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
 
     pj_strdup(pool, &attr->name, &rhs->name);
@@ -308,5 +308,5 @@
 	status = PJ_SUCCESS;
     }
-    PJ_CATCH(SYNTAX_ERROR) {
+    PJ_CATCH_ANY {
 	status = PJMEDIA_SDP_EINRTPMAP;
     }
@@ -403,5 +403,5 @@
 
     }
-    PJ_CATCH(SYNTAX_ERROR) {
+    PJ_CATCH_ANY {
 	status = PJMEDIA_SDP_EINRTCP;
     }
@@ -420,5 +420,5 @@
     PJ_ASSERT_RETURN(pool && attr && p_rtpmap, PJ_EINVAL);
 
-    *p_rtpmap = pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));
+    *p_rtpmap = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_rtpmap);
     PJ_ASSERT_RETURN(*p_rtpmap, PJ_ENOMEM);
 
@@ -443,5 +443,5 @@
 
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
     PJ_ASSERT_RETURN(attr != NULL, PJ_ENOMEM);
 
@@ -465,5 +465,5 @@
 
     attr->value.slen = len;
-    attr->value.ptr = pj_pool_alloc(pool, attr->value.slen);
+    attr->value.ptr = (char*) pj_pool_alloc(pool, attr->value.slen);
     pj_memcpy(attr->value.ptr, tempbuf, attr->value.slen);
 
@@ -494,5 +494,5 @@
 						  const pjmedia_sdp_conn *rhs)
 {
-    pjmedia_sdp_conn *c = pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));
+    pjmedia_sdp_conn *c = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_conn);
     if (!c) return NULL;
 
@@ -589,5 +589,5 @@
 {
     unsigned int i;
-    pjmedia_sdp_media *m = pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));
+    pjmedia_sdp_media *m = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_media);
     PJ_ASSERT_RETURN(m != NULL, NULL);
 
@@ -968,5 +968,5 @@
     ctx->last_error = PJMEDIA_SDP_EINATTR;
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
 
     /* check equal sign */
@@ -1016,5 +1016,5 @@
     pjmedia_sdp_session *session;
     pjmedia_sdp_media *media = NULL;
-    void *attr;
+    pjmedia_sdp_attr *attr;
     pjmedia_sdp_conn *conn;
     pj_str_t dummy;
@@ -1028,5 +1028,5 @@
 
     pj_scan_init(&scanner, buf, len, 0, &on_scanner_error);
-    session = pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));
+    session = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
     PJ_ASSERT_RETURN(session != NULL, PJ_ENOMEM);
 
@@ -1052,5 +1052,5 @@
 		    break;
 		case 'c':
-		    conn = pj_pool_calloc(pool, 1, sizeof(*conn));
+		    conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn);
 		    parse_connection_info(&scanner, conn, &ctx);
 		    if (media) {
@@ -1064,5 +1064,5 @@
 		    break;
 		case 'm':
-		    media = pj_pool_calloc(pool, 1, sizeof(*media));
+		    media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media);
 		    parse_media(&scanner, media, &ctx);
 		    session->media[ session->media_count++ ] = media;
@@ -1095,5 +1095,5 @@
 
     }
-    PJ_CATCH(SYNTAX_ERROR) {
+    PJ_CATCH_ANY {
 	
 	char errmsg[PJ_ERR_MSG_SIZE];
@@ -1138,5 +1138,5 @@
     PJ_ASSERT_RETURN(pool && rhs, NULL);
 
-    sess = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));
+    sess = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
     PJ_ASSERT_RETURN(sess != NULL, NULL);
 
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 1239)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 1240)
@@ -84,5 +84,5 @@
 
     /* Create and initialize negotiator. */
-    neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+    neg = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_neg);
     PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
 
@@ -119,5 +119,5 @@
 
     /* Create and initialize negotiator. */
-    neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+    neg = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_neg);
     PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
 
@@ -564,5 +564,5 @@
 		 */
 		const pjmedia_sdp_attr *a;
-		pjmedia_sdp_rtpmap or;
+		pjmedia_sdp_rtpmap or_;
 
 		/* Get the rtpmap for the payload type in the offer. */
@@ -572,5 +572,5 @@
 		    return PJ_EBUG;
 		}
-		pjmedia_sdp_attr_get_rtpmap(a, &or);
+		pjmedia_sdp_attr_get_rtpmap(a, &or_);
 
 		/* Find paylaod in answer SDP with matching 
@@ -587,7 +587,7 @@
 			 * count match 
 			 */
-			if (!pj_stricmp(&or.enc_name, &ar.enc_name) &&
-			    or.clock_rate == ar.clock_rate &&
-			    (pj_stricmp(&or.param, &ar.param)==0 ||
+			if (!pj_stricmp(&or_.enc_name, &ar.enc_name) &&
+			    or_.clock_rate == ar.clock_rate &&
+			    (pj_stricmp(&or_.param, &ar.param)==0 ||
 			     (ar.param.slen==1 && *ar.param.ptr=='1')))
 			{
@@ -745,5 +745,5 @@
 		 */
 		const pjmedia_sdp_attr *a;
-		pjmedia_sdp_rtpmap or;
+		pjmedia_sdp_rtpmap or_;
 		pj_bool_t is_codec;
 
@@ -755,7 +755,7 @@
 		    return PJMEDIA_SDP_EMISSINGRTPMAP;
 		}
-		pjmedia_sdp_attr_get_rtpmap(a, &or);
-
-		if (!pj_strcmp2(&or.enc_name, "telephone-event")) {
+		pjmedia_sdp_attr_get_rtpmap(a, &or_);
+
+		if (!pj_strcmp2(&or_.enc_name, "telephone-event")) {
 		    offer_has_telephone_event = 1;
 		    if (found_matching_telephone_event)
@@ -782,8 +782,8 @@
 			 * channel count  match 
 			 */
-			if (!pj_stricmp(&or.enc_name, &lr.enc_name) &&
-			    or.clock_rate == lr.clock_rate &&
-			    (pj_strcmp(&or.param, &lr.param)==0 ||
-			     (or.param.slen==1 && *or.param.ptr=='1'))) 
+			if (!pj_stricmp(&or_.enc_name, &lr.enc_name) &&
+			    or_.clock_rate == lr.clock_rate &&
+			    (pj_strcmp(&or_.param, &lr.param)==0 ||
+			     (or_.param.slen==1 && *or_.param.ptr=='1'))) 
 			{
 			    /* Match! */
Index: pjproject/trunk/pjsip/include/pjsip/print_util.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsip/print_util.h	(revision 1239)
+++ pjproject/trunk/pjsip/include/pjsip/print_util.h	(revision 1240)
@@ -106,8 +106,8 @@
 PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr)
 {
-    pjsip_hdr *hdr = hptr;
+    pjsip_hdr *hdr = (pjsip_hdr*) hptr;
     hdr->type = htype;
     hdr->name = hdr->sname = pjsip_hdr_names[htype];
-    hdr->vptr = vptr;
+    hdr->vptr = (pjsip_hdr_vptr*) vptr;
     pj_list_init(hdr);
 }
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c	(revision 1240)
@@ -214,5 +214,5 @@
     
     /* Allocate memory. */
-    cred->response.ptr = pj_pool_alloc(pool, PJSIP_MD5STRLEN);
+    cred->response.ptr = (char*) pj_pool_alloc(pool, PJSIP_MD5STRLEN);
     cred->response.slen = PJSIP_MD5STRLEN;
 
@@ -229,5 +229,5 @@
 	 */
 	cred->qop = pjsip_AUTH_STR;
-	cred->nc.ptr = pj_pool_alloc(pool, 16);
+	cred->nc.ptr = (char*) pj_pool_alloc(pool, 16);
 	cred->nc.slen = pj_ansi_snprintf(cred->nc.ptr, 16, "%08u", nc);
 
@@ -267,5 +267,6 @@
     if (cached_auth->cnonce.slen == 0) {
 	/* Save the whole challenge */
-	cached_auth->last_chal = pjsip_hdr_clone(ses_pool, hdr);
+	cached_auth->last_chal = (pjsip_www_authenticate_hdr*)
+				 pjsip_hdr_clone(ses_pool, hdr);
 
 	/* Create cnonce */
@@ -367,5 +368,6 @@
     sess->endpt = (pjsip_endpoint*)rhs->endpt;
     sess->cred_cnt = rhs->cred_cnt;
-    sess->cred_info = pj_pool_alloc(pool, 
+    sess->cred_info = (pjsip_cred_info*)
+    		      pj_pool_alloc(pool, 
 				    sess->cred_cnt*sizeof(pjsip_cred_info));
     for (i=0; i<rhs->cred_cnt; ++i) {
@@ -402,5 +404,6 @@
     } else {
 	int i;
-	sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
+	sess->cred_info = (pjsip_cred_info*)
+			  pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
 	for (i=0; i<cred_cnt; ++i) {
 	    sess->cred_info[i].data_type = c[i].data_type;
@@ -817,5 +820,5 @@
 	cached_auth = find_cached_auth(sess, &hchal->challenge.common.realm );
 	if (!cached_auth) {
-	    cached_auth = pj_pool_zalloc( sess->pool, sizeof(*cached_auth));
+	    cached_auth = PJ_POOL_ZALLOC_T( sess->pool, pjsip_cached_auth);
 	    pj_strdup( sess->pool, &cached_auth->realm, &hchal->challenge.common.realm);
 	    cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE);
@@ -845,5 +848,5 @@
 
     /* Remove branch param in Via header. */
-    via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
+    via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
     via->branch_param.slen = 0;
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c	(revision 1240)
@@ -47,5 +47,6 @@
 PJ_DEF(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool)
 {
-    pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_authorization_hdr *hdr;
+    hdr = PJ_POOL_ZALLOC_T(pool, pjsip_authorization_hdr);
     init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr);
     pj_list_init(&hdr->credential.common.other_param);
@@ -55,5 +56,6 @@
 PJ_DEF(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool)
 {
-    pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_proxy_authorization_hdr *hdr;
+    hdr = PJ_POOL_ZALLOC_T(pool, pjsip_proxy_authorization_hdr);
     init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr);
     pj_list_init(&hdr->credential.common.other_param);
@@ -169,9 +171,11 @@
 }
 
-static pjsip_authorization_hdr* pjsip_authorization_hdr_shallow_clone( pj_pool_t *pool,
-								       const pjsip_authorization_hdr *rhs)
+static pjsip_authorization_hdr* 
+pjsip_authorization_hdr_shallow_clone(  pj_pool_t *pool,
+					const pjsip_authorization_hdr *rhs)
 {
     /* This function also serves Proxy-Authorization header. */
-    pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_authorization_hdr *hdr;
+    hdr = PJ_POOL_ALLOC_T(pool, pjsip_authorization_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param, 
@@ -202,5 +206,6 @@
 PJ_DEF(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool)
 {
-    pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_www_authenticate_hdr *hdr;
+    hdr = PJ_POOL_ZALLOC_T(pool, pjsip_www_authenticate_hdr);
     init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr);
     pj_list_init(&hdr->challenge.common.other_param);
@@ -211,5 +216,6 @@
 PJ_DEF(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool)
 {
-    pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_proxy_authenticate_hdr *hdr;
+    hdr = PJ_POOL_ZALLOC_T(pool, pjsip_proxy_authenticate_hdr);
     init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr);
     pj_list_init(&hdr->challenge.common.other_param);
@@ -323,5 +329,6 @@
 {
     /* This function also serves Proxy-Authenticate header. */
-    pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_www_authenticate_hdr *hdr;
+    hdr = PJ_POOL_ALLOC_T(pool, pjsip_www_authenticate_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param, 
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c	(revision 1240)
@@ -107,5 +107,5 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = name;
 	    p->value = value;
@@ -169,5 +169,5 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = name;
 	    p->value = value;
Index: pjproject/trunk/pjsip/src/pjsip/sip_auth_server.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_auth_server.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_auth_server.c	(revision 1240)
@@ -115,5 +115,5 @@
     pjsip_authorization_hdr *h_auth;
     pjsip_msg *msg = rdata->msg_info.msg;
-    int htype;
+    pjsip_hdr_e htype;
     pj_str_t acc_name;
     pjsip_cred_info cred_info;
Index: pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_dialog.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_dialog.c	(revision 1240)
@@ -70,5 +70,5 @@
 	return PJ_ENOMEM;
 
-    dlg = pj_pool_zalloc(pool, sizeof(pjsip_dialog));
+    dlg = PJ_POOL_ZALLOC_T(pool, pjsip_dialog);
     PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM);
 
@@ -155,5 +155,6 @@
 	    param->value.ptr[param->value.slen] = '\0';
 
-	    hdr = pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
+	    hdr = (pjsip_hdr*)
+	    	  pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
 				  param->value.slen, NULL);
 
@@ -223,5 +224,6 @@
 	PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri))
     {
-	pjsip_sip_uri *sip_uri = pjsip_uri_get_uri(dlg->remote.info->uri);
+	pjsip_sip_uri *sip_uri = (pjsip_sip_uri *) 
+				 pjsip_uri_get_uri(dlg->remote.info->uri);
 	if (!pj_list_empty(&sip_uri->header_param)) {
 	    pj_str_t tmp;
@@ -231,5 +233,6 @@
 
 	    /* Print URI */
-	    tmp.ptr = pj_pool_alloc(dlg->pool, dlg->remote.info_str.slen);
+	    tmp.ptr = (char*) pj_pool_alloc(dlg->pool, 
+	    				    dlg->remote.info_str.slen);
 	    tmp.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR,
 				       sip_uri, tmp.ptr, 
@@ -331,8 +334,9 @@
      * both local and remote URI.
      */
-    tmp.ptr = pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
+    tmp.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
 
     /* Init local info from the To header. */
-    dlg->local.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
+    dlg->local.info = (pjsip_fromto_hdr*)
+    		      pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
     pjsip_fromto_hdr_set_from(dlg->local.info);
 
@@ -389,5 +393,6 @@
 
     /* Init remote info from the From header. */
-    dlg->remote.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
+    dlg->remote.info = (pjsip_fromto_hdr*) 
+    		       pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
     pjsip_fromto_hdr_set_to(dlg->remote.info);
 
@@ -406,5 +411,6 @@
 
     /* Init remote's contact from Contact header. */
-    contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
+    contact_hdr = (pjsip_hdr*)
+    		  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
 				     NULL);
     if (!contact_hdr) {
@@ -412,5 +418,6 @@
 	goto on_error;
     }
-    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact_hdr);
+    dlg->remote.contact = (pjsip_contact_hdr*) 
+    			  pjsip_hdr_clone(dlg->pool, contact_hdr);
 
     /* Init remote's CSeq from CSeq header */
@@ -432,5 +439,6 @@
 
     /* Call-ID */
-    dlg->call_id = pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
+    dlg->call_id = (pjsip_cid_hdr*) 
+    		   pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
 
     /* Route set. 
@@ -447,5 +455,5 @@
 
 	/* Clone the Record-Route, change the type to Route header. */
-	route = pjsip_hdr_clone(dlg->pool, rr);
+	route = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, rr);
 	pjsip_routing_hdr_set_route(route);
 
@@ -457,5 +465,6 @@
 	if (rr == (void*)&rdata->msg_info.msg->hdr)
 	    break;
-	rr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr);
+	rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 
+						   PJSIP_H_RECORD_ROUTE, rr);
     }
 
@@ -570,8 +579,9 @@
 
     /* Clone remote target. */
-    dlg->target = pjsip_uri_clone(dlg->pool, first_dlg->target);
+    dlg->target = (pjsip_uri*) pjsip_uri_clone(dlg->pool, first_dlg->target);
 
     /* Clone local info. */
-    dlg->local.info = pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
+    dlg->local.info = (pjsip_fromto_hdr*) 
+    		      pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
 
     /* Clone local tag. */
@@ -584,8 +594,10 @@
 
     /* Clone local Contact. */
-    dlg->local.contact = pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
+    dlg->local.contact = (pjsip_contact_hdr*) 
+    			 pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
 
     /* Clone remote info. */
-    dlg->remote.info = pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
+    dlg->remote.info = (pjsip_fromto_hdr*) 
+    		       pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
 
     /* Set remote tag from the response. */
@@ -611,5 +623,6 @@
 
     /* Clone Call-ID header. */
-    dlg->call_id = pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
+    dlg->call_id = (pjsip_cid_hdr*) 
+    		   pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
 
     /* Duplicate Route-Set. */
@@ -619,5 +632,5 @@
 	pjsip_route_hdr *h;
 
-	h = pjsip_hdr_clone(dlg->pool, r);
+	h = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
 	pj_list_push_back(&dlg->route_set, h);
 
@@ -721,5 +734,5 @@
 	pjsip_route_hdr *new_r;
 
-	new_r = pjsip_hdr_clone(dlg->pool, r);
+	new_r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
 	pj_list_push_back(&dlg->route_set, new_r);
 
@@ -980,5 +993,5 @@
     for (; route != end_list; route = route->next ) {
 	pjsip_route_hdr *r;
-	r = pjsip_hdr_shallow_clone( tdata->pool, route );
+	r = (pjsip_route_hdr*) pjsip_hdr_shallow_clone( tdata->pool, route );
 	pjsip_routing_hdr_set_route(r);
 	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)r);
@@ -1177,5 +1190,6 @@
 		pjsip_msg_find_hdr_by_name(tdata->msg, &hcontact, NULL) == 0) 
 	    {
-		hdr = pjsip_hdr_clone(tdata->pool, dlg->local.contact);
+		hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, 
+						   dlg->local.contact);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1189,5 +1203,5 @@
 					       PJSIP_H_ALLOW, NULL);
 	    if (c_hdr) {
-		hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+		hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1201,5 +1215,5 @@
 					       PJSIP_H_SUPPORTED, NULL);
 	    if (c_hdr) {
-		hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+		hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1286,5 +1300,5 @@
      * 180 and then 302, the Contact in 302 will not get updated).
      */
-    hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
     if (hdr)
 	pj_list_erase(hdr);
@@ -1399,5 +1413,5 @@
 	while (hdr != hdr_list) {
 	    pjsip_msg_add_hdr(tdata->msg,
-			      pjsip_hdr_clone(tdata->pool, hdr));
+			      (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr));
 	    hdr = hdr->next;
 	}
@@ -1527,5 +1541,5 @@
 	if (hdr->type == PJSIP_H_RECORD_ROUTE) {
 	    pjsip_route_hdr *r;
-	    r = pjsip_hdr_clone(dlg->pool, hdr);
+	    r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, hdr);
 	    pjsip_routing_hdr_set_route(r);
 	    pj_list_push_back(&dlg->route_set, r);
@@ -1599,8 +1613,10 @@
 	 * field of the response.
 	 */
-	contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
+	contact = (pjsip_contact_hdr*)
+		  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
 				     NULL);
 	if (contact) {
-	    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+	    dlg->remote.contact = (pjsip_contact_hdr*) 
+	    			  pjsip_hdr_clone(dlg->pool, contact);
 	    dlg->target = dlg->remote.contact->uri;
 	}
@@ -1643,8 +1659,10 @@
 	pjsip_contact_hdr *contact;
 
-	contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
-				     NULL);
+	contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
+							  PJSIP_H_CONTACT, 
+				     			  NULL);
 	if (contact) {
-	    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+	    dlg->remote.contact = (pjsip_contact_hdr*) 
+	    			  pjsip_hdr_clone(dlg->pool, contact);
 	    dlg->target = dlg->remote.contact->uri;
 	}
Index: pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 1240)
@@ -154,5 +154,5 @@
 static int cmp_mod_name(void *name, const void *mod)
 {
-    return pj_stricmp(name, &((pjsip_module*)mod)->name);
+    return pj_stricmp((const pj_str_t*)name, &((pjsip_module*)mod)->name);
 }
 
@@ -446,5 +446,5 @@
 
     /* Create endpoint. */
-    endpt = pj_pool_zalloc(pool, sizeof(*endpt));
+    endpt = PJ_POOL_ZALLOC_T(pool, pjsip_endpoint);
     endpt->pool = pool;
     endpt->pf = pf;
@@ -829,5 +829,5 @@
 	pj_bool_t mismatch = PJ_FALSE;
 	if (port == 0) {
-	    int type;
+	    pjsip_transport_type_e type;
 	    type = rdata->tp_info.transport->key.type;
 	    port = pjsip_transport_get_default_port_for_type(type);
Index: pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 1240)
@@ -241,5 +241,5 @@
 PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type)
 {
-    pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg));
+    pjsip_msg *msg = PJ_POOL_ALLOC_T(pool, pjsip_msg);
     pj_list_init(&msg->hdr);
     msg->type = type;
@@ -258,5 +258,6 @@
     if (src->type == PJSIP_REQUEST_MSG) {
 	pjsip_method_copy(pool, &dst->line.req.method, &src->line.req.method);
-	dst->line.req.uri = pjsip_uri_clone(pool, src->line.req.uri);
+	dst->line.req.uri = (pjsip_uri*) pjsip_uri_clone(pool, 
+						  	 src->line.req.uri);
     } else {
 	dst->line.status.code = src->line.status.code;
@@ -267,5 +268,5 @@
     sh = src->hdr.next;
     while (sh != &src->hdr) {
-	pjsip_hdr *dh = pjsip_hdr_clone(pool, sh);
+	pjsip_hdr *dh = (pjsip_hdr*) pjsip_hdr_clone(pool, sh);
 	pjsip_msg_add_hdr(dst, dh);
 	sh = sh->next;
@@ -283,5 +284,5 @@
 				   pjsip_hdr_e hdr_type, const void *start)
 {
-    const pjsip_hdr *hdr=start, *end=&msg->hdr;
+    const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=&msg->hdr;
 
     if (hdr == NULL) {
@@ -299,5 +300,5 @@
 					   const void *start)
 {
-    const pjsip_hdr *hdr=start, *end=&msg->hdr;
+    const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr;
 
     if (hdr == NULL) {
@@ -319,5 +320,5 @@
 				         pjsip_hdr_e hdr_type, void *start)
 {
-    pjsip_hdr *hdr = pjsip_msg_find_hdr(msg, hdr_type, start);
+    pjsip_hdr *hdr = (pjsip_hdr*) pjsip_msg_find_hdr(msg, hdr_type, start);
     if (hdr) {
 	pj_list_erase(hdr);
@@ -351,5 +352,5 @@
 
 	/* Add URI */
-	uri = pjsip_uri_get_uri(msg->line.req.uri);
+	uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri);
 	len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p);
 	if (len < 1)
@@ -485,5 +486,5 @@
 PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr )
 {
-    const pjsip_hdr *hdr = hdr_ptr;
+    const pjsip_hdr *hdr = (const pjsip_hdr*) hdr_ptr;
     return (*hdr->vptr->clone)(pool, hdr_ptr);
 }
@@ -492,5 +493,5 @@
 PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr )
 {
-    const pjsip_hdr *hdr = hdr_ptr;
+    const pjsip_hdr *hdr = (const pjsip_hdr*) hdr_ptr;
     return (*hdr->vptr->shallow_clone)(pool, hdr_ptr);
 }
@@ -498,5 +499,5 @@
 PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len)
 {
-    pjsip_hdr *hdr = hdr_ptr;
+    pjsip_hdr *hdr = (pjsip_hdr*) hdr_ptr;
     return (*hdr->vptr->print_on)(hdr_ptr, buf, len);
 }
@@ -563,5 +564,5 @@
 			       const pj_str_t *hvalue)
 {
-    pjsip_generic_string_hdr *hdr = mem;
+    pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr*) mem;
     pj_str_t dup_hname, dup_hval;
 
@@ -625,5 +626,5 @@
 							   const pjsip_generic_string_hdr *rhs )
 {
-    pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_string_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_string_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -654,5 +655,5 @@
 							    int value)
 {
-    pjsip_generic_int_hdr *hdr = mem;
+    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr*) mem;
 
     init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr);
@@ -694,5 +695,5 @@
 					           const pjsip_generic_int_hdr *rhs)
 {
-    pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_int_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_int_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -702,5 +703,5 @@
 							   const pjsip_generic_int_hdr *rhs )
 {
-    pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_int_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_int_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -729,5 +730,5 @@
 							       const pj_str_t *hnames)
 {
-    pjsip_generic_array_hdr *hdr = mem;
+    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr*) mem;
 
     init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr);
@@ -773,5 +774,5 @@
 {
     unsigned i;
-    pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_array_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_array_hdr);
 
     pj_memcpy(hdr, rhs, sizeof(*hdr));
@@ -787,5 +788,5 @@
 						 const pjsip_generic_array_hdr *rhs)
 {
-    pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_array_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_array_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -799,5 +800,5 @@
 						 void *mem )
 {
-    pjsip_accept_hdr *hdr = mem;
+    pjsip_accept_hdr *hdr = (pjsip_accept_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -823,5 +824,5 @@
 					       void *mem )
 {
-    pjsip_allow_hdr *hdr = mem;
+    pjsip_allow_hdr *hdr = (pjsip_allow_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -846,5 +847,5 @@
 					   void *mem )
 {
-    pjsip_cid_hdr *hdr = mem;
+    pjsip_cid_hdr *hdr = (pjsip_cid_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -880,5 +881,5 @@
 					     void *mem )
 {
-    pjsip_clen_hdr *hdr = mem;
+    pjsip_clen_hdr *hdr = (pjsip_clen_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -942,5 +943,5 @@
 					     void *mem )
 {
-    pjsip_cseq_hdr *hdr = mem;
+    pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -997,5 +998,5 @@
 						     const pjsip_cseq_hdr *rhs )
 {
-    pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_cseq_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_cseq_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -1021,5 +1022,5 @@
 						   void *mem )
 {
-    pjsip_contact_hdr *hdr = mem;
+    pjsip_contact_hdr *hdr = (pjsip_contact_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1113,5 +1114,5 @@
 	return hdr;
 
-    hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
     hdr->q1000 = rhs->q1000;
     hdr->expires = rhs->expires;
@@ -1124,5 +1125,5 @@
 				 const pjsip_contact_hdr *rhs)
 {
-    pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_contact_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_contact_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -1150,5 +1151,5 @@
 					       void *mem )
 {
-    pjsip_ctype_hdr *hdr = mem;
+    pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1228,5 +1229,5 @@
 						   int value)
 {
-    pjsip_expires_hdr *hdr = mem;
+    pjsip_expires_hdr *hdr = (pjsip_expires_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1267,5 +1268,5 @@
 					     void *mem )
 {
-    pjsip_from_hdr *hdr = mem;
+    pjsip_from_hdr *hdr = (pjsip_from_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1286,5 +1287,5 @@
 					 void *mem )
 {
-    pjsip_to_hdr *hdr = mem;
+    pjsip_to_hdr *hdr = (pjsip_to_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1355,5 +1356,5 @@
     hdr->name = rhs->name;
     hdr->sname = rhs->sname;
-    hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
     pj_strdup( pool, &hdr->tag, &rhs->tag);
     pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1366,5 +1367,5 @@
 				const pjsip_fromto_hdr *rhs)
 {
-    pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_fromto_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_fromto_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1381,5 +1382,5 @@
 						   int value)
 {
-    pjsip_max_fwd_hdr *hdr = mem;
+    pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1407,5 +1408,5 @@
 							   int value )
 {
-    pjsip_min_expires_hdr *hdr = mem;
+    pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1441,5 +1442,5 @@
 					 void *mem )
 {
-    pjsip_rr_hdr *hdr = mem;
+    pjsip_rr_hdr *hdr = (pjsip_rr_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1461,5 +1462,5 @@
 					       void *mem )
 {
-    pjsip_route_hdr *hdr = mem;
+    pjsip_route_hdr *hdr = (pjsip_route_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1521,5 +1522,5 @@
 						   const pjsip_routing_hdr *rhs )
 {
-    pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_routing_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_routing_hdr);
 
     init_hdr(hdr, rhs->type, rhs->vptr);
@@ -1533,5 +1534,5 @@
 							   const pjsip_routing_hdr *rhs )
 {
-    pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_routing_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_routing_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1547,5 +1548,5 @@
 						   void *mem )
 {
-    pjsip_require_hdr *hdr = mem;
+    pjsip_require_hdr *hdr = (pjsip_require_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1570,5 +1571,5 @@
 							   int value )
 {
-    pjsip_retry_after_hdr *hdr = mem;
+    pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1594,5 +1595,5 @@
 						       void *mem )
 {
-    pjsip_supported_hdr *hdr = mem;
+    pjsip_supported_hdr *hdr = (pjsip_supported_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1616,5 +1617,5 @@
 							   void *mem )
 {
-    pjsip_unsupported_hdr *hdr = mem;
+    pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr*) mem;
     
     PJ_UNUSED_ARG(pool);
@@ -1649,5 +1650,5 @@
 					   void *mem )
 {
-    pjsip_via_hdr *hdr = mem;
+    pjsip_via_hdr *hdr = (pjsip_via_hdr*) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1756,5 +1757,5 @@
 						   const pjsip_via_hdr *rhs )
 {
-    pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_via_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_via_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -1774,7 +1775,7 @@
     pj_str_t hvalue;
 
-    hvalue.ptr = pj_pool_alloc(pool, 10 +		/* code */
-				     host->slen + 2 +	/* host */
-				     text->slen + 2);	/* text */
+    hvalue.ptr = (char*) pj_pool_alloc(pool, 10 +		/* code */
+				     	     host->slen + 2 +	/* host */
+				     	     text->slen + 2);	/* text */
     hvalue.slen = pj_ansi_sprintf(hvalue.ptr, "%u %.*s \"%.*s\"",
 				  code, (int)host->slen, host->ptr,
@@ -1814,5 +1815,5 @@
 
     if (len) {
-	newdata = pj_pool_alloc(pool, len);
+	newdata = (char*) pj_pool_alloc(pool, len);
 	pj_memcpy(newdata, data, len);
     }
@@ -1856,5 +1857,5 @@
     pj_status_t status;
 
-    new_body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+    new_body = PJ_POOL_ALLOC_T(pool, pjsip_msg_body);
     PJ_ASSERT_RETURN(new_body, NULL);
 
@@ -1874,5 +1875,5 @@
     PJ_ASSERT_RETURN(pool && type && subtype && text, NULL);
 
-    body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
+    body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
     PJ_ASSERT_RETURN(body != NULL, NULL);
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_parser.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_parser.c	(revision 1240)
@@ -251,5 +251,5 @@
 
     len = param->slen + pname->slen + pvalue->slen + 3;
-    p = new_param = pj_pool_alloc(pool, len);
+    p = new_param = (char*) pj_pool_alloc(pool, len);
     
     if (param->slen) {
@@ -1002,5 +1002,5 @@
 	 */
 	if (ctype_hdr && scanner->curptr!=scanner->end) {
-	    pjsip_msg_body *body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+	    pjsip_msg_body *body = PJ_POOL_ALLOC_T(pool, pjsip_msg_body);
 	    body->content_type.type = ctype_hdr->media.type;
 	    body->content_type.subtype = ctype_hdr->media.subtype;
@@ -1023,5 +1023,5 @@
 	    pjsip_parser_err_report *err_info;
 	    
-	    err_info = pj_pool_alloc(pool, sizeof(*err_info));
+	    err_info = PJ_POOL_ALLOC_T(pool, pjsip_parser_err_report);
 	    err_info->except_code = PJ_GET_EXCEPTION();
 	    err_info->line = scanner->line;
@@ -1251,6 +1251,7 @@
 	    }
 
-	    uri = (*func)( scanner, pool, 
-			  (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0);
+	    uri = (pjsip_uri*)
+	    	  (*func)(scanner, pool, 
+			  (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)==0);
 
 
@@ -1380,5 +1381,5 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1392,5 +1393,5 @@
       do {
 	pjsip_param *param;
-	param = pj_pool_alloc(pool, sizeof(pjsip_param));
+	param = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	int_parse_hparam(scanner, pool, &param->name, &param->value);
 	pj_list_insert_before(&url->header_param, param);
@@ -1624,5 +1625,5 @@
 	int_parse_param( scanner, pool, &pname, &pvalue, 0);
 	if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) {
-	    char *dot_pos = pj_memchr(pvalue.ptr, '.', pvalue.slen);
+	    char *dot_pos = (char*) pj_memchr(pvalue.ptr, '.', pvalue.slen);
 	    if (!dot_pos) {
 		hdr->q1000 = pj_strtoul(&pvalue);
@@ -1636,5 +1637,5 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1774,5 +1775,5 @@
 	    
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1872,5 +1873,5 @@
 		hdr->rport_param = 0;
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1912,5 +1913,5 @@
 
     while (*scanner->curptr == ';') {
-	pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
 	int_parse_param(scanner, pool, &p->name, &p->value, 0);
 	pj_list_insert_before(&hdr->other_param, p);
Index: pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 1239)
+++ pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 1240)
@@ -104,5 +104,5 @@
 
     PJ_ASSERT_RETURN(pool && p_res, PJ_EINVAL);
-    resolver = pj_pool_zalloc(pool, sizeof(*resolver));
+    resolver = PJ_POOL_ZALLOC_T(pool, pjsip_resolver_t);
     *p_res = resolver;
 
@@ -279,5 +279,5 @@
 
     /* Build the query state */
-    query = pj_pool_zalloc(pool, sizeof(struct query));
+    query = PJ_POOL_ZALLOC_T(pool, struct query);
     pj_ansi_snprintf(query->objname, sizeof(query->objname), "rsvjob%X",
 		     resolver->job_id++);
@@ -299,5 +299,5 @@
     query->naptr[0].pref = 0;
     query->naptr[0].type = type;
-    query->naptr[0].target_name.ptr = 
+    query->naptr[0].target_name.ptr = (char*)
 	pj_pool_alloc(pool, target->addr.host.slen + 12);
 
@@ -640,5 +640,5 @@
 			 pj_dns_parsed_packet *pkt)
 {
-    struct query *query = user_data;
+    struct query *query = (struct query*) user_data;
     unsigned i;
 
