Cleaned up bunch of compile warnings. Special for libgsmcodec, its warning level is reduced from 4 to 3.




git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/vs-reorg2@2654 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/test/inv_offer_answer_test.c b/pjsip/src/test/inv_offer_answer_test.c
index 22809dd..419a9ee 100644
--- a/pjsip/src/test/inv_offer_answer_test.c
+++ b/pjsip/src/test/inv_offer_answer_test.c
@@ -194,6 +194,8 @@
 {
     pjmedia_sdp_session *sdp;
 
+    PJ_UNUSED_ARG(offer);
+
     sdp = create_sdp(inv->dlg->pool, oa_sdp[inv_test.oa_index].answer);
     pjsip_inv_set_sdp_answer(inv, sdp);
 
@@ -210,12 +212,17 @@
 static void on_create_offer(pjsip_inv_session *inv,
 			    pjmedia_sdp_session **p_offer)
 {
+    PJ_UNUSED_ARG(inv);
+    PJ_UNUSED_ARG(p_offer);
+
     pj_assert(!"Should not happen");
 }
 
 static void on_media_update(pjsip_inv_session *inv_ses, 
 			    pj_status_t status)
 {
+    PJ_UNUSED_ARG(status);
+
     if (inv_ses == inv_test.uas) {
 	inv_test.uas_update_cnt++;
 	pj_assert(inv_test.uas_update_cnt - inv_test.uac_update_cnt <= 1);
@@ -257,6 +264,8 @@
 {
     const char *who = NULL;
 
+    PJ_UNUSED_ARG(e);
+
     if (inv->state == PJSIP_INV_STATE_DISCONNECTED) {
 	TRACE_((THIS_FILE, "      %s call disconnected",
 		(inv==inv_test.uas ? "Callee" : "Caller")));
@@ -611,12 +620,17 @@
 
 static pjsip_dialog* on_dlg_forked(pjsip_dialog *first_set, pjsip_rx_data *res)
 {
+    PJ_UNUSED_ARG(first_set);
+    PJ_UNUSED_ARG(res);
+
     return NULL;
 }
 
 
 static void on_new_session(pjsip_inv_session *inv, pjsip_event *e)
 {
+    PJ_UNUSED_ARG(inv);
+    PJ_UNUSED_ARG(e);
 }
 
 
diff --git a/pjsip/src/test/msg_err_test.c b/pjsip/src/test/msg_err_test.c
index 46d28f1..e04a915 100644
--- a/pjsip/src/test/msg_err_test.c
+++ b/pjsip/src/test/msg_err_test.c
@@ -27,6 +27,9 @@
 static pj_bool_t verify_success(pjsip_msg *msg,
 				pjsip_parser_err_report *err_list)
 {
+    PJ_UNUSED_ARG(msg);
+    PJ_UNUSED_ARG(err_list);
+
     return PJ_TRUE;
 }
 
diff --git a/pjsip/src/test/msg_test.c b/pjsip/src/test/msg_test.c
index 840c40f..0d922a5 100644
--- a/pjsip/src/test/msg_test.c
+++ b/pjsip/src/test/msg_test.c
@@ -837,13 +837,12 @@
 static int msg_benchmark(unsigned *p_detect, unsigned *p_parse, 
 			 unsigned *p_print)
 {
-    pj_status_t status;
     pj_pool_t *pool;
     int i, loop;
     pj_timestamp zero;
     pj_time_val elapsed;
     pj_highprec_t avg_detect, avg_parse, avg_print, kbytes;
-
+    pj_status_t status = PJ_SUCCESS;
 
     pj_bzero(&var, sizeof(var));
     zero.u64 = 0;
diff --git a/pjsip/src/test/test.c b/pjsip/src/test/test.c
index 5ce2b71..df5523a 100644
--- a/pjsip/src/test/test.c
+++ b/pjsip/src/test/test.c
@@ -88,6 +88,8 @@
 
 pj_status_t register_static_modules(pj_size_t *count, pjsip_module **modules)
 {
+    PJ_UNUSED_ARG(modules);
+
     *count = 0;
     return PJ_SUCCESS;
 }
diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c
index 9f19b68..a17dca8 100644
--- a/pjsip/src/test/transport_test.c
+++ b/pjsip/src/test/transport_test.c
@@ -159,6 +159,8 @@
 static void send_msg_callback(pjsip_send_state *stateless_data,
 			      pj_ssize_t sent, pj_bool_t *cont)
 {
+    PJ_UNUSED_ARG(stateless_data);
+
     if (sent < 1) {
 	/* Obtain the error code. */
 	send_status = -sent;
@@ -184,6 +186,9 @@
     pjsip_tx_data *tdata;
     pj_time_val timeout;
 
+    PJ_UNUSED_ARG(tp_type);
+    PJ_UNUSED_ARG(ref_tp);
+
     PJ_LOG(3,(THIS_FILE, "  single message round-trip test..."));
 
     /* Register out test module to receive the message (if necessary). */
@@ -490,6 +495,8 @@
     int i;
     pj_time_val poll_delay = { 0, 10 };
 
+    PJ_UNUSED_ARG(arg);
+
     /* Sleep to allow main threads to run. */
     pj_thread_sleep(10);
 
@@ -520,6 +527,9 @@
     unsigned total_sent;
     unsigned total_recv;
 
+    PJ_UNUSED_ARG(tp_type);
+    PJ_UNUSED_ARG(ref_tp);
+
     PJ_LOG(3,(THIS_FILE, "  multithreaded round-trip test (%d threads)...",
 		  THREADS));
     PJ_LOG(3,(THIS_FILE, "    this will take approx %d seconds, please wait..",
@@ -550,8 +560,9 @@
     /* Initialize thread data. */
     for (i=0; i<THREADS; ++i) {
 	char buf[1];
-	pj_str_t str_id = { buf, 1 };
-
+	pj_str_t str_id;
+	
+	pj_strset(&str_id, buf, 1);
 	pj_bzero(&rt_test_data[i], sizeof(rt_test_data[i]));
 
 	/* Init timer entry */
@@ -563,7 +574,7 @@
 	/* Generate Call-ID for each thread. */
 	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;
+	buf[0] = '0' + (char)i;
 	pj_strcat(&rt_test_data[i].call_id, &str_id);
 
 	/* Init mutex. */
diff --git a/pjsip/src/test/tsx_uac_test.c b/pjsip/src/test/tsx_uac_test.c
index f725114..f6f9c2f 100644
--- a/pjsip/src/test/tsx_uac_test.c
+++ b/pjsip/src/test/tsx_uac_test.c
@@ -551,6 +551,8 @@
     struct response *r = (struct response*) entry->user_data;
     pjsip_transport *tp = r->res_addr.transport;
 
+    PJ_UNUSED_ARG(timer_heap);
+
     pjsip_endpt_send_response(endpt, &r->res_addr, r->tdata, NULL, NULL);
     if (tp)
 	pjsip_transport_dec_ref(tp);
@@ -564,6 +566,8 @@
     pjsip_transaction *tsx = pjsip_tsx_layer_find_tsx(&m->tsx_key, PJ_FALSE);
     int status_code = entry->id;
 
+    PJ_UNUSED_ARG(timer_heap);
+
     if (tsx) {
 	pjsip_tsx_terminate(tsx, status_code);
     }
@@ -947,6 +951,8 @@
     pj_time_val timeout;
     pj_status_t status;
 
+    PJ_UNUSED_ARG(dummy);
+
     PJ_LOG(3,(THIS_FILE, 
 	      "   please standby, this will take at most %d seconds..",
 	      test_time));
@@ -1077,7 +1083,7 @@
  */
 static int tsx_uac_retransmit_test(void)
 {
-    int status, enabled;
+    int status = 0, enabled;
     int i;
     struct {
 	const pjsip_method *method;
@@ -1141,7 +1147,7 @@
  */
 static int tsx_resolve_error_test(void)
 {
-    int status;
+    int status = 0;
 
     PJ_LOG(3,(THIS_FILE, "  test2: resolve error test"));
 
@@ -1226,7 +1232,7 @@
 {
     int i;
     unsigned delay[] = {0, 10};
-    pj_status_t status;
+    pj_status_t status = PJ_SUCCESS;
 
     PJ_LOG(3,(THIS_FILE, 
 	      "  test4: transport fails after several retransmissions test"));
@@ -1297,7 +1303,7 @@
 				 char *branch_id,
 				 const pjsip_method *method)
 {
-    int i, status;
+    int i, status = 0;
     unsigned delay[] = { 1, 200 };
 
     PJ_LOG(3,(THIS_FILE, "  %s", title));
diff --git a/pjsip/src/test/tsx_uas_test.c b/pjsip/src/test/tsx_uas_test.c
index 813e4e5..f397ea7 100644
--- a/pjsip/src/test/tsx_uas_test.c
+++ b/pjsip/src/test/tsx_uas_test.c
@@ -95,19 +95,19 @@
  **
  **/
 
-static char *TEST1_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test1";
-static char *TEST2_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test2";
-static char *TEST3_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test3";
-static char *TEST4_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test4";
-static char *TEST5_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test5";
-static char *TEST6_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test6";
-static char *TEST7_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test7";
-static char *TEST8_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test8";
-static char *TEST9_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test9";
-static char *TEST10_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test10";
-static char *TEST11_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test11";
-static char *TEST12_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test12";
-//static char *TEST13_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test13";
+#define TEST1_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test1")
+#define TEST2_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test2")
+#define TEST3_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test3")
+#define TEST4_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test4")
+#define TEST5_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test5")
+#define TEST6_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test6")
+#define TEST7_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test7")
+#define TEST8_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test8")
+#define TEST9_BRANCH_ID  (PJSIP_RFC3261_BRANCH_ID "-UAS-Test9")
+#define TEST10_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test10")
+#define TEST11_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test11")
+#define TEST12_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test12")
+//#define TEST13_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test13")
 
 #define TEST1_STATUS_CODE	200
 #define TEST2_STATUS_CODE	301
@@ -212,6 +212,8 @@
     struct response *r = (struct response*) entry->user_data;
     pj_status_t status;
 
+    PJ_UNUSED_ARG(timer_heap);
+
     tsx = pjsip_tsx_layer_find_tsx(&r->tsx_key, PJ_TRUE);
     if (!tsx) {
 	PJ_LOG(3,(THIS_FILE,"    error: timer unable to find transaction"));
diff --git a/pjsip/src/test/uri_test.c b/pjsip/src/test/uri_test.c
index d51c6fe..7807f50 100644
--- a/pjsip/src/test/uri_test.c
+++ b/pjsip/src/test/uri_test.c
@@ -917,7 +917,7 @@
 static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
 {
     unsigned i, loop;
-    pj_status_t status;
+    pj_status_t status = PJ_SUCCESS;
     pj_timestamp zero;
     pj_time_val elapsed;
     pj_highprec_t avg_parse, avg_print, avg_cmp, kbytes;