Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/encryption.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/encryption.c	(revision 1265)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/encryption.c	(revision 1266)
@@ -385,5 +385,5 @@
 
 /* CRC32 test data, generated from crc32 test on a Linux box */
-struct
+struct crc32_test_t
 {
     char	    *input;
@@ -552,5 +552,5 @@
 	return PJ_ENOMEM;
 
-    input = pj_pool_alloc(pool, input_len);
+    input = (pj_uint8_t*)pj_pool_alloc(pool, input_len);
     pj_memset(input, '\xaa', input_len);
     
Index: pjproject/trunk/pjlib/src/pj/except.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/except.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/except.c	(revision 1266)
@@ -42,5 +42,6 @@
     struct pj_exception_state_t *handler;
 
-    handler = pj_thread_local_get(thread_local_id);
+    handler = (struct pj_exception_state_t*) 
+	      pj_thread_local_get(thread_local_id);
     if (handler == NULL) {
         PJ_LOG(1,("except.c", "!!!FATAL: unhandled exception %s!\n", 
@@ -79,5 +80,6 @@
 	pj_atexit(&exception_cleanup);
     }
-    parent_handler = pj_thread_local_get(thread_local_id);
+    parent_handler = (struct pj_exception_state_t *)
+		      pj_thread_local_get(thread_local_id);
     rec->prev = parent_handler;
     pj_thread_local_set(thread_local_id, rec);
@@ -88,5 +90,6 @@
     struct pj_exception_state_t *handler;
 
-    handler = pj_thread_local_get(thread_local_id);
+    handler = (struct pj_exception_state_t *)
+	      pj_thread_local_get(thread_local_id);
     pj_assert(handler != NULL);
     pj_thread_local_set(thread_local_id, handler->prev);
Index: pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 1266)
@@ -302,5 +302,5 @@
         } else {
             pj_assert(!"Invalid operation type!");
-	    write_op->op = 0;
+	    write_op->op = PJ_IOQUEUE_OP_NONE;
             send_rc = PJ_EBUG;
         }
@@ -319,5 +319,5 @@
         {
 
-	    write_op->op = 0;
+	    write_op->op = PJ_IOQUEUE_OP_NONE;
 
             if (h->fd_type != PJ_SOCK_DGRAM) {
@@ -376,5 +376,5 @@
 	accept_op = h->accept_list.next;
         pj_list_erase(accept_op);
-        accept_op->op = 0;
+        accept_op->op = PJ_IOQUEUE_OP_NONE;
 
 	/* Clear bit in fdset if there is no more pending accept */
@@ -418,5 +418,5 @@
 
 	if ((read_op->op == PJ_IOQUEUE_OP_RECV_FROM)) {
-	    read_op->op = 0;
+	    read_op->op = PJ_IOQUEUE_OP_NONE;
 	    rc = pj_sock_recvfrom(h->fd, read_op->buf, &bytes_read, 
 				  read_op->flags,
@@ -424,10 +424,10 @@
                                   read_op->rmt_addrlen);
 	} else if ((read_op->op == PJ_IOQUEUE_OP_RECV)) {
-	    read_op->op = 0;
+	    read_op->op = PJ_IOQUEUE_OP_NONE;
 	    rc = pj_sock_recv(h->fd, read_op->buf, &bytes_read, 
 			      read_op->flags);
         } else {
             pj_assert(read_op->op == PJ_IOQUEUE_OP_READ);
-	    read_op->op = 0;
+	    read_op->op = PJ_IOQUEUE_OP_NONE;
             /*
              * User has specified pj_ioqueue_read().
@@ -562,5 +562,5 @@
 
     read_op = (struct read_operation*)op_key;
-    read_op->op = 0;
+    read_op->op = PJ_IOQUEUE_OP_NONE;
 
     /* Check if key is closing. */
@@ -631,5 +631,5 @@
 
     read_op = (struct read_operation*)op_key;
-    read_op->op = 0;
+    read_op->op = PJ_IOQUEUE_OP_NONE;
 
     /* Try to see if there's data immediately available. 
@@ -769,5 +769,5 @@
 
     write_op->op = PJ_IOQUEUE_OP_SEND;
-    write_op->buf = (void*)data;
+    write_op->buf = (char*)data;
     write_op->size = *length;
     write_op->written = 0;
@@ -849,5 +849,5 @@
      * Check that address storage can hold the address parameter.
      */
-    PJ_ASSERT_RETURN(addrlen <= sizeof(pj_sockaddr_in), PJ_EBUG);
+    PJ_ASSERT_RETURN(addrlen <= (int)sizeof(pj_sockaddr_in), PJ_EBUG);
 
     /*
@@ -884,5 +884,5 @@
 
     write_op->op = PJ_IOQUEUE_OP_SEND_TO;
-    write_op->buf = (void*)data;
+    write_op->buf = (char*)data;
     write_op->size = *length;
     write_op->written = 0;
@@ -921,5 +921,5 @@
 
     accept_op = (struct accept_operation*)op_key;
-    accept_op->op = 0;
+    accept_op->op = PJ_IOQUEUE_OP_NONE;
 
     /* Fast track:
@@ -1053,5 +1053,5 @@
         if (op_rec == (void*)op_key) {
             pj_list_erase(op_rec);
-            op_rec->op = 0;
+            op_rec->op = PJ_IOQUEUE_OP_NONE;
             pj_mutex_unlock(key->mutex);
 
@@ -1067,5 +1067,5 @@
         if (op_rec == (void*)op_key) {
             pj_list_erase(op_rec);
-            op_rec->op = 0;
+            op_rec->op = PJ_IOQUEUE_OP_NONE;
             pj_mutex_unlock(key->mutex);
 
@@ -1081,5 +1081,5 @@
         if (op_rec == (void*)op_key) {
             pj_list_erase(op_rec);
-            op_rec->op = 0;
+            op_rec->op = PJ_IOQUEUE_OP_NONE;
             pj_mutex_unlock(key->mutex);
 
Index: pjproject/trunk/pjlib/src/pj/ioqueue_select.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ioqueue_select.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/ioqueue_select.c	(revision 1266)
@@ -194,5 +194,5 @@
 
     /* Create and init common ioqueue stuffs */
-    ioqueue = pj_pool_alloc(pool, sizeof(pj_ioqueue_t));
+    ioqueue = PJ_POOL_ALLOC_T(pool, pj_ioqueue_t);
     ioqueue_init(ioqueue);
 
@@ -231,5 +231,5 @@
 	pj_ioqueue_key_t *key;
 
-	key = pj_pool_alloc(pool, sizeof(pj_ioqueue_key_t));
+	key = PJ_POOL_ALLOC_T(pool, pj_ioqueue_key_t);
 	key->ref_count = 0;
 	rc = pj_mutex_create_recursive(pool, NULL, &key->mutex);
Index: pjproject/trunk/pjlib/src/pj/log.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/log.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/log.c	(revision 1266)
@@ -147,5 +147,5 @@
     }
     len = len + print_len;
-    if (len > 0 && len < sizeof(log_buffer)-2) {
+    if (len > 0 && len < (int)sizeof(log_buffer)-2) {
 	if (log_decor & PJ_LOG_HAS_CR) {
 	    log_buffer[len++] = '\r';
Index: pjproject/trunk/pjlib/src/pj/os_core_unix.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_core_unix.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/os_core_unix.c	(revision 1266)
@@ -22,5 +22,7 @@
  *   the RTEMS port.
  */
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+#   define _GNU_SOURCE
+#endif
 #include <pj/os.h>
 #include <pj/assert.h>
@@ -340,5 +342,5 @@
 static void *thread_main(void *param)
 {
-    pj_thread_t *rec = param;
+    pj_thread_t *rec = (pj_thread_t*)param;
     void *result;
     pj_status_t rc;
@@ -507,5 +509,5 @@
 {
 #if PJ_HAS_THREADS
-    pj_thread_t *rec = pj_thread_local_get(thread_tls_id);
+    pj_thread_t *rec = (pj_thread_t*)pj_thread_local_get(thread_tls_id);
     
     if (rec == NULL) {
@@ -664,5 +666,8 @@
 {
     pj_status_t rc;
-    pj_atomic_t *atomic_var = pj_pool_calloc(pool, 1, sizeof(pj_atomic_t));
+    pj_atomic_t *atomic_var;
+
+    atomic_var = PJ_POOL_ZALLOC_T(pool, pj_atomic_t);
+
     PJ_ASSERT_RETURN(atomic_var, PJ_ENOMEM);
     
@@ -908,4 +913,10 @@
 
 ///////////////////////////////////////////////////////////////////////////////
+#if defined(PJ_LINUX) && PJ_LINUX!=0
+PJ_BEGIN_DECL
+PJ_DECL(int) pthread_mutexattr_settype(pthread_mutexattr_t*,int);
+PJ_END_DECL
+#endif
+
 static pj_status_t init_mutex(pj_mutex_t *mutex, const char *name, int type)
 {
@@ -922,5 +933,4 @@
     if (type == PJ_MUTEX_SIMPLE) {
 #if defined(PJ_LINUX) && PJ_LINUX!=0
-	extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);
 	rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP);
 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
@@ -931,5 +941,4 @@
     } else {
 #if defined(PJ_LINUX) && PJ_LINUX!=0
-	extern int pthread_mutexattr_settype(pthread_mutexattr_t*,int);
 	rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
@@ -992,5 +1001,5 @@
     PJ_ASSERT_RETURN(pool && ptr_mutex, PJ_EINVAL);
 
-    mutex = pj_pool_alloc(pool, sizeof(*mutex));
+    mutex = PJ_POOL_ALLOC_T(pool, pj_mutex_t);
     PJ_ASSERT_RETURN(mutex, PJ_ENOMEM);
 
@@ -1229,5 +1238,5 @@
     PJ_UNUSED_ARG(name);
     
-    rwm = pj_pool_alloc(pool, sizeof(pj_rwmutex_t));
+    rwm = PJ_POOL_ALLOC_T(pool, pj_rwmutex_t);
     PJ_ASSERT_RETURN(rwm, PJ_ENOMEM);
 
@@ -1330,5 +1339,5 @@
     PJ_ASSERT_RETURN(pool != NULL && ptr_sem != NULL, PJ_EINVAL);
 
-    sem = pj_pool_alloc(pool, sizeof(*sem));
+    sem = PJ_POOL_ALLOC_T(pool, pj_sem_t);
     PJ_ASSERT_RETURN(sem, PJ_ENOMEM);
 
Index: pjproject/trunk/pjlib/src/pj/os_error_unix.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_error_unix.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/os_error_unix.c	(revision 1266)
@@ -41,4 +41,10 @@
 }
 
+PJ_BEGIN_DECL
+
+    PJ_DECL(int) platform_strerror(pj_os_err_type code, 
+                              	   char *buf, pj_size_t bufsize );
+PJ_END_DECL
+
 /* 
  * platform_strerror()
Index: pjproject/trunk/pjlib/src/pj/sock_bsd.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/sock_bsd.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pj/sock_bsd.c	(revision 1266)
@@ -386,5 +386,5 @@
     PJ_CHECK_STACK();
 
-    PJ_ASSERT_RETURN(addr && len >= sizeof(struct sockaddr_in), PJ_EINVAL);
+    PJ_ASSERT_RETURN(addr && len >= (int)sizeof(struct sockaddr_in), PJ_EINVAL);
 
     if (bind(sock, (struct sockaddr*)addr, len) != 0)
Index: pjproject/trunk/pjlib/src/pjlib-test/file.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/file.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pjlib-test/file.c	(revision 1266)
@@ -126,5 +126,5 @@
 
     size = 0;
-    while (size < sizeof(readbuf)) {
+    while (size < (pj_ssize_t)sizeof(readbuf)) {
         pj_ssize_t read;
         read = 1;
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c	(revision 1266)
@@ -506,5 +506,5 @@
 
     best_bandwidth = 0;
-    for (i=0; i<sizeof(test_param)/sizeof(test_param[0]); ++i) {
+    for (i=0; i<(int)(sizeof(test_param)/sizeof(test_param[0])); ++i) {
         pj_size_t bandwidth;
 
Index: pjproject/trunk/pjlib/src/pjlib-test/sock.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 1266)
@@ -142,5 +142,5 @@
     PJ_LOG(3,("test", "...simple_sock_test()"));
 
-    for (i=0; i<sizeof(types)/sizeof(types[0]); ++i) {
+    for (i=0; i<(int)(sizeof(types)/sizeof(types[0])); ++i) {
 	
 	rc = pj_sock_socket(PJ_AF_INET, types[i], 0, &sock);
Index: pjproject/trunk/pjlib/src/pjlib-test/string.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 1265)
+++ pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 1266)
@@ -97,6 +97,6 @@
 #define STRTEST(res,S1,S2,code)	\
 	    do { \
-		s1.ptr=S1; s1.slen=S1?len:0; \
-		s2.ptr=S2; s2.slen=S2?len:0; \
+		s1.ptr=S1; s1.slen=(S1)?len:0; \
+		s2.ptr=S2; s2.slen=(S2)?len:0; \
 		pj_get_timestamp(&t1); \
 	        if (C(pj_stricmp(&s1,&s2),res)) return code; \
@@ -124,10 +124,12 @@
     pj_thread_sleep(0);
 
+#define SNULL 0
+
     /* Compare empty strings. */
     len=0;
     STRTEST( 0, "","",-500);
-    STRTEST( 0, NULL,"",-502);
-    STRTEST( 0, "",NULL,-504);
-    STRTEST( 0, NULL,NULL,-506);
+    STRTEST( 0, SNULL,"",-502);
+    STRTEST( 0, "",SNULL,-504);
+    STRTEST( 0, SNULL,SNULL,-506);
     STRTEST( 0, "hello","world",-508);
 
@@ -140,6 +142,6 @@
     STRTEST( 0, "a",buf+1,-512);
     STRTEST( -1, "O", "P", -514);
-    STRTEST(-1, NULL, "a", -516);
-    STRTEST(1, "a", NULL, -518);
+    STRTEST(-1, SNULL, "a", -516);
+    STRTEST(1, "a", SNULL, -518);
 
     /* equal, length=2 
@@ -267,9 +269,9 @@
     len=0;
     STR_TEST(0, "", "", -400);
-    STR_TEST(0, NULL, "", -405);
-    STR_TEST(0, "", NULL, -410);
-    STR_TEST(0, NULL, NULL, -415);
+    STR_TEST(0, SNULL, "", -405);
+    STR_TEST(0, "", SNULL, -410);
+    STR_TEST(0, SNULL, SNULL, -415);
     STR_TEST(0, "hello", "", -420);
-    STR_TEST(0, "hello", NULL, -425);
+    STR_TEST(0, "hello", SNULL, -425);
 
     /* Test with length != 0 */
@@ -278,6 +280,6 @@
     STR_TEST(1, "12", "1", -435);
     STR_TEST(-1, "1", "12", -440);
-    STR_TEST(-1, NULL, "12", -445);
-    STR_TEST(1, "12", NULL, -450);
+    STR_TEST(-1, SNULL, "12", -445);
+    STR_TEST(1, "12", SNULL, -450);
 
     return 0;
@@ -296,5 +298,5 @@
     int i;
 
-    pool = pj_pool_create(mem, NULL, 4096, 0, NULL);
+    pool = pj_pool_create(mem, SNULL, 4096, 0, SNULL);
     if (!pool) return -5;
     
@@ -368,5 +370,5 @@
     s5 = pj_str("123456");
 
-    pj_strtoul2(&s5, NULL, 10);	/* Crash test */
+    pj_strtoul2(&s5, SNULL, 10);	/* Crash test */
 
     if (pj_strtoul2(&s5, &s4, 10) != 123456UL)
@@ -382,5 +384,5 @@
     if (s4.slen != 4)
 	return -294;
-    if (s4.ptr == NULL || *s4.ptr != 'A')
+    if (s4.ptr == SNULL || *s4.ptr != 'A')
 	return -295;
     if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL)
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c	(revision 1266)
@@ -123,6 +123,6 @@
 struct gsm_data
 {
-    void		*encoder;
-    void		*decoder;
+    gsm_state		*encoder;
+    gsm_state		*decoder;
     pj_bool_t		 plc_enabled;
 #if !PLC_DISABLED
@@ -324,12 +324,10 @@
 	pj_list_erase(codec);
     } else {
-	codec = pj_pool_zalloc(gsm_codec_factory.pool, 
-			       sizeof(pjmedia_codec));
+	codec = PJ_POOL_ZALLOC_T(gsm_codec_factory.pool, pjmedia_codec);
 	PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM);
 	codec->op = &gsm_op;
 	codec->factory = factory;
 
-	gsm_data = pj_pool_zalloc(gsm_codec_factory.pool, 
-				  sizeof(struct gsm_data));
+	gsm_data = PJ_POOL_ZALLOC_T(gsm_codec_factory.pool, struct gsm_data);
 	codec->codec_data = gsm_data;
 
@@ -372,5 +370,5 @@
     PJ_ASSERT_RETURN(factory == &gsm_codec_factory.base, PJ_EINVAL);
 
-    gsm_data = codec->codec_data;
+    gsm_data = (struct gsm_data*) codec->codec_data;
 
     /* Close codec, if it's not closed. */
@@ -418,5 +416,5 @@
 				   pjmedia_codec_param *attr )
 {
-    struct gsm_data *gsm_data = codec->codec_data;
+    struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
 
     pj_assert(gsm_data != NULL);
@@ -442,5 +440,5 @@
 static pj_status_t gsm_codec_close( pjmedia_codec *codec )
 {
-    struct gsm_data *gsm_data = codec->codec_data;
+    struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
 
     pj_assert(gsm_data != NULL);
@@ -465,5 +463,5 @@
 				     const pjmedia_codec_param *attr )
 {
-    struct gsm_data *gsm_data = codec->codec_data;
+    struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
 
     pj_assert(gsm_data != NULL);
@@ -517,5 +515,5 @@
 				     struct pjmedia_frame *output)
 {
-    struct gsm_data *gsm_data = codec->codec_data;
+    struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
 
     pj_assert(gsm_data != NULL);
@@ -536,5 +534,5 @@
 
 	is_silence = pjmedia_silence_det_detect(gsm_data->vad, 
-					        input->buf,
+					        (const pj_int16_t*) input->buf,
 						(input->size >> 1),
 						NULL);
@@ -571,5 +569,5 @@
 				     struct pjmedia_frame *output)
 {
-    struct gsm_data *gsm_data = codec->codec_data;
+    struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data;
 
     pj_assert(gsm_data != NULL);
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c	(revision 1266)
@@ -320,5 +320,5 @@
     PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM);
 
-    codec = pj_pool_zalloc(pool, sizeof(struct ilbc_codec));
+    codec = PJ_POOL_ZALLOC_T(pool, struct ilbc_codec);
     codec->base.op = &ilbc_op;
     codec->base.factory = factory;
@@ -531,5 +531,5 @@
 
 	is_silence = pjmedia_silence_det_detect(ilbc_codec->vad, 
-					        input->buf,
+					        (const pj_int16_t*)input->buf,
 						(input->size >> 1),
 						NULL);
@@ -586,5 +586,5 @@
 
     /* Decode to temporary buffer */
-    iLBC_decode(ilbc_codec->dec_block, input->buf,
+    iLBC_decode(ilbc_codec->dec_block, (unsigned char*) input->buf,
 		&ilbc_codec->dec, 1);
 
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 1266)
@@ -429,5 +429,5 @@
     if (pj_list_empty(&l16_factory.codec_list)) {
 
-	codec = pj_pool_alloc(l16_factory.pool, sizeof(pjmedia_codec));
+	codec = PJ_POOL_ALLOC_T(l16_factory.pool, pjmedia_codec);
 	codec->codec_data = pj_pool_alloc(l16_factory.pool, 
 					  sizeof(struct l16_data));
@@ -442,5 +442,5 @@
     /* Init private data */
     ptime = GET_PTIME(id->clock_rate);
-    data = codec->codec_data;
+    data = (struct l16_data*) codec->codec_data;
     data->frame_size = ptime * id->clock_rate * id->channel_cnt * 2 / 1000;
 
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 1266)
@@ -482,6 +482,5 @@
 	pj_list_erase(codec);
     } else {
-	codec = pj_pool_zalloc(spx_factory.pool, 
-			       sizeof(pjmedia_codec));
+	codec = PJ_POOL_ZALLOC_T(spx_factory.pool, pjmedia_codec);
 	PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM);
 	codec->op = &spx_op;
@@ -737,5 +736,6 @@
 
     /* Encode the frame */
-    tx = speex_encode_int(spx->enc, input->buf, &spx->enc_bits);
+    tx = speex_encode_int(spx->enc, (spx_int16_t*)input->buf, 
+			  &spx->enc_bits);
 
     /* Check if we need not to transmit the frame (DTX) */
@@ -754,5 +754,5 @@
     /* Copy the bits to an array of char that can be written */
     output->size = speex_bits_write(&spx->enc_bits, 
-				    output->buf, output_buf_len);
+				    (char*)output->buf, output_buf_len);
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->timestamp = input->timestamp;
@@ -782,12 +782,12 @@
 
     /* Copy the data into the bit-stream struct */
-    speex_bits_read_from(&spx->dec_bits, input->buf, input->size);
+    speex_bits_read_from(&spx->dec_bits, (char*)input->buf, input->size);
 
     /* Decode the data */
-    speex_decode_int(spx->dec, &spx->dec_bits, output->buf);
+    speex_decode_int(spx->dec, &spx->dec_bits, (spx_int16_t*)output->buf);
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->size = speex_bits_nbytes(&spx->dec_bits);
-    pj_assert(output->size <= (int)output_buf_len);
+    pj_assert(output->size <= (unsigned)output_buf_len);
     output->timestamp.u64 = input->timestamp.u64;
 
@@ -815,5 +815,5 @@
 
     /* Recover packet loss */
-    speex_decode_int(spx->dec, NULL, output->buf);
+    speex_decode_int(spx->dec, NULL, (spx_int16_t*) output->buf);
 
     output->size = count * 2;
Index: pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c	(revision 1266)
@@ -67,5 +67,5 @@
 		     PJ_EINVAL);
 
-    clock = pj_pool_alloc(pool, sizeof(pjmedia_clock));
+    clock = PJ_POOL_ALLOC_T(pool, pjmedia_clock);
 
     
@@ -198,5 +198,5 @@
 {
     pj_timestamp now;
-    pjmedia_clock *clock = arg;
+    pjmedia_clock *clock = (pjmedia_clock*) arg;
 
     /* Get the first tick */
Index: pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 1266)
@@ -240,5 +240,5 @@
 
     /* Create port. */
-    conf_port = pj_pool_zalloc(pool, sizeof(struct conf_port));
+    conf_port = PJ_POOL_ZALLOC_T(pool, struct conf_port);
     PJ_ASSERT_RETURN(conf_port, PJ_ENOMEM);
 
@@ -255,5 +255,6 @@
 
     /* Create transmit flag array */
-    conf_port->listener_slots = pj_pool_zalloc(pool, 
+    conf_port->listener_slots = (SLOT_TYPE*)
+				pj_pool_zalloc(pool, 
 					  conf->max_ports * sizeof(SLOT_TYPE));
     PJ_ASSERT_RETURN(conf_port->listener_slots, PJ_ENOMEM);
@@ -336,5 +337,6 @@
 					   conf->clock_rate);
 	conf_port->rx_buf_count = 0;
-	conf_port->rx_buf = pj_pool_alloc(pool, conf_port->rx_buf_cap *
+	conf_port->rx_buf = (pj_int16_t*)
+			    pj_pool_alloc(pool, conf_port->rx_buf_cap *
 						sizeof(conf_port->rx_buf[0]));
 	PJ_ASSERT_RETURN(conf_port->rx_buf, PJ_ENOMEM);
@@ -343,5 +345,6 @@
 	conf_port->tx_buf_cap = conf_port->rx_buf_cap;
 	conf_port->tx_buf_count = 0;
-	conf_port->tx_buf = pj_pool_alloc(pool, conf_port->tx_buf_cap *
+	conf_port->tx_buf = (pj_int16_t*)
+			    pj_pool_alloc(pool, conf_port->tx_buf_cap *
 						sizeof(conf_port->tx_buf[0]));
 	PJ_ASSERT_RETURN(conf_port->tx_buf, PJ_ENOMEM);
@@ -350,5 +353,6 @@
 
     /* Create mix buffer. */
-    conf_port->mix_buf = pj_pool_zalloc(pool, conf->samples_per_frame *
+    conf_port->mix_buf = (pj_uint32_t*)
+			 pj_pool_zalloc(pool, conf->samples_per_frame *
 					      sizeof(conf_port->mix_buf[0]));
     PJ_ASSERT_RETURN(conf_port->mix_buf, PJ_ENOMEM);
@@ -381,5 +385,6 @@
     /* Passive port has rx buffers. */
     for (i=0; i<RX_BUF_COUNT; ++i) {
-	conf_port->snd_buf[i] = pj_pool_zalloc(pool, conf->samples_per_frame *
+	conf_port->snd_buf[i] = (pj_int16_t*)
+				pj_pool_zalloc(pool, conf->samples_per_frame *
 					      sizeof(conf_port->snd_buf[0][0]));
 	if (conf_port->snd_buf[i] == NULL) {
@@ -487,8 +492,9 @@
 
     /* Create and init conf structure. */
-    conf = pj_pool_zalloc(pool, sizeof(pjmedia_conf));
+    conf = PJ_POOL_ZALLOC_T(pool, pjmedia_conf);
     PJ_ASSERT_RETURN(conf, PJ_ENOMEM);
 
-    conf->ports = pj_pool_zalloc(pool, max_ports*sizeof(void*));
+    conf->ports = (struct conf_port**) 
+		  pj_pool_zalloc(pool, max_ports*sizeof(void*));
     PJ_ASSERT_RETURN(conf->ports, PJ_ENOMEM);
 
@@ -502,5 +508,5 @@
     
     /* Create and initialize the master port interface. */
-    conf->master_port = pj_pool_zalloc(pool, sizeof(pjmedia_port));
+    conf->master_port = PJ_POOL_ZALLOC_T(pool, pjmedia_port);
     PJ_ASSERT_RETURN(conf->master_port, PJ_ENOMEM);
     
@@ -523,5 +529,6 @@
 
     /* Create temporary buffer. */
-    conf->uns_buf = pj_pool_zalloc(pool, samples_per_frame *
+    conf->uns_buf = (pj_uint16_t*)
+		    pj_pool_zalloc(pool, samples_per_frame *
 					 sizeof(conf->uns_buf[0]));
 
@@ -598,5 +605,5 @@
 static pj_status_t destroy_port(pjmedia_port *this_port)
 {
-    pjmedia_conf *conf = this_port->port_data.pdata;
+    pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata;
     return pjmedia_conf_destroy(conf);
 }
@@ -626,5 +633,5 @@
 						const pj_str_t *name)
 {
-    int len;
+    unsigned len;
 
     /* Sanity check. */
@@ -764,10 +771,10 @@
 	name = &tmp;
 
-	tmp.ptr = pj_pool_alloc(pool, 32);
+	tmp.ptr = (char*) pj_pool_alloc(pool, 32);
 	tmp.slen = pj_ansi_snprintf(tmp.ptr, 32, "ConfPort#%d", index);
     }
 
     /* Create and initialize the media port structure. */
-    port = pj_pool_zalloc(pool, sizeof(pjmedia_port));
+    port = PJ_POOL_ZALLOC_T(pool, pjmedia_port);
     PJ_ASSERT_RETURN(port, PJ_ENOMEM);
     
@@ -1601,5 +1608,5 @@
 			     pjmedia_frame *frame)
 {
-    pjmedia_conf *conf = this_port->port_data.pdata;
+    pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata;
     pjmedia_frame_type speaker_frame_type = PJMEDIA_FRAME_TYPE_NONE;
     unsigned ci, cj, i, j;
@@ -1677,5 +1684,6 @@
 
 	    snd_buf = conf_port->snd_buf[conf_port->snd_read_pos];
-	    pjmedia_copy_samples(frame->buf, snd_buf, conf->samples_per_frame);
+	    pjmedia_copy_samples((pj_int16_t*)frame->buf, snd_buf, 
+				 conf->samples_per_frame);
 	    conf_port->snd_read_pos = (conf_port->snd_read_pos+1) % RX_BUF_COUNT;
 
@@ -1685,5 +1693,5 @@
 	    pjmedia_frame_type frame_type;
 
-	    status = read_port(conf, conf_port, frame->buf, 
+	    status = read_port(conf, conf_port, (pj_int16_t*)frame->buf, 
 			       conf->samples_per_frame, &frame_type);
 	    
@@ -1711,5 +1719,5 @@
 	 */
 	if (conf_port->rx_adj_level != NORMAL_LEVEL) {
-	    pj_int16_t *input = frame->buf;
+	    pj_int16_t *input = (pj_int16_t*) frame->buf;
 	    pj_int32_t adj = conf_port->rx_adj_level;
 
@@ -1739,5 +1747,5 @@
 
 	} else {
-	    level = pjmedia_calc_avg_signal(frame->buf, 
+	    level = pjmedia_calc_avg_signal((pj_int16_t*) frame->buf, 
 					    conf->samples_per_frame);
 	}
@@ -1800,5 +1808,6 @@
 	    if (listener->transmitter_cnt == 1) {
 		pjmedia_copy_samples((pj_int16_t*)mix_buf, 
-				     frame->buf, conf->samples_per_frame);
+				     (const pj_int16_t*)frame->buf, 
+				     conf->samples_per_frame);
 		listener->src_level = level;
 	    } else {
@@ -1857,8 +1866,9 @@
 			   conf->samples_per_frame));
 
-	pjmedia_copy_samples( frame->buf, (pj_int16_t*)conf->ports[0]->mix_buf, 
+	pjmedia_copy_samples( (pj_int16_t*)frame->buf, 
+			      (const pj_int16_t*)conf->ports[0]->mix_buf, 
 			      conf->samples_per_frame);
     } else {
-	pjmedia_zero_samples( frame->buf, conf->samples_per_frame ); 
+	pjmedia_zero_samples((pj_int16_t*)frame->buf, conf->samples_per_frame); 
     }
 
@@ -1898,7 +1908,7 @@
 			     const pjmedia_frame *frame)
 {
-    pjmedia_conf *conf = this_port->port_data.pdata;
+    pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata;
     struct conf_port *port = conf->ports[this_port->port_data.ldata];
-    const pj_int16_t *input = frame->buf;
+    const pj_int16_t *input = (const pj_int16_t*) frame->buf;
     pj_int16_t *target_snd_buf;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 1266)
@@ -146,5 +146,5 @@
 #endif
 
-    ec = pj_pool_zalloc(pool, sizeof(struct pjmedia_echo_state));
+    ec = PJ_POOL_ZALLOC_T(pool, struct pjmedia_echo_state);
 
     if (options & PJMEDIA_ECHO_SIMPLE) {
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_port.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_port.c	(revision 1266)
@@ -60,5 +60,5 @@
 
     /* Create the port and the AEC itself */
-    ec = pj_pool_zalloc(pool, sizeof(struct ec));
+    ec = PJ_POOL_ZALLOC_T(pool, struct ec);
     
     pjmedia_port_info_init(&ec->base.info, &AEC, SIGNATURE,
@@ -101,5 +101,5 @@
 		     PJ_EINVAL);
 
-    pjmedia_echo_capture(ec->ec, frame->buf, 0);
+    pjmedia_echo_capture(ec->ec, (pj_int16_t*)frame->buf, 0);
 
     return pjmedia_port_put_frame(ec->dn_port, frame);
@@ -117,8 +117,9 @@
     status = pjmedia_port_get_frame(ec->dn_port, frame);
     if (status!=PJ_SUCCESS || frame->type!=PJMEDIA_FRAME_TYPE_AUDIO) {
-	pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame);
+	pjmedia_zero_samples((pj_int16_t*)frame->buf, 
+			     this_port->info.samples_per_frame);
     }
 
-    pjmedia_echo_playback(ec->ec, frame->buf);
+    pjmedia_echo_playback(ec->ec, (pj_int16_t*)frame->buf);
 
     return status;
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_speex.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_speex.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_speex.c	(revision 1266)
@@ -78,5 +78,5 @@
     unsigned i;
 
-    fq = pj_pool_zalloc(pool, sizeof(pjmedia_frame_queue));
+    fq = PJ_POOL_ZALLOC_T(pool, pjmedia_frame_queue);
 
     pj_ansi_snprintf(fq->obj_name, sizeof(fq->obj_name), name, fq);
@@ -94,5 +94,5 @@
 	struct fq_frame *f;
 
-	f = pj_pool_zalloc(pool, sizeof(struct fq_frame));
+	f = PJ_POOL_ZALLOC_T(pool, struct fq_frame);
 	f->buf = pj_pool_alloc(pool, frame_size);
 
@@ -295,5 +295,5 @@
     *p_echo = NULL;
 
-    echo = pj_pool_zalloc(pool, sizeof(speex_ec));
+    echo = PJ_POOL_ZALLOC_T(pool, speex_ec);
     PJ_ASSERT_RETURN(echo != NULL, PJ_ENOMEM);
 
@@ -356,9 +356,10 @@
 
     /* Create temporary frame for echo cancellation */
-    echo->tmp_frame = pj_pool_zalloc(pool, 2 * samples_per_frame);
+    echo->tmp_frame = (pj_int16_t*) pj_pool_zalloc(pool, 2 * samples_per_frame);
     PJ_ASSERT_RETURN(echo->tmp_frame != NULL, PJ_ENOMEM);
 
     /* Create temporary frame to receive residue */
-    echo->residue = pj_pool_zalloc(pool, sizeof(spx_int32_t) * 
+    echo->residue = (spx_int32_t*)
+		    pj_pool_zalloc(pool, sizeof(spx_int32_t) * 
 					    (samples_per_frame+1));
     PJ_ASSERT_RETURN(echo->residue != NULL, PJ_ENOMEM);
@@ -392,5 +393,5 @@
 PJ_DEF(pj_status_t) speex_aec_destroy(void *state )
 {
-    speex_ec *echo = state;
+    speex_ec *echo = (speex_ec*) state;
 
     PJ_ASSERT_RETURN(echo && echo->state, PJ_EINVAL);
@@ -424,5 +425,5 @@
 				       pj_int16_t *play_frm )
 {
-    speex_ec *echo = state;
+    speex_ec *echo = (speex_ec*) state;
 
     /* Sanity checks */
@@ -482,5 +483,5 @@
 				       unsigned options )
 {
-    speex_ec *echo = state;
+    speex_ec *echo = (speex_ec*) state;
     pj_status_t status = PJ_SUCCESS;
 
@@ -552,5 +553,5 @@
 					   void *reserved )
 {
-    speex_ec *echo = state;
+    speex_ec *echo = (speex_ec*) state;
 
     /* Sanity checks */
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c	(revision 1266)
@@ -86,5 +86,5 @@
     PJ_UNUSED_ARG(latency_ms);
 
-    ec = pj_pool_zalloc(pool, sizeof(struct echo_supp));
+    ec = PJ_POOL_ZALLOC_T(pool, struct echo_supp);
     ec->samples_per_frame = samples_per_frame;
     ec->tail_ms = tail_ms;
@@ -120,5 +120,5 @@
 					pj_int16_t *play_frm )
 {
-    echo_supp *ec = state;
+    echo_supp *ec = (echo_supp*) state;
     pj_bool_t silence;
     pj_bool_t last_suppressing = ec->suppressing;
@@ -150,5 +150,5 @@
 				       unsigned options )
 {
-    echo_supp *ec = state;
+    echo_supp *ec = (echo_supp*) state;
     pj_time_val now;
     unsigned delay_ms;
@@ -186,5 +186,5 @@
 					   void *reserved )
 {
-    echo_supp *ec = state;
+    echo_supp *ec = (echo_supp*) state;
     pj_bool_t silence;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 1266)
@@ -127,5 +127,5 @@
 	return PJ_ENOMEM;
 
-    endpt = pj_pool_zalloc(pool, sizeof(struct pjmedia_endpt));
+    endpt = PJ_POOL_ZALLOC_T(pool, struct pjmedia_endpt);
     endpt->pool = pool;
     endpt->pf = pf;
@@ -247,5 +247,5 @@
 static int PJ_THREAD_FUNC worker_proc(void *arg)
 {
-    pjmedia_endpt *endpt = arg;
+    pjmedia_endpt *endpt = (pjmedia_endpt*) arg;
 
     while (!endpt->quit_flag) {
@@ -294,5 +294,5 @@
 
     /* Create and initialize basic SDP session */
-    sdp = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_session));
+    sdp = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
 
     pj_gettimeofday(&tv);
@@ -308,5 +308,5 @@
      * SDP connection line in the session level.
      */
-    sdp->conn = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_conn));
+    sdp->conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn);
     sdp->conn->net_type = STR_IN;
     sdp->conn->addr_type = STR_IP4;
@@ -322,5 +322,5 @@
 
     sdp->media_count = 1;
-    m = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_media));
+    m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media);
     sdp->media[0] = m;
 
@@ -338,7 +338,7 @@
 #if defined(PJMEDIA_HAS_RTCP_IN_SDP) && PJMEDIA_HAS_RTCP_IN_SDP!=0
     if (sock_info->rtcp_addr_name.sin_family != 0) {
-	attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+	attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
 	attr->name = pj_str("rtcp");
-	attr->value.ptr = pj_pool_alloc(pool, 80);
+	attr->value.ptr = (char*) pj_pool_alloc(pool, 80);
 	attr->value.slen = 
 	    pj_ansi_snprintf(attr->value.ptr, 80,
@@ -368,5 +368,5 @@
 	fmt = &m->desc.fmt[m->desc.fmt_count++];
 
-	fmt->ptr = pj_pool_alloc(pool, 8);
+	fmt->ptr = (char*) pj_pool_alloc(pool, 8);
 	fmt->slen = pj_utoa(codec_info->pt, fmt->ptr);
 
@@ -400,8 +400,8 @@
 	if (codec_param.setting.dec_fmtp_mode != 0) {
 	    const pj_str_t fmtp = { "fmtp", 4 };
-	    attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));
+	    attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
 
 	    attr->name = fmtp;
-	    attr->value.ptr = pj_pool_alloc(pool, 32);
+	    attr->value.ptr = (char*) pj_pool_alloc(pool, 32);
 	    attr->value.slen = 
 		pj_ansi_snprintf( attr->value.ptr, 32,
@@ -414,5 +414,5 @@
 
     /* Add sendrecv attribute. */
-    attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
     attr->name = STR_SENDRECV;
     m->attr[m->attr_count++] = attr;
@@ -428,5 +428,5 @@
 
     /* Add rtpmap. */
-    attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
     attr->name = pj_str("rtpmap");
     attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 
@@ -435,5 +435,5 @@
 
     /* Add fmtp */
-    attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
     attr->name = pj_str("fmtp");
     attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15");
Index: pjproject/trunk/pjmedia/src/pjmedia/g711.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 1266)
@@ -320,7 +320,6 @@
 	struct g711_private *codec_priv;
 
-	codec = pj_pool_alloc(g711_factory.pool, sizeof(pjmedia_codec));
-	codec_priv = pj_pool_zalloc(g711_factory.pool, 
-				    sizeof(struct g711_private));
+	codec = PJ_POOL_ALLOC_T(g711_factory.pool, pjmedia_codec);
+	codec_priv = PJ_POOL_ZALLOC_T(g711_factory.pool, struct g711_private);
 	if (!codec || !codec_priv) {
 	    pj_mutex_unlock(g711_factory.mutex);
@@ -372,5 +371,5 @@
 				      pjmedia_codec *codec )
 {
-    struct g711_private *priv = codec->codec_data;
+    struct g711_private *priv = (struct g711_private*) codec->codec_data;
     int i = 0;
 
@@ -421,5 +420,5 @@
 			     pjmedia_codec_param *attr )
 {
-    struct g711_private *priv = codec->codec_data;
+    struct g711_private *priv = (struct g711_private*) codec->codec_data;
     priv->pt = attr->info.pt;
 #if !PLC_DISABLED
@@ -440,5 +439,5 @@
 			        const pjmedia_codec_param *attr )
 {
-    struct g711_private *priv = codec->codec_data;
+    struct g711_private *priv = (struct g711_private*) codec->codec_data;
 
     if (attr->info.pt != priv->pt)
@@ -488,5 +487,5 @@
 {
     pj_int16_t *samples = (pj_int16_t*) input->buf;
-    struct g711_private *priv = codec->codec_data;
+    struct g711_private *priv = (struct g711_private*) codec->codec_data;
 
     /* Check output buffer length */
@@ -502,5 +501,6 @@
 					     &input->timestamp);
 
-	is_silence = pjmedia_silence_det_detect(priv->vad, input->buf, 
+	is_silence = pjmedia_silence_det_detect(priv->vad, 
+						(const pj_int16_t*) input->buf, 
 						(input->size >> 1), NULL);
 	if (is_silence && 
@@ -521,5 +521,5 @@
     if (priv->pt == PJMEDIA_RTP_PT_PCMA) {
 	unsigned i, n;
-	pj_uint8_t *dst = output->buf;
+	pj_uint8_t *dst = (pj_uint8_t*) output->buf;
 
 	n = (input->size >> 1);
@@ -529,5 +529,5 @@
     } else if (priv->pt == PJMEDIA_RTP_PT_PCMU) {
 	unsigned i, n;
-	pj_uint8_t *dst = output->buf;
+	pj_uint8_t *dst = (pj_uint8_t*) output->buf;
 
 	n = (input->size >> 1);
@@ -551,5 +551,5 @@
 				struct pjmedia_frame *output)
 {
-    struct g711_private *priv = codec->codec_data;
+    struct g711_private *priv = (struct g711_private*) codec->codec_data;
 
     /* Check output buffer length */
@@ -564,6 +564,6 @@
     if (priv->pt == PJMEDIA_RTP_PT_PCMA) {
 	unsigned i;
-	pj_uint8_t *src = input->buf;
-	pj_uint16_t *dst = output->buf;
+	pj_uint8_t *src = (pj_uint8_t*) input->buf;
+	pj_uint16_t *dst = (pj_uint16_t*) output->buf;
 
 	for (i=0; i!=input->size; ++i) {
@@ -572,6 +572,6 @@
     } else if (priv->pt == PJMEDIA_RTP_PT_PCMU) {
 	unsigned i;
-	pj_uint8_t *src = input->buf;
-	pj_uint16_t *dst = output->buf;
+	pj_uint8_t *src = (pj_uint8_t*) input->buf;
+	pj_uint16_t *dst = (pj_uint16_t*) output->buf;
 
 	for (i=0; i!=input->size; ++i) {
Index: pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 1266)
@@ -31,5 +31,5 @@
 
 
-struct jb_framelist
+typedef struct jb_framelist_t
 {
     char	*flist_buffer;
@@ -41,13 +41,11 @@
     unsigned	 flist_tail;
     unsigned	 flist_origin;
-};
-
-
-typedef struct jb_framelist jb_framelist;
+} jb_framelist_t;
+
 
 struct pjmedia_jbuf
 {
     pj_str_t	    name;		  // jitter buffer name
-    jb_framelist    jb_framelist;
+    jb_framelist_t  jb_framelist;
     pj_size_t	    jb_frame_size;	  // frame size	
     unsigned	    jb_frame_ptime;	  // frame duration.
@@ -93,5 +91,5 @@
 
 static pj_status_t jb_framelist_init( pj_pool_t *pool,
-				      jb_framelist *framelist,
+				      jb_framelist_t *framelist,
 				      unsigned frame_size,
 				      unsigned max_count) 
@@ -99,13 +97,14 @@
     PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL);
 
-    pj_bzero(framelist, sizeof(jb_framelist));
+    pj_bzero(framelist, sizeof(jb_framelist_t));
 
     framelist->flist_frame_size = frame_size;
     framelist->flist_max_count = max_count;
-    framelist->flist_buffer = pj_pool_zalloc(pool,
+    framelist->flist_buffer = (char*) 
+			      pj_pool_zalloc(pool,
 					     framelist->flist_frame_size * 
 					     framelist->flist_max_count);
 
-    framelist->flist_frame_type = 
+    framelist->flist_frame_type = (int*)
 	pj_pool_zalloc(pool, sizeof(framelist->flist_frame_type[0]) * 
 				framelist->flist_max_count);
@@ -117,5 +116,5 @@
 }
 
-static pj_status_t jb_framelist_destroy(jb_framelist *framelist) 
+static pj_status_t jb_framelist_destroy(jb_framelist_t *framelist) 
 {
     PJ_UNUSED_ARG(framelist);
@@ -124,5 +123,5 @@
 
 
-static unsigned jb_framelist_size(jb_framelist *framelist) 
+static unsigned jb_framelist_size(jb_framelist_t *framelist) 
 {
     if (framelist->flist_tail == framelist->flist_head) {
@@ -135,5 +134,5 @@
 
 
-static pj_bool_t jb_framelist_get(jb_framelist *framelist,
+static pj_bool_t jb_framelist_get(jb_framelist_t *framelist,
 				  void *frame,
 				  pjmedia_jb_frame_type *p_type) 
@@ -168,5 +167,5 @@
 
 
-static void jb_framelist_remove_head( jb_framelist *framelist,
+static void jb_framelist_remove_head( jb_framelist_t *framelist,
 				      unsigned count) 
 {
@@ -215,5 +214,5 @@
 
 
-static pj_bool_t jb_framelist_put_at(jb_framelist *framelist,
+static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist,
 				     unsigned index,
 				     const void *frame,
@@ -283,5 +282,5 @@
     pj_status_t status;
 
-    jb = pj_pool_zalloc(pool, sizeof(pjmedia_jbuf));
+    jb = PJ_POOL_ZALLOC_T(pool, pjmedia_jbuf);
 
     status = jb_framelist_init(pool, &jb->jb_framelist, frame_size, max_count);
Index: pjproject/trunk/pjmedia/src/pjmedia/master_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/master_port.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/master_port.c	(revision 1266)
@@ -85,5 +85,5 @@
 
     /* Create the master port instance */
-    m = pj_pool_zalloc(pool, sizeof(pjmedia_master_port));
+    m = PJ_POOL_ZALLOC_T(pool, pjmedia_master_port);
     m->options = options;
     m->u_port = u_port;
@@ -145,5 +145,5 @@
 static void clock_callback(const pj_timestamp *ts, void *user_data)
 {
-    pjmedia_master_port *m = user_data;
+    pjmedia_master_port *m = (pjmedia_master_port*) user_data;
     pjmedia_frame frame;
     pj_status_t status;
Index: pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/mem_capture.c	(revision 1266)
@@ -74,5 +74,5 @@
 
 
-    rec = pj_pool_zalloc(pool, sizeof(struct mem_rec));
+    rec = PJ_POOL_ZALLOC_T(pool, struct mem_rec);
     PJ_ASSERT_RETURN(rec != NULL, PJ_ENOMEM);
 
Index: pjproject/trunk/pjmedia/src/pjmedia/mem_player.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/mem_player.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/mem_player.c	(revision 1266)
@@ -76,5 +76,5 @@
 
 
-    port = pj_pool_zalloc(pool, sizeof(struct mem_player));
+    port = PJ_POOL_ZALLOC_T(pool, struct mem_player);
     PJ_ASSERT_RETURN(port != NULL, PJ_ENOMEM);
 
Index: pjproject/trunk/pjmedia/src/pjmedia/null_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 1266)
@@ -45,5 +45,5 @@
     PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL);
 
-    port = pj_pool_zalloc(pool, sizeof(pjmedia_port));
+    port = PJ_POOL_ZALLOC_T(pool, pjmedia_port);
     PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM);
 
@@ -84,5 +84,6 @@
     frame->size = this_port->info.samples_per_frame * 2;
     frame->timestamp.u32.lo += this_port->info.samples_per_frame;
-    pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame);
+    pjmedia_zero_samples((pj_int16_t*)frame->buf, 
+			 this_port->info.samples_per_frame);
 
     return PJ_SUCCESS;
Index: pjproject/trunk/pjmedia/src/pjmedia/pasound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 1266)
@@ -85,5 +85,5 @@
 			      void *userData )
 {
-    pjmedia_snd_stream *stream = userData;
+    pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData;
     pj_status_t status;
 
@@ -131,5 +131,5 @@
 			     void *userData )
 {
-    pjmedia_snd_stream *stream = userData;
+    pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData;
     pj_status_t status;
     unsigned size = frameCount * stream->bytes_per_sample *
@@ -389,5 +389,5 @@
 	return PJ_ENOMEM;
 
-    stream = pj_pool_zalloc(pool, sizeof(*stream));
+    stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream);
     stream->pool = pool;
     pj_strdup2_with_null(pool, &stream->name, paDevInfo->name);
@@ -485,5 +485,5 @@
 	return PJ_ENOMEM;
 
-    stream = pj_pool_calloc(pool, 1, sizeof(*stream));
+    stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream);
     stream->pool = pool;
     pj_strdup2_with_null(pool, &stream->name, paDevInfo->name);
@@ -605,5 +605,5 @@
 	return PJ_ENOMEM;
 
-    stream = pj_pool_zalloc(pool, sizeof(*stream));
+    stream = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_stream);
     stream->pool = pool;
     pj_strdup2_with_null(pool, &stream->name, paRecDevInfo->name);
Index: pjproject/trunk/pjmedia/src/pjmedia/plc_common.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/plc_common.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/plc_common.c	(revision 1266)
@@ -87,5 +87,5 @@
     PJ_UNUSED_ARG(options);
 
-    plc = pj_pool_zalloc(pool, sizeof(pjmedia_plc));
+    plc = PJ_POOL_ZALLOC_T(pool, pjmedia_plc);
 
     if (0)
@@ -151,8 +151,8 @@
     PJ_UNUSED_ARG(clock_rate);
 
-    o = pj_pool_alloc(pool, sizeof(struct replay_plc));
+    o = PJ_POOL_ALLOC_T(pool, struct replay_plc);
     o->size = samples_per_frame * 2;
     o->replay_cnt = 0;
-    o->frame = pj_pool_zalloc(pool, o->size);
+    o->frame = (pj_int16_t*) pj_pool_zalloc(pool, o->size);
 
     return o;
@@ -161,5 +161,5 @@
 static void plc_replay_save(void *plc, pj_int16_t *frame)
 {
-    struct replay_plc *o = plc;
+    struct replay_plc *o = (struct replay_plc*) plc;
 
     pj_memcpy(o->frame, frame, o->size);
@@ -169,5 +169,5 @@
 static void plc_replay_generate(void *plc, pj_int16_t *frame)
 {
-    struct replay_plc *o = plc;
+    struct replay_plc *o = (struct replay_plc*) plc;
     unsigned i, count;
     pj_int16_t *samp;
Index: pjproject/trunk/pjmedia/src/pjmedia/resample_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/resample_port.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/resample_port.c	(revision 1266)
@@ -70,5 +70,5 @@
     
     /* Create and initialize port. */
-    rport = pj_pool_zalloc(pool, sizeof(struct resample_port));
+    rport = PJ_POOL_ZALLOC_T(pool, struct resample_port);
     PJ_ASSERT_RETURN(rport != NULL, PJ_ENOMEM);
 
@@ -85,8 +85,10 @@
      * both functions may run simultaneously.
      */
-    rport->get_buf = pj_pool_alloc(pool, dn_port->info.bytes_per_frame);
+    rport->get_buf = (pj_int16_t*)
+		     pj_pool_alloc(pool, dn_port->info.bytes_per_frame);
     PJ_ASSERT_RETURN(rport->get_buf != NULL, PJ_ENOMEM);
 
-    rport->put_buf = pj_pool_alloc(pool, dn_port->info.bytes_per_frame);
+    rport->put_buf = (pj_int16_t*)
+		     pj_pool_alloc(pool, dn_port->info.bytes_per_frame);
     PJ_ASSERT_RETURN(rport->put_buf != NULL, PJ_ENOMEM);
 
@@ -140,5 +142,6 @@
 
     if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) {
-	pjmedia_resample_run( rport->resample_put, frame->buf, 
+	pjmedia_resample_run( rport->resample_put, 
+			      (const pj_int16_t*) frame->buf, 
 			      rport->put_buf);
 
@@ -189,5 +192,7 @@
     }
 
-    pjmedia_resample_run( rport->resample_get, tmp_frame.buf, frame->buf);
+    pjmedia_resample_run( rport->resample_get, 
+			  (const pj_int16_t*) tmp_frame.buf, 
+			  (pj_int16_t*) frame->buf);
 
     frame->size = rport->base.info.bytes_per_frame;
Index: pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c	(revision 1266)
@@ -59,5 +59,5 @@
 		     rate_out && samples_per_frame, PJ_EINVAL);
 
-    resample = pj_pool_alloc(pool, sizeof(pjmedia_resample));
+    resample = PJ_POOL_ALLOC_T(pool, pjmedia_resample);
     PJ_ASSERT_RETURN(resample, PJ_ENOMEM);
 
@@ -89,5 +89,5 @@
 
 	size = (samples_per_frame + 2*resample->xoff) * sizeof(pj_int16_t);
-	resample->buffer = pj_pool_alloc(pool, size);
+	resample->buffer = (pj_int16_t*) pj_pool_alloc(pool, size);
 	PJ_ASSERT_RETURN(resample->buffer, PJ_ENOMEM);
 
Index: pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/rtcp.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/rtcp.c	(revision 1266)
@@ -141,5 +141,5 @@
 
     /* Name */
-    sess->name = name ? name : THIS_FILE,
+    sess->name = name ? name : (char*)THIS_FILE,
 
     /* Set clock rate */
@@ -333,5 +333,5 @@
 				   pj_size_t size)
 {
-    const pjmedia_rtcp_common *common = pkt;
+    pjmedia_rtcp_common *common = (pjmedia_rtcp_common*) pkt;
     const pjmedia_rtcp_rr *rr = NULL;
     const pjmedia_rtcp_sr *sr = NULL;
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 1266)
@@ -461,5 +461,5 @@
 			   rtpmap->param.ptr);
 
-    if (len < 1 || len > sizeof(tempbuf))
+    if (len < 1 || len > (int)sizeof(tempbuf))
 	return PJMEDIA_SDP_ERTPMAPTOOLONG;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 1266)
@@ -57,5 +57,5 @@
 PJ_DEF(const char*) pjmedia_sdp_neg_state_str(pjmedia_sdp_neg_state state)
 {
-    if (state >=0 && state < PJ_ARRAY_SIZE(state_str))
+    if (state >=0 && state < (pjmedia_sdp_neg_state)PJ_ARRAY_SIZE(state_str))
 	return state_str[state];
 
Index: pjproject/trunk/pjmedia/src/pjmedia/session.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 1266)
@@ -422,5 +422,5 @@
   
     /* Now that we have codec info, get the codec param. */
-    si->param = pj_pool_alloc(pool, sizeof(*si->param));
+    si->param = PJ_POOL_ALLOC_T(pool, pjmedia_codec_param);
     status = pjmedia_codec_mgr_get_default_param(mgr, &si->fmt, si->param);
     if (status != PJ_SUCCESS)
@@ -533,5 +533,5 @@
     PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM);
 
-    session = pj_pool_zalloc(pool, sizeof(pjmedia_session));
+    session = PJ_POOL_ZALLOC_T(pool, pjmedia_session);
     session->pool = pool;
     session->endpt = endpt;
Index: pjproject/trunk/pjmedia/src/pjmedia/silencedet.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/silencedet.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/silencedet.c	(revision 1266)
@@ -69,5 +69,5 @@
     PJ_ASSERT_RETURN(pool && p_sd, PJ_EINVAL);
 
-    sd = pj_pool_zalloc(pool, sizeof(struct pjmedia_silence_det));
+    sd = PJ_POOL_ZALLOC_T(pool, pjmedia_silence_det);
 
     pj_ansi_strncpy(sd->objname, THIS_FILE, PJ_MAX_OBJ_NAME);
Index: pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 1266)
@@ -74,5 +74,5 @@
 			   /* out */  unsigned size)
 {
-    pjmedia_snd_port *snd_port = user_data;
+    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
     pjmedia_port *port;
     pjmedia_frame frame;
@@ -112,5 +112,5 @@
 
     if (snd_port->plc)
-	pjmedia_plc_save(snd_port->plc, output);
+	pjmedia_plc_save(snd_port->plc, (pj_int16_t*) output);
 
     if (snd_port->ec_state) {
@@ -121,5 +121,5 @@
 	}
 	snd_port->ec_suspend_count = 0;
-	pjmedia_echo_playback(snd_port->ec_state, output);
+	pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output);
     }
 
@@ -137,5 +137,5 @@
 	if (snd_port->ec_state) {
 	    /* To maintain correct delay in EC */
-	    pjmedia_echo_playback(snd_port->ec_state, output);
+	    pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output);
 	}
     }
@@ -144,5 +144,5 @@
     if (snd_port->plc) {
 
-	pjmedia_plc_generate(snd_port->plc, output);
+	pjmedia_plc_generate(snd_port->plc, (pj_int16_t*) output);
 #ifdef SIMULATE_LOST_PCT
 	PJ_LOG(4,(THIS_FILE, "Lost frame generated"));
@@ -166,5 +166,5 @@
 			  /* in*/    unsigned size)
 {
-    pjmedia_snd_port *snd_port = user_data;
+    pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
     pjmedia_port *port;
     pjmedia_frame frame;
@@ -182,5 +182,5 @@
     /* Cancel echo */
     if (snd_port->ec_state && !snd_port->ec_suspended) {
-	pjmedia_echo_capture(snd_port->ec_state, input, 0);
+	pjmedia_echo_capture(snd_port->ec_state, (pj_int16_t*) input, 0);
     }
 
@@ -327,5 +327,5 @@
     PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL);
 
-    snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));
+    snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port);
     PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM);
 
@@ -366,5 +366,5 @@
     PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL);
 
-    snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));
+    snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port);
     PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM);
 
@@ -403,5 +403,5 @@
     PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL);
 
-    snd_port = pj_pool_zalloc(pool, sizeof(pjmedia_snd_port));
+    snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port);
     PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM);
 
Index: pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c	(revision 1266)
@@ -59,5 +59,5 @@
 	pjmedia_port *port;
 	pj_bool_t     reversed;
-    } *port_desc;
+    } port_desc[64];
 
     /* Temporary buffers needed to extract mono frame from
@@ -144,14 +144,16 @@
 
     /* Create the splitter/combiner structure */
-    sc = pj_pool_zalloc(pool, sizeof(struct splitcomb));
+    sc = PJ_POOL_ZALLOC_T(pool, struct splitcomb);
     PJ_ASSERT_RETURN(sc != NULL, PJ_ENOMEM);
 
     /* Create temporary buffers */
-    sc->get_buf = pj_pool_alloc(pool, samples_per_frame * 
+    sc->get_buf = (TMP_SAMP_TYPE*)
+		  pj_pool_alloc(pool, samples_per_frame * 
 				      sizeof(TMP_SAMP_TYPE) /
 				      channel_count);
     PJ_ASSERT_RETURN(sc->get_buf, PJ_ENOMEM);
 
-    sc->put_buf = pj_pool_alloc(pool, samples_per_frame * 
+    sc->put_buf = (TMP_SAMP_TYPE*)
+		  pj_pool_alloc(pool, samples_per_frame * 
 				      sizeof(TMP_SAMP_TYPE) /
 				      channel_count);
@@ -171,5 +173,8 @@
 
     /* Init ports array */
+    /*
     sc->port_desc = pj_pool_zalloc(pool, channel_count*sizeof(*sc->port_desc));
+    */
+    pj_bzero(sc->port_desc, sizeof(sc->port_desc));
 
     /* Done for now */
@@ -238,5 +243,5 @@
 
     /* Create the port */
-    rport = pj_pool_zalloc(pool, sizeof(struct reverse_port));
+    rport = PJ_POOL_ZALLOC_T(pool, struct reverse_port);
     rport->parent = sc;
     rport->ch_num = ch_num;
@@ -262,5 +267,6 @@
     /* Create put buffers */
     for (i=0; i<rport->buf_cnt; ++i) {
-	rport->dnstream_buf[i] = pj_pool_zalloc(pool, port->info.bytes_per_frame);
+	rport->dnstream_buf[i]=(pj_int16_t*)
+                               pj_pool_zalloc(pool, port->info.bytes_per_frame);
 	PJ_ASSERT_RETURN(rport->dnstream_buf[i], PJ_ENOMEM);
     }
@@ -269,5 +275,6 @@
     /* Create get buffers */
     for (i=0; i<rport->buf_cnt; ++i) {
-	rport->upstream_buf[i] = pj_pool_zalloc(pool, 
+	rport->upstream_buf[i] = (pj_int16_t*)
+				 pj_pool_zalloc(pool, 
 						port->info.bytes_per_frame);
 	PJ_ASSERT_RETURN(rport->upstream_buf[i], PJ_ENOMEM);
@@ -367,5 +374,5 @@
 
 	    /* Extract the mono frame */
-	    extract_mono_frame(frame->buf, sc->put_buf, ch, 
+	    extract_mono_frame((const pj_int16_t*)frame->buf, sc->put_buf, ch, 
 			       this_port->info.channel_count, 
 			       frame->size * 8 / 
@@ -405,5 +412,5 @@
 
 	    /* Extract mono-frame and put it in downstream buffer */
-	    extract_mono_frame(frame->buf, 
+	    extract_mono_frame((const pj_int16_t*)frame->buf, 
 			       rport->dnstream_buf[rport->dn_write_pos],
 			       ch, this_port->info.channel_count, 
@@ -434,5 +441,6 @@
 
     /* Clear output frame */
-    pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame);
+    pjmedia_zero_samples((pj_int16_t*)frame->buf, 
+			 this_port->info.samples_per_frame);
 
     /* Read frame from each port */
@@ -460,5 +468,6 @@
 
 	    /* Combine the mono frame into multichannel frame */
-	    store_mono_frame(mono_frame.buf, frame->buf, ch,
+	    store_mono_frame((const pj_int16_t*)mono_frame.buf, 
+			     (pj_int16_t*)frame->buf, ch,
 			     this_port->info.channel_count,
 			     mono_frame.size * 8 /
@@ -495,6 +504,6 @@
 
 	    /* Combine the mono frame into multichannel frame */
-	    store_mono_frame(rport->upstream_buf[rport->up_read_pos], 
-			     frame->buf, ch,
+	    store_mono_frame((const pj_int16_t*)rport->upstream_buf[rport->up_read_pos], 
+			     (pj_int16_t*)frame->buf, ch,
 			     this_port->info.channel_count,
 			     port->info.samples_per_frame);
@@ -580,5 +589,5 @@
 
     pjmedia_copy_samples(rport->upstream_buf[rport->up_write_pos],
-			 frame->buf, count);
+			 (const pj_int16_t*) frame->buf, count);
     rport->up_write_pos = (rport->up_write_pos+1) % rport->buf_cnt;
 
@@ -622,5 +631,5 @@
 
     /* Get the samples from the circular buffer */
-    pjmedia_copy_samples(frame->buf, 
+    pjmedia_copy_samples((pj_int16_t*)frame->buf, 
 			 rport->dnstream_buf[rport->dn_read_pos],
 			 count);
Index: pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 1266)
@@ -167,5 +167,5 @@
 static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame)
 {
-    pjmedia_stream *stream = port->port_data.pdata;
+    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata;
     pjmedia_channel *channel = stream->dec;
     unsigned samples_count, samples_per_frame, samples_required;
@@ -192,5 +192,5 @@
 			stream->codec_param.info.channel_cnt / 
 			1000;
-    p_out_samp = frame->buf;
+    p_out_samp = (pj_int16_t*) frame->buf;
 
     for (samples_count=0; samples_count < samples_required; 
@@ -383,5 +383,5 @@
     pj_assert(sizeof(pjmedia_rtp_dtmf_event) == 4);
 
-    event = frame_out->buf;
+    event = (pjmedia_rtp_dtmf_event*) frame_out->buf;
     cur_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts);
     duration = cur_ts - digit->start_ts;
@@ -515,5 +515,5 @@
 				  const pjmedia_frame *frame )
 {
-    pjmedia_stream *stream = port->port_data.pdata;
+    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata;
     pjmedia_channel *channel = stream->enc;
     pj_status_t status = 0;
@@ -666,5 +666,5 @@
     /* Set RTP marker bit if currently not streaming */
     if (stream->is_streaming == PJ_FALSE) {
-	pjmedia_rtp_hdr *rtp = channel->out_pkt;
+	pjmedia_rtp_hdr *rtp = (pjmedia_rtp_hdr*) channel->out_pkt;
 
 	rtp->m = 1;
@@ -698,5 +698,5 @@
 			      const pjmedia_frame *frame )
 {
-    pjmedia_stream *stream = port->port_data.pdata;
+    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata;
     pjmedia_frame tmp_zero_frame;
     unsigned samples_per_frame;
@@ -831,5 +831,5 @@
 				  const void *payload, unsigned payloadlen)
 {
-    const pjmedia_rtp_dtmf_event *event = payload;
+    pjmedia_rtp_dtmf_event *event = (pjmedia_rtp_dtmf_event*) payload;
 
     /* Check compiler packing. */
@@ -903,5 +903,5 @@
 
 {
-    pjmedia_stream *stream = data;
+    pjmedia_stream *stream = (pjmedia_stream*) data;
     pjmedia_channel *channel = stream->dec;
     const pjmedia_rtp_hdr *hdr;
@@ -919,5 +919,5 @@
 
     /* Ignore keep-alive packets */
-    if (bytes_read < sizeof(pjmedia_rtp_hdr))
+    if (bytes_read < (pj_ssize_t) sizeof(pjmedia_rtp_hdr))
 	return;
 
@@ -1053,5 +1053,5 @@
                         pj_ssize_t bytes_read)
 {
-    pjmedia_stream *stream = data;
+    pjmedia_stream *stream = (pjmedia_stream*) data;
 
     /* Check for errors */
@@ -1081,5 +1081,5 @@
     /* Allocate memory for channel descriptor */
 
-    channel = pj_pool_zalloc(pool, sizeof(pjmedia_channel));
+    channel = PJ_POOL_ZALLOC_T(pool, pjmedia_channel);
     PJ_ASSERT_RETURN(channel != NULL, PJ_ENOMEM);
 
@@ -1147,9 +1147,9 @@
     /* Allocate the media stream: */
 
-    stream = pj_pool_zalloc(pool, sizeof(pjmedia_stream));
+    stream = PJ_POOL_ZALLOC_T(pool, pjmedia_stream);
     PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM);
 
     /* Init stream/port name */
-    name.ptr = pj_pool_alloc(pool, M);
+    name.ptr = (char*) pj_pool_alloc(pool, M);
     name.slen = pj_ansi_snprintf(name.ptr, M, "strm%p", stream);
 
@@ -1263,5 +1263,6 @@
 	/* Allocate buffer */
 	stream->enc_buf_size = stream->port.info.clock_rate * ptime / 1000;
-	stream->enc_buf = pj_pool_alloc(pool, stream->enc_buf_size * 2);
+	stream->enc_buf = (pj_int16_t*)
+			  pj_pool_alloc(pool, stream->enc_buf_size * 2);
 
     } else {
@@ -1536,5 +1537,5 @@
     
     if (stream->tx_dtmf_count+digit_char->slen >=
-	PJ_ARRAY_SIZE(stream->tx_dtmf_buf))
+	(long)PJ_ARRAY_SIZE(stream->tx_dtmf_buf))
     {
 	status = PJ_ETOOMANY;
Index: pjproject/trunk/pjmedia/src/pjmedia/tonegen.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/tonegen.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/tonegen.c	(revision 1266)
@@ -306,5 +306,5 @@
 
     /* Create and initialize port */
-    tonegen = pj_pool_zalloc(pool, sizeof(struct tonegen));
+    tonegen = PJ_POOL_ZALLOC_T(pool, struct tonegen);
     if (name == NULL || name->slen == 0) name = &STR_TONE_GEN;
     status = pjmedia_port_info_init(&tonegen->base.info, name, 
@@ -422,5 +422,5 @@
     }
     
-    dst = frame->buf;
+    dst = (short*) frame->buf;
     end = dst + port->info.samples_per_frame;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 1266)
@@ -250,5 +250,5 @@
     unsigned i, cand_cnt;
 
-    buffer = pj_pool_alloc(pool, MAXLEN);
+    buffer = (char*) pj_pool_alloc(pool, MAXLEN);
 
     /* Create ice-ufrag attribute */
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 1266)
@@ -235,5 +235,5 @@
 	return PJ_ENOMEM;
 
-    tp = pj_pool_zalloc(pool, sizeof(struct transport_udp));
+    tp = PJ_POOL_ZALLOC_T(pool, struct transport_udp);
     tp->pool = pool;
     tp->options = options;
@@ -379,5 +379,5 @@
     PJ_UNUSED_ARG(op_key);
 
-    udp = pj_ioqueue_get_user_data(key);
+    udp = (struct transport_udp*) pj_ioqueue_get_user_data(key);
 
     do {
@@ -480,5 +480,5 @@
     PJ_UNUSED_ARG(op_key);
 
-    udp = pj_ioqueue_get_user_data(key);
+    udp = (struct transport_udp*) pj_ioqueue_get_user_data(key);
 
     do {
@@ -568,5 +568,5 @@
 
     /* Copy remote RTP address, if one is specified. */
-    rtcp_addr = rem_rtcp;
+    rtcp_addr = (const pj_sockaddr_in*) rem_rtcp;
     if (rtcp_addr && rtcp_addr->sin_addr.s_addr != 0) {
 	pj_memcpy(&udp->rem_rtcp_addr, rem_rtcp, sizeof(pj_sockaddr_in));
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 1266)
@@ -80,5 +80,5 @@
     struct file_port *port;
 
-    port = pj_pool_zalloc(pool, sizeof(struct file_port));
+    port = PJ_POOL_ZALLOC_T(pool, struct file_port);
     if (!port)
 	return NULL;
@@ -350,5 +350,5 @@
 
     /* Create buffer. */
-    fport->buf = pj_pool_alloc(pool, fport->bufsize);
+    fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize);
     if (!fport->buf) {
 	pj_file_close(fport->fd);
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_playlist.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_playlist.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_playlist.c	(revision 1266)
@@ -85,5 +85,5 @@
     struct playlist_port *port;
 
-    port = pj_pool_zalloc(pool, sizeof(struct playlist_port));
+    port = PJ_POOL_ZALLOC_T(pool, struct playlist_port);
     if (!port)
 	return NULL;
@@ -276,5 +276,6 @@
 
     /* Create file descriptor list */
-    fport->fd_list = pj_pool_zalloc(pool, sizeof(pj_oshandle_t)*file_count);
+    fport->fd_list = (pj_oshandle_t*)
+		     pj_pool_zalloc(pool, sizeof(pj_oshandle_t)*file_count);
     if (!fport->fd_list) {
 	return PJ_ENOMEM;
@@ -282,5 +283,6 @@
 
     /* Create file size list */
-    fport->fsize_list = pj_pool_alloc(pool, sizeof(pj_off_t)*file_count);
+    fport->fsize_list = (pj_off_t*)
+			pj_pool_alloc(pool, sizeof(pj_off_t)*file_count);
     if (!fport->fsize_list) {
 	return PJ_ENOMEM;
@@ -288,5 +290,6 @@
 
     /* Create start of WAVE data list */
-    fport->start_data_list = pj_pool_alloc(pool, sizeof(unsigned)*file_count);
+    fport->start_data_list = (unsigned*)
+			     pj_pool_alloc(pool, sizeof(unsigned)*file_count);
     if (!fport->start_data_list) {
 	return PJ_ENOMEM;
@@ -294,5 +297,6 @@
 
     /* Create file position list */
-    fport->fpos_list = pj_pool_alloc(pool, sizeof(pj_off_t)*file_count);
+    fport->fpos_list = (pj_off_t*)
+		       pj_pool_alloc(pool, sizeof(pj_off_t)*file_count);
     if (!fport->fpos_list) {
 	return PJ_ENOMEM;
@@ -306,5 +310,5 @@
 
     /* Create buffer. */
-    fport->buf = pj_pool_alloc(pool, fport->bufsize);
+    fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize);
     if (!fport->buf) {
 	return PJ_ENOMEM;
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c	(revision 1265)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c	(revision 1266)
@@ -84,5 +84,5 @@
 
     /* Create file port instance. */
-    fport = pj_pool_zalloc(pool, sizeof(struct file_port));
+    fport = PJ_POOL_ZALLOC_T(pool, struct file_port);
     PJ_ASSERT_RETURN(fport != NULL, PJ_ENOMEM);
 
@@ -150,5 +150,5 @@
 
     /* Allocate buffer and set initial write position */
-    fport->buf = pj_pool_alloc(pool, fport->bufsize);
+    fport->buf = (char*) pj_pool_alloc(pool, fport->bufsize);
     if (fport->buf == NULL) {
 	pj_file_close(fport->fd);
Index: pjproject/trunk/pjnath/src/pjnath/stun_msg.c
===================================================================
--- pjproject/trunk/pjnath/src/pjnath/stun_msg.c	(revision 1265)
+++ pjproject/trunk/pjnath/src/pjnath/stun_msg.c	(revision 1266)
@@ -18,4 +18,5 @@
  */
 #include <pjnath/stun_msg.h>
+#include <pjnath/stun_auth.h>
 #include <pjnath/errno.h>
 #include <pjlib-util/crc32.h>
Index: pjproject/trunk/pjnath/src/pjstun-client/client_main.c
===================================================================
--- pjproject/trunk/pjnath/src/pjstun-client/client_main.c	(revision 1265)
+++ pjproject/trunk/pjnath/src/pjstun-client/client_main.c	(revision 1266)
@@ -28,5 +28,5 @@
 #define REQ_TRANSPORT	-1		    /* 0: udp, 1: tcp, -1: disable */
 #define REQ_PORT_PROPS	-1		    /* -1 to disable */
-#define REQ_IP		NULL		    /* IP address string */
+#define REQ_IP		0		    /* IP address string */
 
 //#define OPTIONS		PJ_STUN_NO_AUTHENTICATE
@@ -355,5 +355,5 @@
 	}
 
-	if (REQ_IP != NULL) {
+	if (REQ_IP) {
 	    pj_sockaddr_in addr;
 	    pj_str_t tmp;
Index: pjproject/trunk/pjnath/src/pjstun-srv-test/server.c
===================================================================
--- pjproject/trunk/pjnath/src/pjstun-srv-test/server.c	(revision 1265)
+++ pjproject/trunk/pjnath/src/pjstun-srv-test/server.c	(revision 1266)
@@ -88,5 +88,6 @@
 
     srv->si.thread_cnt = thread_cnt;
-    srv->threads = pj_pool_calloc(pool, thread_cnt, sizeof(pj_thread_t*));
+    srv->threads = (pj_thread_t**)
+		   pj_pool_calloc(pool, thread_cnt, sizeof(pj_thread_t*));
     for (i=0; i<thread_cnt; ++i) {
 	status = pj_thread_create(pool, "worker%p", &worker_thread,
Index: pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
===================================================================
--- pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c	(revision 1265)
+++ pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c	(revision 1266)
@@ -286,5 +286,5 @@
 
     if (client) {
-	status = pj_stun_msg_check(pkt, pkt_size, flags);
+	status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, flags);
 
 	if (status == PJ_SUCCESS) {
@@ -1355,5 +1355,5 @@
     PJ_UNUSED_ARG(op_key);
 
-    client = pj_ioqueue_get_user_data(key);
+    client = (struct turn_client*) pj_ioqueue_get_user_data(key);
     
     /* Lock client */
Index: pjproject/trunk/pjnath/src/pjstun-srv-test/usage.c
===================================================================
--- pjproject/trunk/pjnath/src/pjstun-srv-test/usage.c	(revision 1265)
+++ pjproject/trunk/pjnath/src/pjstun-srv-test/usage.c	(revision 1266)
@@ -100,6 +100,6 @@
 
     usage->worker_cnt = si->thread_cnt;
-    usage->worker = pj_pool_calloc(pool, si->thread_cnt, 
-				   sizeof(struct worker));
+    usage->worker = (struct worker*) pj_pool_calloc(pool, si->thread_cnt, 
+				   		    sizeof(struct worker));
     for (i=0; i<si->thread_cnt; ++i) {
 	pj_ioqueue_op_key_init(&usage->worker[i].read_key, 
@@ -109,5 +109,6 @@
 
     usage->send_count = usage->worker_cnt * 2;
-    usage->send_key = pj_pool_calloc(pool, usage->send_count, 
+    usage->send_key = (pj_ioqueue_op_key_t*)
+		      pj_pool_calloc(pool, usage->send_count, 
 				     sizeof(pj_ioqueue_op_key_t));
     for (i=0; i<usage->send_count; ++i) {
@@ -241,5 +242,5 @@
 {
     enum { MAX_LOOP = 10 };
-    pj_stun_usage *usage = pj_ioqueue_get_user_data(key);
+    pj_stun_usage *usage = (pj_stun_usage*) pj_ioqueue_get_user_data(key);
     struct worker *worker = (struct worker*) op_key;
     unsigned count;
Index: pjproject/trunk/pjsip/build/Makefile
===================================================================
--- pjproject/trunk/pjsip/build/Makefile	(revision 1265)
+++ pjproject/trunk/pjsip/build/Makefile	(revision 1266)
@@ -90,5 +90,5 @@
 		    tsx_uas_test.o txdata_test.o uri_test.o
 export TEST_CFLAGS += $(_CFLAGS)
-export TEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS)
+export TEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
 export TEST_EXE := ../bin/pjsip-test-$(TARGET_NAME)$(HOST_EXE)
 
Index: pjproject/trunk/pjsip/src/pjsip-simple/presence.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip-simple/presence.c	(revision 1266)
@@ -58,10 +58,10 @@
  * Presence message body type.
  */
-typedef enum content_type
+typedef enum content_type_e
 {
     CONTENT_TYPE_NONE,
     CONTENT_TYPE_PIDF,
     CONTENT_TYPE_XPIDF,
-} content_type;
+} content_type_e;
 
 /*
@@ -72,5 +72,5 @@
     pjsip_evsub		*sub;		/**< Event subscribtion record.	    */
     pjsip_dialog	*dlg;		/**< The dialog.		    */
-    content_type	 content_type;	/**< Content-Type.		    */
+    content_type_e	 content_type;	/**< Content-Type.		    */
     pjsip_pres_status	 status;	/**< Presence status.		    */
     pjsip_pres_status	 tmp_status;	/**< Temp, before NOTIFY is answred.*/
@@ -227,5 +227,5 @@
     pjsip_expires_hdr *expires_hdr;
     unsigned expires;
-    content_type content_type = CONTENT_TYPE_NONE;
+    content_type_e content_type = CONTENT_TYPE_NONE;
     pjsip_evsub *sub;
     pjsip_pres *pres;
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 1266)
@@ -230,5 +230,5 @@
 	return PJ_FALSE;
 
-    inv = dlg->mod_data[mod_inv.mod.id];
+    inv = (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id];
 
     /* Report to dialog that we handle INVITE, CANCEL, BYE, ACK. 
@@ -412,5 +412,5 @@
 PJ_DEF(pjsip_inv_session*) pjsip_dlg_get_inv_session(pjsip_dialog *dlg)
 {
-    return dlg->mod_data[mod_inv.mod.id];
+    return (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id];
 }
 
@@ -453,5 +453,5 @@
 
     /* Create the session */
-    inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));
+    inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session);
     pj_assert(inv != NULL);
 
@@ -578,6 +578,6 @@
 
 	/* Parse and validate SDP */
-	status = pjmedia_sdp_parse(rdata->tp_info.pool, body->data, body->len,
-				   &sdp);
+	status = pjmedia_sdp_parse(rdata->tp_info.pool, 
+				   (char*)body->data, body->len, &sdp);
 	if (status == PJ_SUCCESS)
 	    status = pjmedia_sdp_validate(sdp);
@@ -651,5 +651,5 @@
      * implicitly by sending this INVITE.
      */
-    allow = pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);
+    allow = (pjsip_allow_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);
     if (allow) {
 	unsigned i;
@@ -669,5 +669,6 @@
 
     /* Check Supported header */
-    sup_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL);
+    sup_hdr = (pjsip_supported_hdr*)
+	      pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL);
     if (sup_hdr) {
 	unsigned i;
@@ -684,5 +685,6 @@
 
     /* Check Require header */
-    req_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL);
+    req_hdr = (pjsip_require_hdr*)
+	      pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL);
     if (req_hdr) {
 	unsigned i;
@@ -743,5 +745,6 @@
 		pj_assert(h);
 		if (h) {
-		    sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h);
+		    sup_hdr = (pjsip_supported_hdr*)
+			      pjsip_hdr_clone(rdata->tp_info.pool, h);
 		    pj_list_push_back(&res_hdr_list, sup_hdr);
 		}
@@ -783,5 +786,6 @@
 	    pj_assert(h);
 	    if (h) {
-		sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h);
+		sup_hdr = (pjsip_supported_hdr*)
+			  pjsip_hdr_clone(rdata->tp_info.pool, h);
 		pj_list_push_back(&res_hdr_list, sup_hdr);
 	    }
@@ -815,5 +819,5 @@
 	    pjsip_hdr *cloned;
 
-	    cloned = pjsip_hdr_clone(tdata->pool, h);
+	    cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h);
 	    PJ_ASSERT_RETURN(cloned, PJ_ENOMEM);
 
@@ -875,5 +879,5 @@
 
     /* Create the session */
-    inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));
+    inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session);
     pj_assert(inv != NULL);
 
@@ -894,5 +898,5 @@
 
 	/* Parse and validate SDP */
-	status = pjmedia_sdp_parse(inv->pool, body->data, body->len,
+	status = pjmedia_sdp_parse(inv->pool, (char*)body->data, body->len,
 				   &rem_sdp);
 	if (status == PJ_SUCCESS)
@@ -936,6 +940,5 @@
 
     /* Attach our data to the transaction. */
-    tsx_inv_data = pj_pool_zalloc(inv->invite_tsx->pool, 
-				  sizeof(struct tsx_inv_data));
+    tsx_inv_data = PJ_POOL_ZALLOC_T(inv->invite_tsx->pool, struct tsx_inv_data);
     tsx_inv_data->inv = inv;
     inv->invite_tsx->mod_data[mod_inv.mod.id] = tsx_inv_data;
@@ -998,10 +1001,10 @@
 {
     PJ_UNUSED_ARG(len);
-    return pjmedia_sdp_session_clone(pool, data);
+    return pjmedia_sdp_session_clone(pool, (const pjmedia_sdp_session*)data);
 }
 
 static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len)
 {
-    return pjmedia_sdp_print(body->data, buf, len);
+    return pjmedia_sdp_print((const pjmedia_sdp_session*)body->data, buf, len);
 }
 
@@ -1015,5 +1018,5 @@
     pjsip_msg_body *body;
 
-    body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
+    body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
     PJ_ASSERT_RETURN(body != NULL, PJ_ENOMEM);
 
@@ -1083,5 +1086,5 @@
 
 	while (hdr != &inv->dlg->inv_hdr) {
-	    pjsip_msg_add_hdr(tdata->msg,
+	    pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
 			      pjsip_hdr_shallow_clone(tdata->pool, hdr));
 	    hdr = hdr->next;
@@ -1118,5 +1121,5 @@
     hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL);
     if (hdr) {
-	pjsip_msg_add_hdr(tdata->msg,
+	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
 			  pjsip_hdr_shallow_clone(tdata->pool, hdr));
     }
@@ -1125,5 +1128,5 @@
     hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL);
     if (hdr) {
-	pjsip_msg_add_hdr(tdata->msg,
+	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
 			  pjsip_hdr_shallow_clone(tdata->pool, hdr));
     }
@@ -1178,7 +1181,7 @@
 
     /* Get/attach invite session's transaction data */
-    tsx_inv_data = tsx->mod_data[mod_inv.mod.id];
+    tsx_inv_data = (struct tsx_inv_data*) tsx->mod_data[mod_inv.mod.id];
     if (tsx_inv_data == NULL) {
-	tsx_inv_data = pj_pool_zalloc(tsx->pool, sizeof(struct tsx_inv_data));
+	tsx_inv_data = PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data);
 	tsx_inv_data->inv = inv;
 	tsx->mod_data[mod_inv.mod.id] = tsx_inv_data;
@@ -1208,5 +1211,6 @@
     /* Parse the SDP body. */
 
-    status = pjmedia_sdp_parse(rdata->tp_info.pool, msg->body->data,
+    status = pjmedia_sdp_parse(rdata->tp_info.pool, 
+			       (char*)msg->body->data,
 			       msg->body->len, &sdp);
     if (status != PJ_SUCCESS) {
@@ -1588,5 +1592,6 @@
 
 	pj_strdup_with_null(inv->dlg->pool, &tmp, new_contact);
-	contact_hdr = pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 
+	contact_hdr = (pjsip_contact_hdr*)
+		      pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT, 
 				      tmp.ptr, tmp.slen, NULL);
 	if (!contact_hdr) {
@@ -1685,5 +1690,5 @@
 	pjsip_dlg_inc_lock(inv->dlg);
 
-	tsx_inv_data = pj_pool_zalloc(inv->pool, sizeof(struct tsx_inv_data));
+	tsx_inv_data = PJ_POOL_ZALLOC_T(inv->pool, struct tsx_inv_data);
 	tsx_inv_data->inv = inv;
 
@@ -1701,5 +1706,5 @@
 	 * request.
 	 */
-	PJ_ASSERT_RETURN((cseq=pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL
+	PJ_ASSERT_RETURN((cseq=(pjsip_cseq_hdr*)pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL
 			  && (cseq->cseq == inv->invite_tsx->cseq),
 			 PJ_EINVALIDOP);
@@ -2416,5 +2421,5 @@
 						    NULL);
 		if (accept) {
-		    pjsip_msg_add_hdr(tdata->msg,
+		    pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
 				      pjsip_hdr_clone(tdata->pool, accept));
 		}
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c	(revision 1266)
@@ -104,5 +104,5 @@
     PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM);
 
-    regc = pj_pool_zalloc(pool, sizeof(struct pjsip_regc));
+    regc = PJ_POOL_ZALLOC_T(pool, pjsip_regc);
 
     regc->pool = pool;
@@ -110,5 +110,5 @@
     regc->token = token;
     regc->cb = cb;
-    regc->contact_buf = pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE);
+    regc->contact_buf = (char*)pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE);
     regc->expires = PJSIP_REGC_EXPIRATION_NOT_SPECIFIED;
 
@@ -387,5 +387,6 @@
 	const pjsip_route_hdr *route;
 
-	route_pos = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
+	route_pos = (pjsip_hdr*)
+		    pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
 	if (!route_pos)
 	    route_pos = &tdata->msg->hdr;
@@ -393,5 +394,6 @@
 	route = regc->route_set.next;
 	while (route != &regc->route_set) {
-	    pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, route);
+	    pjsip_hdr *new_hdr = (pjsip_hdr*)
+				 pjsip_hdr_shallow_clone(tdata->pool, route);
 	    pj_list_insert_after(route_pos, new_hdr);
 	    route_pos = new_hdr;
@@ -406,5 +408,6 @@
 	hdr = regc->hdr_list.next;
 	while (hdr != &regc->hdr_list) {
-	    pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, hdr);
+	    pjsip_hdr *new_hdr = (pjsip_hdr*)
+				 pjsip_hdr_shallow_clone(tdata->pool, hdr);
 	    pjsip_msg_add_hdr(tdata->msg, new_hdr);
 	    hdr = hdr->next;
@@ -433,8 +436,10 @@
     /* Add Contact header. */
     msg = tdata->msg;
-    pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool, 
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+			   pjsip_hdr_shallow_clone(tdata->pool, 
 						   regc->contact_hdr));
     if (regc->expires_hdr)
-	pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool,
+	pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+			       pjsip_hdr_shallow_clone(tdata->pool,
 						       regc->expires_hdr));
 
@@ -471,5 +476,6 @@
 
     msg = tdata->msg;
-    pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool, 
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+			   pjsip_hdr_shallow_clone(tdata->pool, 
 						   regc->contact_hdr));
     pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_expires_hdr);
@@ -554,5 +560,5 @@
 				   struct pj_timer_entry *entry)
 {
-    pjsip_regc *regc = entry->user_data;
+    pjsip_regc *regc = (pjsip_regc*) entry->user_data;
     pjsip_tx_data *tdata;
     pj_status_t status;
@@ -588,5 +594,5 @@
 {
     pj_status_t status;
-    pjsip_regc *regc = token;
+    pjsip_regc *regc = (pjsip_regc*) token;
     pjsip_transaction *tsx = event->body.tsx_state.tsx;
     
@@ -654,5 +660,6 @@
 	    rdata = event->body.tsx_state.src.rdata;
 	    msg = rdata->msg_info.msg;
-	    hdr = pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL);
+	    hdr = (pjsip_contact_hdr*)
+		  pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL);
 	    while (hdr) {
 		contact[contact_cnt++] = hdr;
@@ -660,8 +667,10 @@
 		if (hdr == (void*)&msg->hdr)
 		    break;
-		hdr = pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr);
+		hdr = (pjsip_contact_hdr*)
+		      pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr);
 	    }
 
-	    expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL);
+	    expires = (pjsip_expires_hdr*)
+		      pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL);
 
 	    if (expires)
@@ -741,5 +750,6 @@
     /* Increment CSeq */
     cseq = ++regc->cseq_hdr->cseq;
-    cseq_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
+    cseq_hdr = (pjsip_cseq_hdr*)
+	       pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
     cseq_hdr->cseq = cseq;
 
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_replaces.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_replaces.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_replaces.c	(revision 1266)
@@ -53,5 +53,5 @@
 PJ_DEF(pjsip_replaces_hdr*) pjsip_replaces_hdr_create(pj_pool_t *pool)
 {
-    pjsip_replaces_hdr *hdr = pj_pool_zalloc(pool, sizeof(*hdr));
+    pjsip_replaces_hdr *hdr = PJ_POOL_ZALLOC_T(pool, pjsip_replaces_hdr);
     hdr->type = PJSIP_H_OTHER;
     hdr->name.ptr = "Replaces";
@@ -109,5 +109,5 @@
 			    const pjsip_replaces_hdr *rhs )
 {
-    pjsip_replaces_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_replaces_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_replaces_hdr);
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -145,5 +145,5 @@
 	    hdr->early_only = PJ_TRUE;
 	} else {
-	    pjsip_param *param = pj_pool_alloc(ctx->pool, sizeof(pjsip_param));
+	    pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param);
 	    param->name = pname;
 	    param->value = pvalue;
@@ -319,5 +319,5 @@
 		pjsip_hdr *cloned;
 
-		cloned = pjsip_hdr_clone(tdata->pool, h);
+		cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h);
 		PJ_ASSERT_RETURN(cloned, PJ_ENOMEM);
 
Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c	(revision 1266)
@@ -180,5 +180,5 @@
 
     /* Create xfer session */
-    xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));
+    xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer);
     xfer->dlg = dlg;
     xfer->sub = sub;
@@ -249,5 +249,5 @@
 
     /* Create server xfer subscription */
-    xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));
+    xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer);
     xfer->dlg = dlg;
     xfer->sub = sub;
@@ -287,5 +287,5 @@
 
     /* Get the xfer object. */
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
 
@@ -374,5 +374,5 @@
 
     /* Get the xfer object. */
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
 
@@ -399,5 +399,5 @@
 
     /* Create sipfrag content. */
-    body = pj_pool_alloc(tdata->pool, 128);
+    body = (char*) pj_pool_alloc(tdata->pool, 128);
     bodylen = pj_ansi_snprintf(body, 128, "SIP/2.0 %u %.*s",
 			       xfer_st_code,
@@ -410,5 +410,5 @@
 
     /* Create SIP message body. */
-    msg_body = pj_pool_zalloc(tdata->pool, sizeof(pjsip_msg_body));
+    msg_body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body);
     msg_body->content_type.type = STR_MESSAGE;
     msg_body->content_type.subtype = STR_SIPFRAG;
@@ -448,5 +448,5 @@
 
     /* Get the xfer object. */
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
 
@@ -481,5 +481,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
@@ -497,5 +497,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
@@ -516,5 +516,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
@@ -557,5 +557,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
@@ -572,5 +572,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
@@ -595,5 +595,5 @@
     pjsip_xfer *xfer;
 
-    xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+    xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
     PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 1266)
@@ -168,5 +168,5 @@
     pj_status_t status = PJ_SUCCESS;
     pjsip_module *m;
-    int i;
+    unsigned i;
 
     pj_rwmutex_lock_write(endpt->mod_mutex);
@@ -248,5 +248,6 @@
 
     /* Make sure the module exists in the array. */
-    PJ_ASSERT_ON_FAIL(	mod->id>=0 && mod->id<PJ_ARRAY_SIZE(endpt->modules) &&
+    PJ_ASSERT_ON_FAIL(	mod->id>=0 && 
+			mod->id<(int)PJ_ARRAY_SIZE(endpt->modules) &&
 			endpt->modules[mod->id] == mod,
 			{status = PJ_ENOTFOUND; goto on_return;});
@@ -1080,5 +1081,5 @@
 
     len = pj_ansi_strlen(format);
-    if (len < sizeof(newformat)-30) {
+    if (len < (int)sizeof(newformat)-30) {
 	pj_str_t errstr;
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 1266)
@@ -98,5 +98,5 @@
 static int init_status_phrase()
 {
-    int i;
+    unsigned i;
     pj_str_t default_reason_phrase = { "Default status message", 22};
 
@@ -195,5 +195,5 @@
 				  pj_str_t *str)
 {
-    int i;
+    unsigned i;
     for (i=0; i<PJ_ARRAY_SIZE(method_names); ++i) {
 	if (pj_memcmp(str->ptr, method_names[i]->ptr, str->slen)==0 || 
@@ -516,5 +516,6 @@
     }
 
-    return (code>=100 && code<(sizeof(status_phrase)/sizeof(status_phrase[0]))) ? 
+    return (code>=100 && 
+	    code<(int)(sizeof(status_phrase)/sizeof(status_phrase[0]))) ? 
 	&status_phrase[code] : &status_phrase[0];
 }
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 1266)
@@ -98,5 +98,5 @@
  * Transport names.
  */
-struct
+struct transport_names_t
 {
     pjsip_transport_type_e type;
@@ -217,5 +217,5 @@
 
     /* Check that argument is valid. */
-    PJ_ASSERT_RETURN(type < PJ_ARRAY_SIZE(transport_names), 0);
+    PJ_ASSERT_RETURN((unsigned)type < PJ_ARRAY_SIZE(transport_names), 0);
 
     /* Return transport flag. */
@@ -236,5 +236,5 @@
 
     /* Check that argument is valid. */
-    PJ_ASSERT_RETURN(type < PJ_ARRAY_SIZE(transport_names), 5060);
+    PJ_ASSERT_RETURN((unsigned)type < PJ_ARRAY_SIZE(transport_names), 5060);
 
     /* Return the port. */
@@ -254,5 +254,5 @@
 
     /* Check that argument is valid. */
-    PJ_ASSERT_RETURN(type < PJ_ARRAY_SIZE(transport_names), "Unknown");
+    PJ_ASSERT_RETURN((unsigned)type<PJ_ARRAY_SIZE(transport_names), "Unknown");
 
     /* Return the port. */
@@ -415,5 +415,5 @@
     }
 
-    if (len < 1 || len >= sizeof(info_buf)) {
+    if (len < 1 || len >= (int)sizeof(info_buf)) {
 	return (char*)obj_name;
     }
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c	(revision 1266)
@@ -260,5 +260,5 @@
 {
     enum { M = 48 };
-    host_port->host.ptr = pj_pool_alloc(pool, M);
+    host_port->host.ptr = (char*)pj_pool_alloc(pool, M);
     host_port->host.slen = pj_ansi_snprintf( host_port->host.ptr, M, "%s", 
 					    pj_inet_ntoa(addr->sin_addr));
@@ -270,5 +270,5 @@
 static int password_cb(char *buf, int num, int rwflag, void *user_data)
 {
-    struct tls_listener *lis = user_data;
+    struct tls_listener *lis = (struct tls_listener*) user_data;
 
     PJ_UNUSED_ARG(rwflag);
@@ -905,5 +905,5 @@
 
 
-    listener = pj_pool_zalloc(pool, sizeof(struct tls_listener));
+    listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener);
     listener->factory.pool = pool;
     listener->factory.type = PJSIP_TRANSPORT_TLS;
@@ -1037,6 +1037,5 @@
 	}
 
-	listener->accept_op[i] = pj_pool_zalloc(pool, 
-						sizeof(struct pending_accept));
+	listener->accept_op[i] = PJ_POOL_ZALLOC_T(pool, struct pending_accept);
 	pj_ioqueue_op_key_init(&listener->accept_op[i]->op_key, 
 				sizeof(listener->accept_op[i]->op_key));
@@ -1192,5 +1191,5 @@
      * Create and initialize basic transport structure.
      */
-    tls = pj_pool_zalloc(pool, sizeof(*tls));
+    tls = PJ_POOL_ZALLOC_T(pool, struct tls_transport);
     tls->sock = sock;
     tls->is_server = is_server;
@@ -1218,5 +1217,5 @@
     tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS);
 
-    tls->base.info = pj_pool_alloc(pool, 64);
+    tls->base.info = (char*) pj_pool_alloc(pool, 64);
     pj_ansi_snprintf(tls->base.info, 64, "TLS to %s:%d",
 		     pj_inet_ntoa(remote->sin_addr), 
@@ -1636,5 +1635,5 @@
     int err_cnt = 0;
 
-    listener = pj_ioqueue_get_user_data(key);
+    listener = (struct tls_listener*) pj_ioqueue_get_user_data(key);
     accept_op = (struct pending_accept*) op_key;
 
@@ -1695,5 +1694,5 @@
 	    pool = pjsip_endpt_create_pool(listener->endpt, "tlss%p", 
 					   POOL_TP_INIT, POOL_TP_INC);
-	    new_op = pj_pool_zalloc(pool, sizeof(struct pending_accept));
+	    new_op = PJ_POOL_ZALLOC_T(pool, struct pending_accept);
 	    new_op->pool = pool;
 	    new_op->listener = listener;
@@ -1757,7 +1756,8 @@
                               pj_ssize_t bytes_sent)
 {
-    struct tls_transport *tls = pj_ioqueue_get_user_data(key);
+    struct tls_transport *tls;
     pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key;
 
+    tls = (struct tls_transport*) pj_ioqueue_get_user_data(key);
     tdata_op_key->tdata = NULL;
 
@@ -1790,6 +1790,5 @@
     struct delayed_tdata *delayed_tdata;
 
-    delayed_tdata = pj_pool_alloc(tdata->pool, 
-				  sizeof(*delayed_tdata));
+    delayed_tdata = PJ_POOL_ALLOC_T(tdata->pool, struct delayed_tdata);
     delayed_tdata->tdata_op_key = &tdata->op_key;
     pj_list_push_back(&tls->delayed_list, delayed_tdata);
@@ -2098,5 +2097,5 @@
     int addrlen;
 
-    tls = pj_ioqueue_get_user_data(key);
+    tls = (struct tls_transport*) pj_ioqueue_get_user_data(key);
 
     /* Check connect() status */
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 1266)
@@ -38,5 +38,5 @@
 PJ_DEF(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id)
 {
-    return acc_id>=0 && acc_id<PJ_ARRAY_SIZE(pjsua_var.acc) &&
+    return acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc) &&
 	   pjsua_var.acc[acc_id].valid;
 }
@@ -186,5 +186,6 @@
 	pj_strdup_with_null(pjsua_var.pool, &tmp, 
 			    &pjsua_var.ua_cfg.outbound_proxy[i]);
-	r = pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL);
+	r = (pjsip_route_hdr*)
+	    pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL);
 	if (r == NULL) {
 	    pjsua_perror(THIS_FILE, "Invalid outbound proxy URI",
@@ -201,5 +202,6 @@
 
 	pj_strdup_with_null(pjsua_var.pool, &tmp, &acc_cfg->proxy[i]);
-	r = pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL);
+	r = (pjsip_route_hdr*)
+	    pjsip_parse_hdr(pjsua_var.pool, &hname, tmp.ptr, tmp.slen, NULL);
 	if (r == NULL) {
 	    pjsua_perror(THIS_FILE, "Invalid URI in account route set",
@@ -323,5 +325,6 @@
 
     /* ID must be valid */
-    PJ_ASSERT_RETURN(tid>=0 && tid<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
+    PJ_ASSERT_RETURN(tid>=0 && tid<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 
+		     PJ_EINVAL);
 
     /* Transport must be valid */
@@ -434,5 +437,5 @@
 {
 
-    pjsua_acc *acc = param->token;
+    pjsua_acc *acc = (pjsua_acc*) param->token;
 
     PJSUA_LOCK();
@@ -817,5 +820,5 @@
     }
 
-    sip_uri = pjsip_uri_get_uri(uri);
+    sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(uri);
 
     /* Find matching domain AND port */
@@ -955,5 +958,6 @@
     r = acc->route_set.next;
     while (r != &acc->route_set) {
-	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, r));
+	pjsip_msg_add_hdr(tdata->msg, 
+			  (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, r));
 	r = r->next;
     }
@@ -1037,5 +1041,5 @@
 
     /* Create the contact header */
-    contact->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
+    contact->ptr = (char*)pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
     contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
 				     "%.*s%s<%s:%.*s%s%.*s:%d;transport=%s>",
@@ -1098,8 +1102,9 @@
 
 	/* Otherwise URI is Contact URI */
-	h_contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+	h_contact = (pjsip_contact_hdr*)
+		    pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
 				       NULL);
 	if (h_contact)
-	    uri = pjsip_uri_get_uri(h_contact->uri);
+	    uri = (pjsip_uri*) pjsip_uri_get_uri(h_contact->uri);
 	
 
@@ -1108,5 +1113,5 @@
 	 */
 	if (uri == NULL)
-	    uri = pjsip_uri_get_uri(rdata->msg_info.from->uri);
+	    uri = (pjsip_uri*) pjsip_uri_get_uri(rdata->msg_info.from->uri);
 
 
@@ -1143,5 +1148,5 @@
 
     /* Create the contact header */
-    contact->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
+    contact->ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
     contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
 				     "%.*s%s<%s:%.*s%s%.*s:%d;transport=%s>",
@@ -1170,5 +1175,5 @@
     acc = &pjsua_var.acc[acc_id];
 
-    PJ_ASSERT_RETURN(tp_id >= 0 && tp_id < PJ_ARRAY_SIZE(pjsua_var.tpdata),
+    PJ_ASSERT_RETURN(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata),
 		     PJ_EINVAL);
     
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1265)
+++ 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 */
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1266)
@@ -165,5 +165,6 @@
     cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_ALLOW, NULL);
     if (cap_hdr) {
-	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr));
+	pjsip_msg_add_hdr(tdata->msg, 
+			  (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr));
     }
 
@@ -171,5 +172,6 @@
     cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_ACCEPT, NULL);
     if (cap_hdr) {
-	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr));
+	pjsip_msg_add_hdr(tdata->msg, 
+			  (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr));
     }
 
@@ -177,5 +179,6 @@
     cap_hdr = pjsip_endpt_get_capability(pjsua_var.endpt, PJSIP_H_SUPPORTED, NULL);
     if (cap_hdr) {
-	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr));
+	pjsip_msg_add_hdr(tdata->msg, 
+			  (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr));
     }
 
@@ -183,5 +186,6 @@
     cap_hdr = pjsip_evsub_get_allow_events_hdr(NULL);
     if (cap_hdr) {
-	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_clone(tdata->pool, cap_hdr));
+	pjsip_msg_add_hdr(tdata->msg, 
+			  (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, cap_hdr));
     }
 
@@ -1456,5 +1460,6 @@
 
     /* Make sure id is in range. */
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 
+		     PJ_EINVAL);
 
     /* Make sure that transport exists */
@@ -1524,5 +1529,6 @@
 {
     /* Make sure id is in range. */
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 
+		     PJ_EINVAL);
 
     /* Make sure that transport exists */
@@ -1547,5 +1553,6 @@
 
     /* Make sure id is in range. */
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.tpdata), 
+		     PJ_EINVAL);
 
     /* Make sure that transport exists */
@@ -1640,5 +1647,5 @@
 	pjsip_hdr *new_hdr;
 
-	new_hdr = pjsip_hdr_clone(tdata->pool, hdr);
+	new_hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr);
 	pjsip_msg_add_hdr(tdata->msg, new_hdr);
 
@@ -1672,5 +1679,5 @@
 	pjsip_route_hdr *new_r;
 
-	new_r = pjsip_hdr_clone(tdata->pool, r);
+	new_r = (pjsip_route_hdr*) pjsip_hdr_clone(tdata->pool, r);
 	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)new_r);
 
@@ -1719,5 +1726,5 @@
 	return;
 
-    pj_assert(tp_id >= 0 && tp_id < PJ_ARRAY_SIZE(pjsua_var.tpdata));
+    pj_assert(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata));
     tpdata = &pjsua_var.tpdata[tp_id];
 
@@ -1749,5 +1756,5 @@
     if (!pool) return -1;
 
-    url = pj_pool_alloc(pool, len+1);
+    url = (char*) pj_pool_alloc(pool, len+1);
     pj_ansi_strcpy(url, c_url);
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 1266)
@@ -113,5 +113,6 @@
      * "text/plain".
      */
-    ctype = pjsip_msg_find_hdr(msg, PJSIP_H_CONTENT_TYPE, NULL);
+    ctype = (pjsip_ctype_hdr*)
+	    pjsip_msg_find_hdr(msg, PJSIP_H_CONTENT_TYPE, NULL);
     if (msg->body == NULL || ctype == NULL || 
 	!acceptable_message(&ctype->media)) 
@@ -143,9 +144,10 @@
 
     /* Build remote contact */
-    contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+    contact_hdr = (pjsip_contact_hdr*)
+		  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
 				     NULL);
     if (contact_hdr) {
-	contact.ptr = pj_pool_alloc(rdata->tp_info.pool, 
-				    PJSIP_MAX_URL_SIZE);
+	contact.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, 
+				    	    PJSIP_MAX_URL_SIZE);
 	contact.slen = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR,
 				       contact_hdr->uri, contact.ptr,
@@ -163,5 +165,5 @@
 	
 	/* Save text body */
-	text_body.ptr = rdata->msg_info.msg->body->data;
+	text_body.ptr = (char*) rdata->msg_info.msg->body->data;
 	text_body.slen = rdata->msg_info.msg->body->len;
 
@@ -176,7 +178,7 @@
 	pj_bool_t is_typing;
 
-	status = pjsip_iscomposing_parse( rdata->tp_info.pool, body->data,
-					  body->len, &is_typing, NULL, NULL,
-					  NULL );
+	status = pjsip_iscomposing_parse(rdata->tp_info.pool, (char*)body->data,
+					 body->len, &is_typing, NULL, NULL,
+					 NULL );
 	if (status != PJ_SUCCESS) {
 	    pjsua_perror(THIS_FILE, "Invalid MESSAGE body", status);
@@ -241,6 +243,7 @@
      * not available, then use From header.
      */
-    from.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
-    contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg,
+    from.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
+    contact_hdr = (pjsip_contact_hdr*)
+		  pjsip_msg_find_hdr(rdata->msg_info.msg,
 				     PJSIP_H_CONTACT, NULL);
     if (contact_hdr) {
@@ -258,5 +261,5 @@
 
     /* Build the To text. */
-    to.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
+    to.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
     to.slen = pjsip_uri_print( PJSIP_URI_IN_FROMTO_HDR, 
 			       rdata->msg_info.to->uri,
@@ -276,5 +279,5 @@
 static void im_callback(void *token, pjsip_event *e)
 {
-    pjsua_im_data *im_data = token;
+    pjsua_im_data *im_data = (pjsua_im_data*) token;
 
     if (e->type == PJSIP_EVENT_TSX_STATE) {
@@ -353,5 +356,5 @@
 static void typing_callback(void *token, pjsip_event *e)
 {
-    pjsua_im_data *im_data = token;
+    pjsua_im_data *im_data = (pjsua_im_data*) token;
 
     if (e->type == PJSIP_EVENT_TSX_STATE) {
@@ -464,5 +467,5 @@
      * application on the callback
      */
-    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 = acc_id;
     im_data->call_id = PJSUA_INVALID_ID;
@@ -571,5 +574,5 @@
 
     /* Create data to reauthenticate */
-    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 = acc_id;
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1266)
@@ -1238,5 +1238,5 @@
 PJ_DEF(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL);
 
@@ -1250,5 +1250,5 @@
 					   pjmedia_port **p_port)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL);
     PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL);
@@ -1265,5 +1265,5 @@
 					  pj_uint32_t samples)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.player[id].type == 0, PJ_EINVAL);
@@ -1279,5 +1279,5 @@
 PJ_DEF(pj_status_t) pjsua_player_destroy(pjsua_player_id id)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL);
 
@@ -1415,5 +1415,6 @@
 PJ_DEF(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 
+		     PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL);
 
@@ -1427,5 +1428,6 @@
 					     pjmedia_port **p_port)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 
+		     PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL);
     PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL);
@@ -1440,5 +1442,6 @@
 PJ_DEF(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id)
 {
-    PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL);
+    PJ_ASSERT_RETURN(id>=0 && id<(int)PJ_ARRAY_SIZE(pjsua_var.recorder), 
+		     PJ_EINVAL);
     PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL);
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 1266)
@@ -38,5 +38,5 @@
 PJ_DEF(pj_bool_t) pjsua_buddy_is_valid(pjsua_buddy_id buddy_id)
 {
-    return buddy_id>=0 && buddy_id<PJ_ARRAY_SIZE(pjsua_var.buddy) &&
+    return buddy_id>=0 && buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy) &&
 	   pjsua_var.buddy[buddy_id].uri.slen != 0;
 }
@@ -153,5 +153,5 @@
 
     /* Find empty slot */
-    for (index=0; index<PJ_ARRAY_SIZE(pjsua_var.buddy); ++index) {
+    for (index=0; index<(int)PJ_ARRAY_SIZE(pjsua_var.buddy); ++index) {
 	if (pjsua_var.buddy[index].uri.slen == 0)
 	    break;
@@ -424,5 +424,5 @@
     PJSUA_LOCK();
 
-    uapres = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+    uapres = (pjsua_srv_pres*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (uapres) {
 	PJ_LOG(3,(THIS_FILE, "Server subscription to %s is %s",
@@ -517,7 +517,7 @@
 
     /* Attach our data to the subscription: */
-    uapres = pj_pool_alloc(dlg->pool, sizeof(pjsua_srv_pres));
+    uapres = PJ_POOL_ALLOC_T(dlg->pool, pjsua_srv_pres);
     uapres->sub = sub;
-    uapres->remote = pj_pool_alloc(dlg->pool, PJSIP_MAX_URL_SIZE);
+    uapres->remote = (char*) pj_pool_alloc(dlg->pool, PJSIP_MAX_URL_SIZE);
     status = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->remote.info->uri,
 			     uapres->remote, PJSIP_MAX_URL_SIZE);
@@ -586,5 +586,5 @@
 static void publish_cb(struct pjsip_publishc_cbparam *param)
 {
-    pjsua_acc *acc = param->token;
+    pjsua_acc *acc = (pjsua_acc*) param->token;
 
     if (param->code/100 != 2 || param->status != PJ_SUCCESS) {
@@ -856,5 +856,5 @@
     PJSUA_LOCK();
 
-    buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+    buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (buddy) {
 	PJ_LOG(3,(THIS_FILE, 
@@ -889,5 +889,5 @@
     PJSUA_LOCK();
 
-    buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+    buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (!buddy) {
 	PJSUA_UNLOCK();
@@ -915,5 +915,6 @@
 
     /* Find contact header. */
-    contact_hdr = pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg,
+    contact_hdr = (pjsip_contact_hdr*)
+		  pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg,
 				     PJSIP_H_CONTACT, NULL);
     if (!contact_hdr) {
@@ -922,5 +923,6 @@
     }
 
-    buddy->contact.ptr = pj_pool_alloc(pjsua_var.pool, PJSIP_MAX_URL_SIZE);
+    buddy->contact.ptr = (char*)
+			 pj_pool_alloc(pjsua_var.pool, PJSIP_MAX_URL_SIZE);
     buddy->contact.slen = pjsip_uri_print( PJSIP_URI_IN_CONTACT_HDR,
 					   contact_hdr->uri,
@@ -946,5 +948,5 @@
     PJSUA_LOCK();
 
-    buddy = pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
+    buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (buddy) {
 	/* Update our info. */
Index: pjproject/trunk/pjsip/src/test-pjsip/dns_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/dns_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/dns_test.c	(revision 1266)
@@ -36,5 +36,5 @@
 	       const struct pjsip_server_addresses *addr)
 {
-    struct result *result = token;
+    struct result *result = (struct result*) token;
 
     result->status = status;
Index: pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 1266)
@@ -187,6 +187,6 @@
 
     /* Create buffer for comparison. */
-    str1.ptr = pj_pool_alloc(pool, BUFLEN);
-    str2.ptr = pj_pool_alloc(pool, BUFLEN);
+    str1.ptr = (char*)pj_pool_alloc(pool, BUFLEN);
+    str2.ptr = (char*)pj_pool_alloc(pool, BUFLEN);
 
     /* Compare message type. */
@@ -661,9 +661,9 @@
 
     // Body
-    body = pj_pool_zalloc(pool, sizeof(*body));
+    body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
     msg->body = body;
     body->content_type.type = pj_str("application");
     body->content_type.subtype = pj_str("sdp");
-    body->data = 
+    body->data = (void*)
 	"v=0\r\n"
 	"o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n"
@@ -673,5 +673,5 @@
 	"m=audio 3456 RTP/AVP 0 1 3 99\r\n"
 	"a=rtpmap:0 PCMU/8000\r\n";
-    body->len = pj_native_strlen(body->data);
+    body->len = pj_native_strlen((const char*) body->data);
     body->print_body = &pjsip_print_text_body;
 
@@ -716,5 +716,5 @@
 
     for (loop=0; loop<LOOP; ++loop) {
-	for (i=0; i<PJ_ARRAY_SIZE(test_array); ++i) {
+	for (i=0; i<(int)PJ_ARRAY_SIZE(test_array); ++i) {
 	    pool = pjsip_endpt_create_pool(endpt, NULL, POOL_SIZE, POOL_SIZE);
 	    status = test_entry( pool, &test_array[i] );
@@ -1454,5 +1454,7 @@
 	hname = pj_str(test->hname);
 	len = strlen(test->hcontent);
-	parsed_hdr1 = pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len);
+	parsed_hdr1 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, 
+						   test->hcontent, len, 
+						   &parsed_len);
 	if (parsed_hdr1 == NULL) {
 	    if (test->flags & HDR_FLAG_PARSE_FAIL) {
@@ -1476,5 +1478,5 @@
 	    hname = pj_str(test->hshort_name);
 	    len = strlen(test->hcontent);
-	    parsed_hdr2 = pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len);
+	    parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len);
 	    if (parsed_hdr2 == NULL) {
 		PJ_LOG(3,(THIS_FILE, "    error parsing header %s: %s", test->hshort_name, test->hcontent));
@@ -1490,5 +1492,5 @@
 
 	/* Print the original header */
-	input = pj_pool_alloc(pool, 1024);
+	input = (char*) pj_pool_alloc(pool, 1024);
 	len = pj_ansi_snprintf(input, 1024, "%s: %s", test->hname, test->hcontent);
 	if (len < 1 || len >= 1024)
@@ -1496,5 +1498,5 @@
 
 	/* Print the parsed header*/
-	output = pj_pool_alloc(pool, 1024);
+	output = (char*) pj_pool_alloc(pool, 1024);
 	len = pjsip_hdr_print_on(parsed_hdr1, output, 1024);
 	if (len < 1 || len >= 1024) {
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 1266)
@@ -561,5 +561,5 @@
 
 	/* Generate Call-ID for each thread. */
-	rt_test_data[i].call_id.ptr = pj_pool_alloc(pool, rt_call_id.slen+1);
+	rt_test_data[i].call_id.ptr = (char*) pj_pool_alloc(pool, rt_call_id.slen+1);
 	pj_strcpy(&rt_test_data[i].call_id, &rt_call_id);
 	buf[0] = '0' + i;
Index: pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c	(revision 1266)
@@ -54,5 +54,5 @@
 
     /* Create transaction array */
-    tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
+    tsx = (pjsip_transaction**) pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
 
     pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user));
@@ -131,8 +131,8 @@
     rdata.tp_info.pool = request->pool;
     rdata.msg_info.msg = request->msg;
-    rdata.msg_info.from = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
-    rdata.msg_info.to = pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);
-    rdata.msg_info.cseq = pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);
-    rdata.msg_info.cid = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
+    rdata.msg_info.from = (pjsip_from_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
+    rdata.msg_info.to = (pjsip_to_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);
+    rdata.msg_info.cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);
+    rdata.msg_info.cid = (pjsip_cid_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
     rdata.msg_info.via = via;
     
@@ -148,5 +148,5 @@
 
     /* Create transaction array */
-    tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
+    tsx = (pjsip_transaction**) pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
 
     pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user));
Index: pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c	(revision 1266)
@@ -365,5 +365,5 @@
 		PJ_LOG(3,(THIS_FILE, 
 			  "    error: prev state is %s instead of %s",
-			  pjsip_tsx_state_str(e->body.tsx_state.prev_state),
+			  pjsip_tsx_state_str((pjsip_tsx_state_e)e->body.tsx_state.prev_state),
 			  pjsip_tsx_state_str(PJSIP_TSX_STATE_PROCEEDING)));
 		test_complete = -739;
@@ -548,5 +548,5 @@
 				    struct pj_timer_entry *entry)
 {
-    struct response *r = entry->user_data;
+    struct response *r = (struct response*) entry->user_data;
     pjsip_transport *tp = r->res_addr.transport;
 
@@ -760,5 +760,5 @@
 
 	/* Schedule sending final response in couple of of secs. */
-	r = pj_pool_alloc(tdata->pool, sizeof(*r));
+	r = PJ_POOL_ALLOC_T(tdata->pool, struct response);
 	r->res_addr = res_addr;
 	r->tdata = tdata;
@@ -881,5 +881,5 @@
 
 	    /* Schedule sending final response in couple of of secs. */
-	    r = pj_pool_alloc(tdata->pool, sizeof(*r));
+	    r = PJ_POOL_ALLOC_T(tdata->pool, struct response);
 	    r->res_addr = res_addr;
 	    r->tdata = tdata;
@@ -969,5 +969,5 @@
 
     /* Set the branch param for test 1. */
-    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 = pj_str(branch_param);
 
@@ -1098,5 +1098,5 @@
     enabled = msg_logger_set_enabled(0);
 
-    for (i=0; i<PJ_ARRAY_SIZE(sub_test); ++i) {
+    for (i=0; i<(int)PJ_ARRAY_SIZE(sub_test); ++i) {
 
 	PJ_LOG(3,(THIS_FILE, 
@@ -1232,5 +1232,5 @@
 
 
-    for (i=0; i<PJ_ARRAY_SIZE(delay); ++i) {
+    for (i=0; i<(int)PJ_ARRAY_SIZE(delay); ++i) {
 
 	PJ_LOG(3,(THIS_FILE, 
@@ -1303,5 +1303,5 @@
 
     /* Do the test. */
-    for (i=0; i<PJ_ARRAY_SIZE(delay); ++i) {
+    for (i=0; i<(int)PJ_ARRAY_SIZE(delay); ++i) {
 	
 	if (test_param->type == PJSIP_TRANSPORT_LOOP_DGRAM) {
@@ -1344,5 +1344,5 @@
 
     /* Get transport flag */
-    tp_flag = pjsip_transport_get_flag_from_type(test_param->type);
+    tp_flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)test_param->type);
 
     pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s", 
Index: pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c	(revision 1266)
@@ -209,5 +209,5 @@
 {
     pjsip_transaction *tsx;
-    struct response *r = entry->user_data;
+    struct response *r = (struct response*) entry->user_data;
     pj_status_t status;
 
@@ -277,5 +277,5 @@
     }
 
-    r = pj_pool_alloc(tdata->pool, sizeof(*r));
+    r = PJ_POOL_ALLOC_T(tdata->pool, struct response);
     pj_strdup(tdata->pool, &r->tsx_key, tsx_key);
     r->tdata = tdata;
@@ -285,5 +285,5 @@
     pj_time_val_normalize(&delay);
 
-    t = pj_pool_zalloc(tdata->pool, sizeof(*t));
+    t = PJ_POOL_ZALLOC_T(tdata->pool, pj_timer_entry);
     t->user_data = r;
     t->cb = &send_response_timer;
@@ -1097,5 +1097,5 @@
 		uri->transport_param = pj_str("loop-dgram");
 
-		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 = pj_str(TEST9_BRANCH_ID);
 
@@ -1198,5 +1198,5 @@
 
     /* Set the branch param for test 1. */
-    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 = pj_str(branch_param);
 
@@ -1472,5 +1472,5 @@
     int i, status;
 
-    for (i=0; i<PJ_ARRAY_SIZE(tests); ++i) {
+    for (i=0; i<(int)PJ_ARRAY_SIZE(tests); ++i) {
 	pj_time_val fail_time, end_test, now;
 
@@ -1533,5 +1533,5 @@
 
     test_param = param;
-    tp_flag = pjsip_transport_get_flag_from_type(param->type);
+    tp_flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)param->type);
 
     pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s", 
Index: pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c	(revision 1266)
@@ -445,5 +445,5 @@
 
     /* Fill up the Via header to prevent syntax error on parsing */
-    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->transport = pj_str("TCP");
     via->sent_by.host = pj_str("127.0.0.1");
@@ -708,6 +708,6 @@
     via->branch_param = pj_str("012345678901234567890123456789");
     via->recvd_param = pj_str("192.168.0.7");
-    pjsip_msg_insert_first_hdr(request->msg, pjsip_hdr_clone(request->pool, via));
-    pjsip_msg_insert_first_hdr(request->msg, pjsip_hdr_clone(request->pool, via));
+    pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*) pjsip_hdr_clone(request->pool, via));
+    pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*) pjsip_hdr_clone(request->pool, via));
     pjsip_msg_insert_first_hdr(request->msg, (pjsip_hdr*)via);
     
@@ -717,8 +717,8 @@
     rdata.tp_info.pool = request->pool;
     rdata.msg_info.msg = request->msg;
-    rdata.msg_info.from = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
-    rdata.msg_info.to = pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);
-    rdata.msg_info.cseq = pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);
-    rdata.msg_info.cid = pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
+    rdata.msg_info.from = (pjsip_from_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
+    rdata.msg_info.to = (pjsip_to_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_TO, NULL);
+    rdata.msg_info.cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_CSEQ, NULL);
+    rdata.msg_info.cid = (pjsip_cid_hdr*) pjsip_msg_find_hdr(request->msg, PJSIP_H_FROM, NULL);
     rdata.msg_info.via = via;
 
Index: pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 1265)
+++ pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 1266)
@@ -383,5 +383,5 @@
 	do { \
 	    pjsip_param *param; \
-	    param=pj_pool_alloc(pool, sizeof(pjsip_param)); \
+	    param=PJ_POOL_ALLOC_T(pool, pjsip_param); \
 	    param->name = pj_str(pname); \
 	    param->value = pj_str(pvalue); \
@@ -663,5 +663,5 @@
     uri->number = pj_str("911");
     
-    p = pj_pool_alloc(pool, sizeof(*p));
+    p = PJ_POOL_ALLOC_T(pool, pjsip_param);
     p->name = p->value = pj_str("p1");
     pj_list_insert_before(&uri->other_param, p);
@@ -726,6 +726,6 @@
 
     /* Print both URI. */
-    s1.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
-    s2.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
+    s1.ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
+    s2.ptr = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
 
     pj_get_timestamp(&t1);
