Major warnings cleanup

Mostly fixing unused parameter warnings.
A few other warnings also fixed like possible use of
unitialized variables (no real issue found, just compiler couldn't
follow the path), signed vs unsigned warning.

Also fixed some typos, indent issues, removal of dead code, etc.

Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01
Signed-off-by: Mike J. Chen <mjchen@google.com>
diff --git a/stack/gap/gap_api.c b/stack/gap/gap_api.c
index d17895d..fb90d03 100644
--- a/stack/gap/gap_api.c
+++ b/stack/gap/gap_api.c
@@ -19,6 +19,7 @@
 #include <string.h>
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gap_int.h"
 #include "btm_int.h"
 #include "gki.h"
@@ -683,6 +684,10 @@
 UINT16 GAP_ReadLocalDeviceInfo(UINT8 *name, BD_ADDR *addr, tGAP_LMP_VERSION *verinfo,
                                tGAP_LMP_FEATURES *features)
 {
+    UNUSED(name);
+    UNUSED(addr);
+    UNUSED(verinfo);
+    UNUSED(features);
     return (GAP_UNSUPPORTED);
 }
 
diff --git a/stack/gap/gap_ble.c b/stack/gap/gap_ble.c
index 48f4723..d44577d 100644
--- a/stack/gap/gap_ble.c
+++ b/stack/gap/gap_ble.c
@@ -19,6 +19,7 @@
 
 #if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
 
+#include "bt_utils.h"
 #include <string.h>
 #include "gap_int.h"
 #include "gap_api.h"
@@ -345,6 +346,7 @@
 tGATT_STATUS gap_proc_read (tGATTS_REQ_TYPE type, tGATT_READ_REQ *p_data, tGATTS_RSP *p_rsp)
 {
     tGATT_STATUS    status = GATT_NO_RESOURCES;
+    UNUSED(type);
 
     if (p_data->is_long)
         p_rsp->attr_value.offset = p_data->offset;
@@ -381,6 +383,7 @@
 {
     tGAP_ATTR   *p_db_attr = gap_cb.gatt_attr;
     UINT8   i;
+    UNUSED(type);
 
     for (i = 0; i < GAP_MAX_CHAR_NUM; i ++, p_db_attr ++)
     {
@@ -613,6 +616,7 @@
 {
     tGAP_CLCB   *p_clcb = gap_find_clcb_by_bd_addr (bda);
     UINT16      cl_op_uuid;
+    UNUSED(gatt_if);
 
     GAP_TRACE_EVENT5 ("gap_ble_c_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
                       (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
diff --git a/stack/gap/gap_conn.c b/stack/gap/gap_conn.c
index 43765b7..44bb5ec 100644
--- a/stack/gap/gap_conn.c
+++ b/stack/gap/gap_conn.c
@@ -18,6 +18,7 @@
 
 
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "btu.h"
 #include "gap_int.h"
 #include "l2cdefs.h"
@@ -801,6 +802,7 @@
 static void gap_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
 {
     tGAP_CCB *p_ccb = (tGAP_CCB *)p_ref_data;
+    UNUSED(bd_addr);
 
     GAP_TRACE_EVENT3 ("gap_sec_check_complete conn_state:%d, conn_flags:0x%x, status:%d",
         p_ccb->con_state, p_ccb->con_flags, res);
diff --git a/stack/gap/gap_utils.c b/stack/gap/gap_utils.c
index d253a99..866ad7a 100644
--- a/stack/gap/gap_utils.c
+++ b/stack/gap/gap_utils.c
@@ -18,6 +18,7 @@
 
 #include <string.h>
 #include "bt_target.h"
+#include "bt_utils.h"
 #include "gap_int.h"
 
 /*****************************************************************************/
@@ -116,6 +117,7 @@
 {
     tGAP_INFO   *p_cb;
     UINT8        index;
+    UNUSED(p_eir);
 
     GAP_TRACE_EVENT6 ("GAP Inquiry Results Callback (bdaddr [%02x%02x%02x%02x%02x%02x])",
                 p_results->remote_bd_addr[0], p_results->remote_bd_addr[1],
@@ -305,6 +307,8 @@
 
     return (GAP_EOINQDB);
 #else
+    UNUSED(devname);
+    UNUSED(bd_addr);
     /* No data available because we are not automatically saving the data */
     return (GAP_NO_DATA_AVAIL);
 #endif