bta: use standard types

Use standard types everywhere.
Use standard style for #if statements:
 - #if (VAR_NAME == TRUE)
 - #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
diff --git a/bta/dm/bta_dm_main.cc b/bta/dm/bta_dm_main.cc
index e6d791a..50c622c 100644
--- a/bta/dm/bta_dm_main.cc
+++ b/bta/dm/bta_dm_main.cc
@@ -31,7 +31,7 @@
 ** Constants and types
 *****************************************************************************/
 
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
 tBTA_DM_CB  bta_dm_cb;
 tBTA_DM_SEARCH_CB bta_dm_search_cb;
 tBTA_DM_DI_CB       bta_dm_di_cb;
@@ -76,7 +76,7 @@
     bta_dm_ci_rmt_oob_act,    /* 22 BTA_DM_CI_RMT_OOB_EVT */
 
 
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
     bta_dm_add_blekey,          /*  BTA_DM_API_ADD_BLEKEY_EVT           */
     bta_dm_add_ble_device,      /*  BTA_DM_API_ADD_BLEDEVICE_EVT        */
     bta_dm_ble_passkey_reply,   /*  BTA_DM_API_BLE_PASSKEY_REPLY_EVT    */
@@ -88,7 +88,7 @@
     bta_dm_ble_set_scan_params,  /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
     bta_dm_ble_observe,
     bta_dm_ble_update_conn_params,   /* BTA_DM_API_UPDATE_CONN_PARAM_EVT */
-#if BLE_PRIVACY_SPT == TRUE
+#if (BLE_PRIVACY_SPT == TRUE)
     bta_dm_ble_config_local_privacy,   /* BTA_DM_API_LOCAL_PRIVACY_EVT */
 #endif
     bta_dm_ble_set_adv_params,     /* BTA_DM_API_BLE_ADV_PARAM_EVT */
@@ -96,7 +96,7 @@
     bta_dm_ble_set_scan_rsp,       /* BTA_DM_API_BLE_SET_SCAN_RSPT */
     bta_dm_ble_broadcast,          /* BTA_DM_API_BLE_BROADCAST_EVT */
     bta_dm_ble_set_data_length,    /* BTA_DM_API_SET_DATA_LENGTH_EVT */
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
     bta_dm_cfg_filter_cond,         /* BTA_DM_API_CFG_FILTER_COND_EVT */
     bta_dm_scan_filter_param_setup, /* BTA_DM_API_SCAN_FILTER_SETUP_EVT */
     bta_dm_enable_scan_filter,      /* BTA_DM_API_SCAN_FILTER_ENABLE_EVT */
@@ -144,7 +144,7 @@
     BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL,  /* 15 bta_dm_search_cancel_transac_cmpl */
     BTA_DM_DISC_RMT_NAME,               /* 16 bta_dm_disc_rmt_name */
     BTA_DM_API_DI_DISCOVER,             /* 17 bta_dm_di_disc */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
     BTA_DM_CLOSE_GATT_CONN,             /* 18 bta_dm_close_gatt_conn */
 #endif
     BTA_DM_SEARCH_NUM_ACTIONS           /* 19 */
@@ -173,7 +173,7 @@
   bta_dm_search_cancel_transac_cmpl, /* 15 BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL */
   bta_dm_disc_rmt_name,             /* 16 BTA_DM_DISC_RMT_NAME */
   bta_dm_di_disc                    /* 17 BTA_DM_API_DI_DISCOVER */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
   ,bta_dm_close_gatt_conn
 #endif
 };
@@ -187,7 +187,7 @@
 
 
 /* state table for listen state */
-const UINT8 bta_dm_search_idle_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_idle_st_table[][BTA_DM_SEARCH_NUM_COLS] =
 {
 
 /* Event                        Action 1                            Action 2                    Next State */
@@ -200,11 +200,11 @@
 /* SEARCH_CMPL_EVT */       {BTA_DM_SEARCH_IGNORE,             BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_IDLE},
 /* DISCV_RES_EVT */         {BTA_DM_SEARCH_IGNORE,             BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_IDLE},
 /* API_DI_DISCOVER_EVT */   {BTA_DM_API_DI_DISCOVER,           BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_ACTIVE}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
 /* DISC_CLOSE_TOUT_EVT */   ,{BTA_DM_CLOSE_GATT_CONN,           BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_IDLE}
 #endif
 };
-const UINT8 bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
 {
 
 /* Event                        Action 1                            Action 2                    Next State */
@@ -217,13 +217,13 @@
 /* SEARCH_CMPL_EVT */       {BTA_DM_SEARCH_CMPL,               BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_IDLE},
 /* DISCV_RES_EVT */         {BTA_DM_SEARCH_RESULT,             BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_ACTIVE},
 /* API_DI_DISCOVER_EVT */   {BTA_DM_SEARCH_IGNORE,             BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_ACTIVE}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
 /* DISC_CLOSE_TOUT_EVT */   ,{BTA_DM_CLOSE_GATT_CONN,          BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_ACTIVE}
 #endif
 
 };
 
-const UINT8 bta_dm_search_search_cancelling_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_search_cancelling_st_table[][BTA_DM_SEARCH_NUM_COLS] =
 {
 
 /* Event                        Action 1                            Action 2                    Next State */
@@ -236,13 +236,13 @@
 /* SEARCH_CMPL_EVT */       {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL,     BTA_DM_SEARCH_IDLE},
 /* DISCV_RES_EVT */         {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL,     BTA_DM_SEARCH_IDLE},
 /* API_DI_DISCOVER_EVT */   {BTA_DM_SEARCH_IGNORE,              BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_CANCELLING}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
 /* DISC_CLOSE_TOUT_EVT */   ,{BTA_DM_SEARCH_IGNORE,              BTA_DM_SEARCH_IGNORE,          BTA_DM_SEARCH_CANCELLING}
 #endif
 
 };
 
-const UINT8 bta_dm_search_disc_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_disc_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
 {
 
 /* Event                        Action 1                            Action 2                    Next State */
@@ -256,12 +256,12 @@
 /* DISCV_RES_EVT */         {BTA_DM_DISC_RESULT,               BTA_DM_SEARCH_IGNORE,          BTA_DM_DISCOVER_ACTIVE},
 /* API_DI_DISCOVER_EVT */   {BTA_DM_SEARCH_IGNORE,             BTA_DM_SEARCH_IGNORE,          BTA_DM_DISCOVER_ACTIVE}
 
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
 /* DISC_CLOSE_TOUT_EVT */   ,{BTA_DM_SEARCH_IGNORE,             BTA_DM_SEARCH_IGNORE,          BTA_DM_DISCOVER_ACTIVE}
 #endif
 };
 
-typedef const UINT8 (*tBTA_DM_ST_TBL)[BTA_DM_SEARCH_NUM_COLS];
+typedef const uint8_t (*tBTA_DM_ST_TBL)[BTA_DM_SEARCH_NUM_COLS];
 
 /* state table */
 const tBTA_DM_ST_TBL bta_dm_search_st_tbl[] = {
@@ -298,9 +298,9 @@
 ** Returns          void
 **
 *******************************************************************************/
-BOOLEAN bta_dm_sm_execute(BT_HDR *p_msg)
+bool bta_dm_sm_execute(BT_HDR *p_msg)
 {
-    UINT16  event = p_msg->event & 0x00ff;
+    uint16_t  event = p_msg->event & 0x00ff;
 
     APPL_TRACE_EVENT("bta_dm_sm_execute event:0x%x", event);
 
@@ -310,7 +310,7 @@
         (*bta_dm_action[event])( (tBTA_DM_MSG*) p_msg);
     }
 
-    return TRUE;
+    return true;
 }
 
 /*******************************************************************************
@@ -340,10 +340,10 @@
 ** Returns          void
 **
 *******************************************************************************/
-BOOLEAN bta_dm_search_sm_execute(BT_HDR *p_msg)
+bool bta_dm_search_sm_execute(BT_HDR *p_msg)
 {
     tBTA_DM_ST_TBL      state_table;
-    UINT8               action;
+    uint8_t               action;
     int                 i;
 
     APPL_TRACE_EVENT("bta_dm_search_sm_execute state:%d, event:0x%x",
@@ -367,6 +367,6 @@
             break;
         }
     }
-    return TRUE;
+    return true;
 }