Index: pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 1227)
+++ 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);
 
