OSDN Git Service

Remove deprecated UNUSED macro (3/5)
authorMyles Watson <mylesgw@google.com>
Thu, 27 Oct 2016 17:02:37 +0000 (10:02 -0700)
committerMyles Watson <mylesgw@google.com>
Thu, 27 Oct 2016 21:36:35 +0000 (14:36 -0700)
These were caused by ifdefs, so they had to be
done by hand.

TEST: mma -j32

Change-Id: I183f3ee82e8744fed2b65dc96dc492b5bf079243

bta/dm/bta_dm_api.cc
bta/hh/bta_hh_act.cc
bta/hh/bta_hh_utils.cc
btif/src/btif_gatt_util.cc
stack/btm/btm_acl.cc
stack/btm/btm_ble_gap.cc
stack/btm/btm_sco.cc

index 7862d0b..7a2d30e 100644 (file)
@@ -1222,9 +1222,9 @@ void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
 ** Returns          void
 **
 *******************************************************************************/
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
 void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, tBTA_DM_SEARCH_CBACK *p_cback)
 {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
     const size_t len = p_services ?
         (sizeof(tBTA_DM_API_SEARCH) + sizeof(tBT_UUID) * p_services->num_uuid)
         : sizeof(tBTA_DM_API_SEARCH);
@@ -1249,12 +1249,14 @@ void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, t
     }
 
     bta_sys_sendmsg(p_msg);
+}
 #else
-    UNUSED(p_dm_inq);
-    UNUSED(p_services);
-    UNUSED(p_cback);
-#endif
+void BTA_DmSearchExt(UNUSED_ATTR tBTA_DM_INQ *p_dm_inq,
+                     UNUSED_ATTR tBTA_SERVICE_MASK_EXT *p_services,
+                     UNUSED_ATTR tBTA_DM_SEARCH_CBACK *p_cback)
+{
 }
+#endif
 /*******************************************************************************
 **
 ** Function         BTA_DmBleUpdateConnectionParam
@@ -1333,6 +1335,7 @@ void BTA_DmBleConfigLocalPrivacy(bool privacy_enable)
 ** Returns          void
 **
 *******************************************************************************/
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
 void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
                                  tBTA_DM_BLE_PF_COND_TYPE cond_type,
                                  tBTA_DM_BLE_PF_FILT_INDEX filt_index,
@@ -1340,7 +1343,6 @@ void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
                                  tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
                                  tBTA_DM_BLE_REF_VALUE ref_value)
 {
-#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
     tBTA_DM_API_CFG_FILTER_COND *p_msg;
     APPL_TRACE_API ("BTA_DmBleCfgFilterCondition: %d, %d", action, cond_type);
 
@@ -1432,15 +1434,17 @@ void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
 
     bta_sys_sendmsg(p_msg);
 
+}
 #else
-    UNUSED(action);
-    UNUSED(cond_type);
-    UNUSED(filt_index);
-    UNUSED(p_cond);
-    UNUSED(p_cmpl_cback);
-    UNUSED(ref_value);
-#endif
+void BTA_DmBleCfgFilterCondition(UNUSED_ATTR tBTA_DM_BLE_SCAN_COND_OP action,
+                                 UNUSED_ATTR tBTA_DM_BLE_PF_COND_TYPE cond_type,
+                                 UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
+                                 UNUSED_ATTR tBTA_DM_BLE_PF_COND_PARAM *p_cond,
+                                 UNUSED_ATTR tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
+                                 UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
+{
 }
+#endif
 
 /*******************************************************************************
 **
@@ -1458,6 +1462,7 @@ void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
 ** Returns          void
 **
 *******************************************************************************/
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
 void BTA_DmBleScanFilterSetup(uint8_t action,
                               tBTA_DM_BLE_PF_FILT_INDEX filt_index,
                               tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
@@ -1465,7 +1470,6 @@ void BTA_DmBleScanFilterSetup(uint8_t action,
                               tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
                               tBTA_DM_BLE_REF_VALUE ref_value)
 {
-#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
     const size_t len = sizeof(tBTA_DM_API_SCAN_FILTER_PARAM_SETUP) +
         sizeof(tBLE_BD_ADDR);
     tBTA_DM_API_SCAN_FILTER_PARAM_SETUP *p_msg =
@@ -1489,16 +1493,16 @@ void BTA_DmBleScanFilterSetup(uint8_t action,
     }
 
     bta_sys_sendmsg(p_msg);
-
+}
 #else
-    UNUSED(action);
-    UNUSED(filt_index);
-    UNUSED(p_filt_params);
-    UNUSED(p_target);
-    UNUSED(p_cmpl_cback);
-    UNUSED(ref_value);
-#endif
+void BTA_DmBleScanFilterSetup(UNUSED_ATTR uint8_t action,
+                              UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
+                              UNUSED_ATTR tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
+                              UNUSED_ATTR tBLE_BD_ADDR *p_target,
+                              UNUSED_ATTR tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
+                              UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
 }
+#endif
 
 /*******************************************************************************
 **
@@ -1537,10 +1541,10 @@ void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback)
 ** Returns          void
 **
 *******************************************************************************/
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
 void BTA_DmEnableScanFilter(uint8_t action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
                                     tBTA_DM_BLE_REF_VALUE ref_value)
 {
-#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
     const size_t len = sizeof(tBTA_DM_API_ENABLE_SCAN_FILTER) +
         sizeof(tBLE_BD_ADDR);
     tBTA_DM_API_ENABLE_SCAN_FILTER *p_msg =
@@ -1555,12 +1559,14 @@ void BTA_DmEnableScanFilter(uint8_t action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_
 
     bta_sys_sendmsg(p_msg);
 
+}
 #else
-    UNUSED(action);
-    UNUSED(p_cmpl_cback);
-    UNUSED(ref_value);
-#endif
+void BTA_DmEnableScanFilter(UNUSED_ATTR uint8_t action,
+                            UNUSED_ATTR tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
+                            UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
+{
 }
+#endif
 
 /*******************************************************************************
 **
index 4eeac28..2783680 100644 (file)
@@ -162,16 +162,16 @@ void bta_hh_api_disable(void)
 *******************************************************************************/
 void bta_hh_disc_cmpl(void)
 {
+#if (BTA_HH_LE_INCLUDED == TRUE)
+    HID_HostDeregister();
+    bta_hh_le_deregister();
+#else
     tBTA_HH_STATUS  status = BTA_HH_OK;
 
     /* Deregister with lower layer */
     if (HID_HostDeregister() != HID_SUCCESS)
         status = BTA_HH_ERR;
 
-#if (BTA_HH_LE_INCLUDED == TRUE)
-    bta_hh_le_deregister();
-    UNUSED(status);
-#else
     bta_hh_cleanup_disable(status);
 #endif
 }
index 2a336aa..6ea9e70 100644 (file)
@@ -154,7 +154,12 @@ void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB *p_cb)
 **
 *******************************************************************************/
 void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, uint16_t vendor_id, uint16_t product_id,
-                           uint16_t version, uint8_t flag)
+                           uint16_t version,
+#if (BTA_HH_LE_INCLUDED == TRUE)
+                           uint8_t flag)
+#else
+                           UNUSED_ATTR uint8_t flag)
+#endif
 {
 #if (BTA_HH_DEBUG == TRUE)
     APPL_TRACE_DEBUG("vendor_id = 0x%2x product_id = 0x%2x version = 0x%2x",
@@ -165,8 +170,6 @@ void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, uint16_t vendor_id, uint16_t pr
     p_cb->dscp_info.version       =   version;
 #if (BTA_HH_LE_INCLUDED == TRUE)
     p_cb->dscp_info.flag          =   flag;
-#else
-    UNUSED(flag);
 #endif
 }
 /*******************************************************************************
index d5ca643..9964dd8 100644 (file)
@@ -228,9 +228,9 @@ static void btif_gatt_set_encryption_cb(UNUSED_ATTR BD_ADDR bd_addr,
 }
 #endif
 
+#if (BLE_DELAY_REQUEST_ENC == FALSE)
 void btif_gatt_check_encrypted_link(BD_ADDR bd_addr,
                                     tBTA_GATT_TRANSPORT transport_link) {
-#if (BLE_DELAY_REQUEST_ENC == FALSE)
   char buf[100];
 
   bt_bdaddr_t bda;
@@ -244,11 +244,12 @@ void btif_gatt_check_encrypted_link(BD_ADDR bd_addr,
     BTA_DmSetEncryption(bd_addr, transport_link, &btif_gatt_set_encryption_cb,
                         BTM_BLE_SEC_ENCRYPT);
   }
+}
 #else
-  UNUSED(bd_addr);
-  UNUSED(transport_link);
-#endif
+void btif_gatt_check_encrypted_link(UNUSED_ATTR BD_ADDR bd_addr,
+                                    UNUSED_ATTR tBTA_GATT_TRANSPORT transport_link) {
 }
+#endif
 
 #endif  // BTA_GATT_INCLUDED
 
index eac50d0..28c8111 100644 (file)
@@ -149,10 +149,10 @@ uint8_t btm_handle_to_acl_index (uint16_t hci_handle)
 ** Returns          success return true, otherwise false.
 **
 *******************************************************************************/
+#if (BLE_INCLUDED == TRUE)
 bool    btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC *p_dev_rec, BD_ADDR conn_addr,
                                     tBLE_ADDR_TYPE *p_addr_type)
 {
-#if (BLE_INCLUDED == TRUE)
     bool            st = true;
 
     if (p_dev_rec == NULL)
@@ -185,14 +185,16 @@ bool    btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC *p_dev_rec, BD_ADDR conn_ad
     }
 
     return st;
+}
 #else
-    UNUSED(p_dev_rec);
-    UNUSED(conn_addr);
-    UNUSED(p_addr_type);
+bool    btm_ble_get_acl_remote_addr(UNUSED_ATTR tBTM_SEC_DEV_REC *p_dev_rec,
+                                    UNUSED_ATTR BD_ADDR conn_addr,
+                                    UNUSED_ATTR tBLE_ADDR_TYPE *p_addr_type)
+{
     return false;
-#endif
 }
 #endif
+#endif
 /*******************************************************************************
 **
 ** Function         btm_acl_created
index eec70a6..387a7b4 100644 (file)
@@ -593,22 +593,23 @@ extern void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB *p_cmn_vsc_cb)
 ** Returns          void
 **
 *******************************************************************************/
+#if (BLE_VND_INCLUDED == TRUE)
 extern void BTM_BleReadControllerFeatures(tBTM_BLE_CTRL_FEATURES_CBACK  *p_vsc_cback)
 {
     if (true == btm_cb.cmn_ble_vsc_cb.values_read)
         return;
 
-#if (BLE_VND_INCLUDED == TRUE)
     BTM_TRACE_DEBUG("BTM_BleReadControllerFeatures");
 
     p_ctrl_le_feature_rd_cmpl_cback = p_vsc_cback;
     BTM_VendorSpecificCommand(HCI_BLE_VENDOR_CAP_OCF, 0, NULL,
                               btm_ble_vendor_capability_vsc_cmpl_cback);
+}
 #else
-    UNUSED(p_vsc_cback);
-#endif
-    return ;
+extern void BTM_BleReadControllerFeatures(UNUSED_ATTR tBTM_BLE_CTRL_FEATURES_CBACK  *p_vsc_cback)
+{
 }
+#endif
 
 /*******************************************************************************
 **
index c2cc10a..e1c442b 100644 (file)
@@ -81,10 +81,9 @@ static const tBTM_ESCO_PARAMS btm_esco_defaults =
 ** Returns          void
 **
 *******************************************************************************/
+#if (BTM_SCO_HCI_INCLUDED == TRUE && BTM_MAX_SCO_LINKS>0)
 void btm_sco_flush_sco_data(uint16_t sco_inx)
 {
-#if (BTM_SCO_HCI_INCLUDED == TRUE)
-#if (BTM_MAX_SCO_LINKS>0)
     tSCO_CONN   *p ;
     BT_HDR      *p_buf;
 
@@ -95,13 +94,12 @@ void btm_sco_flush_sco_data(uint16_t sco_inx)
             osi_free(p_buf);
         }
     }
+}
 #else
-    UNUSED(sco_inx);
-#endif
-#else
-    UNUSED(sco_inx);
-#endif
+void btm_sco_flush_sco_data(UNUSED_ATTR uint16_t sco_inx)
+{
 }
+#endif
 /*******************************************************************************
 **
 ** Function         btm_sco_init
@@ -312,9 +310,9 @@ void  btm_route_sco_data(BT_HDR *p_msg)
 **
 **
 *******************************************************************************/
+#if (BTM_SCO_HCI_INCLUDED == TRUE && BTM_MAX_SCO_LINKS > 0)
 tBTM_STATUS BTM_WriteScoData (uint16_t sco_inx, BT_HDR *p_buf)
 {
-#if (BTM_SCO_HCI_INCLUDED == TRUE && BTM_MAX_SCO_LINKS > 0)
     tSCO_CONN   *p_ccb = &btm_cb.sco_cb.sco_db[sco_inx];
     uint8_t *p;
     tBTM_STATUS     status = BTM_SUCCESS;
@@ -364,12 +362,14 @@ tBTM_STATUS BTM_WriteScoData (uint16_t sco_inx, BT_HDR *p_buf)
 
     return (status);
 
+}
 #else
-    UNUSED(sco_inx);
-    UNUSED(p_buf);
+tBTM_STATUS BTM_WriteScoData(UNUSED_ATTR uint16_t sco_inx,
+                             UNUSED_ATTR BT_HDR *p_buf)
+{
     return (BTM_NO_RESOURCES);
-#endif
 }
+#endif
 
 #if (BTM_MAX_SCO_LINKS>0)
 /*******************************************************************************