Index: /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c	(revision 3665)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c	(revision 3666)
@@ -45,5 +45,5 @@
     unsigned srv_cnt;
     pj_sockaddr_in srv_addr[2];
-    int i, j, send_cnt = 0;
+    int i, send_cnt = 0;
     pj_pool_t *pool;
     struct query_rec {
@@ -124,4 +124,5 @@
 	/* Send messages to servers that has not given us response. */
 	for (i=0; i<sock_cnt && status==PJ_SUCCESS; ++i) {
+	    unsigned j;
 	    for (j=0; j<srv_cnt && status==PJ_SUCCESS; ++j) {
 		pjstun_msg_hdr *msg_hdr = (pjstun_msg_hdr*) out_msg;
Index: /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 3665)
+++ /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 3666)
@@ -284,5 +284,5 @@
         struct write_operation *write_op;
         pj_ssize_t sent;
-        pj_status_t send_rc;
+        pj_status_t send_rc = PJ_SUCCESS;
 
         /* Get the first in the queue. */
@@ -313,6 +313,6 @@
 	    //write_op->op = 0;
         } else if (write_op->op == PJ_IOQUEUE_OP_SEND_TO) {
-	    int retry;
-	    for (retry=0; retry<2; ++retry) {
+	    int retry = 2;
+	    while (--retry >= 0) {
 		send_rc = pj_sock_sendto(h->fd, 
 					 write_op->buf+write_op->written,
@@ -936,15 +936,17 @@
     struct write_operation *write_op;
     unsigned retry;
+    pj_bool_t restart_retry = PJ_FALSE;
+    pj_status_t status;
+    pj_ssize_t sent;
+
+    PJ_ASSERT_RETURN(key && op_key && data && length, PJ_EINVAL);
+    PJ_CHECK_STACK();
+
 #if defined(PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT) && \
 	    PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT!=0
-    pj_bool_t restart_retry = PJ_FALSE;
+retry_on_restart:
+#else
+    PJ_UNUSED_ARG(restart_retry);
 #endif
-    pj_status_t status;
-    pj_ssize_t sent;
-
-    PJ_ASSERT_RETURN(key && op_key && data && length, PJ_EINVAL);
-    PJ_CHECK_STACK();
-
-retry_on_restart:
     /* Check if key is closing. */
     if (IS_CLOSING(key))
Index: /pjproject/trunk/pjlib/src/pj/os_core_win32.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/os_core_win32.c	(revision 3665)
+++ /pjproject/trunk/pjlib/src/pj/os_core_win32.c	(revision 3666)
@@ -1429,4 +1429,5 @@
                        unsigned flags)
 {
+    PJ_UNUSED_ARG(flags);
     return (*main_func)(argc, argv);
 }
Index: /pjproject/trunk/pjmedia/include/pjmedia-codec/audio_codecs.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia-codec/audio_codecs.h	(revision 3665)
+++ /pjproject/trunk/pjmedia/include/pjmedia-codec/audio_codecs.h	(revision 3666)
@@ -49,6 +49,6 @@
     struct {
 	unsigned	option;		/**< Bitmask of options.	*/
-	unsigned	quality;	/**< Codec quality.		*/
-	unsigned	complexity;	/**< Codec complexity.		*/
+	int		quality;	/**< Codec quality.		*/
+	int		complexity;	/**< Codec complexity.		*/
     } speex;
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/event.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/event.c	(revision 3665)
+++ /pjproject/trunk/pjmedia/src/pjmedia/event.c	(revision 3666)
@@ -108,4 +108,7 @@
 		       pjmedia_fourcc_name(event->type, event_name),
 		       pjmedia_fourcc_name(epub->sig, epub_name)));
+    /* Suppress compiler warning if trace is disabled */
+    PJ_UNUSED_ARG(event_name);
+    PJ_UNUSED_ARG(epub_name);
 
     esub = epub->subscription_list.next;
Index: /pjproject/trunk/pjmedia/src/test/vid_dev_test.c
===================================================================
--- /pjproject/trunk/pjmedia/src/test/vid_dev_test.c	(revision 3665)
+++ /pjproject/trunk/pjmedia/src/test/vid_dev_test.c	(revision 3666)
@@ -76,4 +76,6 @@
 				pjmedia_event *event)
 {
+    PJ_UNUSED_ARG(esub);
+
     if (event->type == PJMEDIA_EVENT_WND_CLOSED)
         is_quitting = PJ_TRUE;
Index: /pjproject/trunk/pjmedia/src/test/vid_port_test.c
===================================================================
--- /pjproject/trunk/pjmedia/src/test/vid_port_test.c	(revision 3665)
+++ /pjproject/trunk/pjmedia/src/test/vid_port_test.c	(revision 3666)
@@ -32,4 +32,6 @@
 				pjmedia_event *event)
 {
+    PJ_UNUSED_ARG(esub);
+
     if (event->type == PJMEDIA_EVENT_WND_CLOSED)
         is_quitting = PJ_TRUE;
@@ -47,5 +49,4 @@
     pjmedia_vid_port_param param;
     pjmedia_video_format_detail *vfd;
-    pjmedia_vid_dev_cb cb;
     pjmedia_event_subscription esub;
     pj_status_t status;
@@ -181,5 +182,4 @@
         PJMEDIA_FORMAT_I420
     };
-    pj_status_t status;
 
     PJ_LOG(3, (THIS_FILE, " Video port tests:"));
Index: /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3665)
+++ /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3666)
@@ -2654,5 +2654,5 @@
 /* General processing for media state. "mi" is the media index */
 static void on_call_generic_media_state(pjsua_call_info *ci, unsigned mi,
-                                         pj_bool_t *has_error)
+                                        pj_bool_t *has_error)
 {
     const char *status_name[] = {
@@ -2664,4 +2664,6 @@
     };
 
+    PJ_UNUSED_ARG(has_error);
+
     pj_assert(ci->media[mi].status <= PJ_ARRAY_SIZE(status_name));
     pj_assert(PJSUA_CALL_MEDIA_ERROR == 4);
@@ -2676,4 +2678,6 @@
                                 pj_bool_t *has_error)
 {
+    PJ_UNUSED_ARG(has_error);
+
     /* Stop ringback */
     ring_stop(ci->id);
@@ -2762,4 +2766,7 @@
                                 pj_bool_t *has_error)
 {
+    PJ_UNUSED_ARG(ci);
+    PJ_UNUSED_ARG(mi);
+    PJ_UNUSED_ARG(has_error);
 }
 
@@ -3150,4 +3157,6 @@
 {
     char event_name[5];
+    PJ_UNUSED_ARG(call_id);
+    PJ_UNUSED_ARG(med_idx);
     PJ_LOG(4,(THIS_FILE, "Event %s",
 	      pjmedia_fourcc_name(event->type, event_name)));
Index: /pjproject/trunk/pjsip-apps/src/samples/simpleua.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 3665)
+++ /pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 3666)
@@ -225,5 +225,5 @@
 int main(int argc, char *argv[])
 {
-    pj_pool_t *pool;
+    pj_pool_t *pool = NULL;
     pj_status_t status;
     unsigned i;
@@ -594,5 +594,6 @@
 
     /* Release pool */
-    pj_pool_release(pool);
+    if (pool)
+	pj_pool_release(pool);
 
     return 0;
Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3665)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3666)
@@ -687,4 +687,6 @@
     w->pool = pool;
     w->preview_cap_id = PJMEDIA_VID_INVALID_DEV;
+#else
+    PJ_UNUSED_ARG(wid);
 #endif
 }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 3665)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 3666)
@@ -1325,6 +1325,5 @@
 
 	    if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) {
-		pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.cap_win_id];
-		cap_dev = w->preview_cap_id;
+		cap_dev = call_med->strm.v.cap_dev;
 	    }
 	    info->media[info->media_cnt].stream.vid.cap_dev = cap_dev;
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3665)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3666)
@@ -316,6 +316,4 @@
     pjsip_tx_data *tdata;
     pjsip_response_addr res_addr;
-    pjmedia_transport_info tpinfo;
-    pjmedia_sdp_session *sdp;
     const pjsip_hdr *cap_hdr;
     pj_status_t status;
@@ -386,4 +384,7 @@
 #if DISABLED_FOR_TICKET_1185
     if (pjsua_var.calls[0].med_tp) {
+	pjmedia_transport_info tpinfo;
+	pjmedia_sdp_session *sdp;
+
 	pjmedia_transport_info_init(&tpinfo);
 	pjmedia_transport_get_info(pjsua_var.calls[0].med_tp, &tpinfo);
@@ -2621,4 +2622,6 @@
 
     PJ_LOG(3,(THIS_FILE, "Dumping media transports:"));
+    // Suppress compile warning caused by unreferenced var.
+    PJ_UNUSED_ARG(i);
 #if DISABLED_FOR_TICKET_1185
     for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) {
