Index: pjproject/trunk/pjsip/src/pjsip-simple/presence.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 1227)
+++ pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 1241)
@@ -198,5 +198,5 @@
 
     /* Create presence */
-    pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));
+    pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres);
     pres->dlg = dlg;
     pres->sub = sub;
@@ -245,5 +245,6 @@
 
     /* Check that Event header contains "presence" */
-    event = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL);
+    event = (pjsip_event_hdr*)
+    	    pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL);
     if (!event) {
 	return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST);
@@ -254,5 +255,6 @@
 
     /* Check that request contains compatible Accept header. */
-    accept = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL);
+    accept = (pjsip_accept_hdr*)
+    	     pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL);
     if (accept) {
 	unsigned i;
@@ -281,5 +283,6 @@
 
     /* Check that expires is not too short. */
-    expires_hdr=pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL);
+    expires_hdr=(pjsip_expires_hdr*)
+    		pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, NULL);
     if (expires_hdr) {
 	if (expires_hdr->ivalue < 5) {
@@ -305,5 +308,5 @@
 
     /* Create server presence subscription */
-    pres = pj_pool_zalloc(dlg->pool, sizeof(pjsip_pres));
+    pres = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_pres);
     pres->dlg = dlg;
     pres->sub = sub;
@@ -367,5 +370,5 @@
     PJ_ASSERT_RETURN(sub && status, PJ_EINVAL);
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE);
 
@@ -390,5 +393,5 @@
     PJ_ASSERT_RETURN(sub && status, PJ_EINVAL);
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_RETURN(pres!=NULL, PJSIP_SIMPLE_ENOPRESENCE);
 
@@ -423,5 +426,5 @@
 
     /* Get publisher URI */
-    entity.ptr = pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE);
+    entity.ptr = (char*) pj_pool_alloc(tdata->pool, PJSIP_MAX_URL_SIZE);
     entity.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI,
 				  pres->dlg->local.info->uri,
@@ -463,5 +466,5 @@
 
     /* Get the presence object. */
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE);
 
@@ -509,5 +512,5 @@
 
     /* Get the presence object. */
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_RETURN(pres != NULL, PJSIP_SIMPLE_ENOPRESENCE);
 
@@ -559,5 +562,5 @@
     pjsip_pres *pres;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
@@ -574,5 +577,5 @@
     pjsip_pres *pres;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
@@ -594,5 +597,5 @@
     pjsip_pres *pres;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
@@ -722,5 +725,5 @@
     pj_status_t status;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
@@ -774,5 +777,5 @@
     pjsip_pres *pres;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
@@ -796,5 +799,5 @@
     pjsip_pres *pres;
 
-    pres = pjsip_evsub_get_mod_data(sub, mod_presence.id);
+    pres = (pjsip_pres*) pjsip_evsub_get_mod_data(sub, mod_presence.id);
     PJ_ASSERT_ON_FAIL(pres!=NULL, {return;});
 
