OSDN Git Service

Init variables to fix compiler error
authorMatthew Xie <mattx@google.com>
Fri, 9 May 2014 08:04:04 +0000 (01:04 -0700)
committerMatthew Xie <mattx@google.com>
Fri, 9 May 2014 08:04:04 +0000 (01:04 -0700)
Change-Id: Ib41ecc8be53f64f10446b758c54eaf41f2a2e725

bta/av/bta_av_act.c
bta/hl/bta_hl_utils.c
btif/src/btif_hl.c
stack/btm/btm_ble.c

index 4408874..1637adc 100644 (file)
@@ -870,7 +870,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
     BOOLEAN is_inquiry = ((p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_SPEC_INQ) || p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_GEN_INQ);
 #if (AVRC_METADATA_INCLUDED == TRUE)
     tAVRC_STS   res;
-    UINT8       ctype;
+    UINT8       ctype = 0;
     tAVRC_RESPONSE  rc_rsp;
 
     rc_rsp.rsp.status = BTA_AV_STS_NO_RSP;
index 6a08b74..bc37807 100644 (file)
@@ -1462,6 +1462,8 @@ BOOLEAN  bta_hl_find_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
     tBTA_HL_MDL_CFG     *p_mdl;
     UINT8 i ;
     BOOLEAN found=FALSE;
+
+    *p_mdl_cfg_idx = 0;
     for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
     {
         p_mdl = BTA_HL_GET_MDL_CFG_PTR(app_idx, i);
@@ -2725,6 +2727,11 @@ BOOLEAN bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO
         }
         success = TRUE;
     }
+    else
+    {
+      p_cfg->mtu = L2CAP_DEFAULT_MTU;
+      p_cfg->fcs = BTA_HL_L2C_NO_FCS;
+    }
 
 #if BTA_HL_DEBUG == TRUE
     if (!success)
index cdf13b6..efa5ca7 100644 (file)
@@ -189,6 +189,9 @@ BOOLEAN btif_hl_if_channel_setup_pending(int channel_id, UINT8 *p_app_idx, UINT8
     btif_hl_mcl_cb_t    *p_mcb;
     UINT8 i, j;
     BOOLEAN found=FALSE;
+
+    *p_app_idx = 0;
+    *p_mcl_idx = 0;
     for (i=0; i < BTA_HL_NUM_APPS ; i ++)
     {
         p_acb  =BTIF_HL_GET_APP_CB_PTR(i);
@@ -1002,6 +1005,8 @@ BOOLEAN btif_hl_find_mdl_cfg_idx_using_channel_id(int channel_id,
     UINT8 i,j;
     int mdl_cfg_channel_id;
 
+    *p_app_idx = 0;
+    *p_mdl_cfg_idx =0;
     for (i=0; i < BTA_HL_NUM_APPS ; i ++)
     {
         p_acb =BTIF_HL_GET_APP_CB_PTR(i);
@@ -1125,6 +1130,9 @@ BOOLEAN btif_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
     BOOLEAN found=FALSE;
     UINT8 i,j,k;
 
+    *p_app_idx = 0;
+    *p_mcl_idx =0;
+    *p_mdl_idx = 0;
     for (i=0; i < BTA_HL_NUM_APPS ; i ++)
     {
         p_acb =BTIF_HL_GET_APP_CB_PTR(i);
@@ -1324,6 +1332,7 @@ BOOLEAN btif_hl_find_mcl_idx(UINT8 app_idx, BD_ADDR p_bd_addr, UINT8 *p_mcl_idx)
     btif_hl_app_cb_t  *p_acb =BTIF_HL_GET_APP_CB_PTR(app_idx);
     btif_hl_mcl_cb_t  *p_mcb;
 
+    *p_mcl_idx = 0;
     for (i=0; i < BTA_HL_NUM_MCLS ; i ++)
     {
         p_mcb = BTIF_HL_GET_MCL_CB_PTR(app_idx, i);
@@ -1585,6 +1594,7 @@ static BOOLEAN btif_hl_get_bta_mdep_role(bthl_mdep_role_t mdep, tBTA_HL_MDEP_ROL
             *p = BTA_HL_MDEP_ROLE_SINK;
             break;
         default:
+            *p = BTA_HL_MDEP_ROLE_SOURCE;
             status = FALSE;
             break;
     }
@@ -1744,6 +1754,7 @@ BOOLEAN btif_hl_find_app_idx_using_app_id(UINT8 app_id,
     BOOLEAN found=FALSE;
     UINT8 i;
 
+    *p_app_idx = 0;
     for (i=0; i < BTA_HL_NUM_APPS ; i ++)
     {
         if (btif_hl_cb.acb[i].in_use &&
@@ -2026,6 +2037,7 @@ BOOLEAN btif_hl_find_app_idx_using_mdepId(UINT8 mdep_id, UINT8 *p_app_idx){
     BOOLEAN found=FALSE;
     UINT8 i;
 
+    *p_app_idx = 0;
     for (i=0; i < BTA_HL_NUM_APPS ; i ++)
     {
         BTIF_TRACE_DEBUG1("btif_hl_find_app_idx_using_mdepId: MDEP-ID = %d",
@@ -2635,7 +2647,6 @@ static BOOLEAN btif_hl_proc_cch_open_cfm(tBTA_HL *p_data)
     BOOLEAN                  status = FALSE;
     tBTA_HL_DCH_OPEN_PARAM   dch_open;
 
-
     BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
 
     if (btif_hl_find_app_idx_using_app_id(p_data->cch_open_cfm.app_id, &app_idx))
@@ -4131,7 +4142,7 @@ static bt_status_t connect_channel(int app_id, bt_bdaddr_t *bd_addr, int mdep_cf
 **
 *******************************************************************************/
 static bt_status_t destroy_channel(int channel_id){
-    UINT8 app_idx, mcl_idx, mdl_idx, mdl_cfg_idx, app_id, mdep_cfg_idx;
+    UINT8 app_idx, mcl_idx, mdl_idx, mdl_cfg_idx, app_id, mdep_cfg_idx = 0;
     bt_status_t status = BT_STATUS_SUCCESS;
     btif_hl_mdl_cfg_t     *p_mdl;
     btif_hl_mcl_cb_t     *p_mcb;
index 9bd771a..1f66a46 100644 (file)
@@ -847,6 +847,7 @@ BOOLEAN btm_get_local_div (BD_ADDR bd_addr, UINT16 *p_div)
                      bd_addr[2],bd_addr[3],
                      bd_addr[4],bd_addr[5]);
 
+    *p_div = 0;
     p_dev_rec = btm_find_dev (bd_addr);
 
     if (p_dev_rec && p_dev_rec->ble.keys.div)