Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_idfgh_10045_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
Bluedroid: fixed compile warning when optimize for performance (backport v5.1)

See merge request espressif/esp-idf!24844
  • Loading branch information
jack0c committed Aug 28, 2023
2 parents 5a25786 + 62f5905 commit 60143c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ typedef union {
} search_res; /*!< Gatt client callback param of ESP_GATTC_SEARCH_RES_EVT */

/**
* @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT
* @brief ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT, ESP_GATTC_READ_MULTIPLE_EVT, ESP_GATTC_READ_MULTI_VAR_EVT
*/
struct gattc_read_char_evt_param {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ static void btc_gap_ble_get_dev_name_callback(UINT8 status, char *name)
param.get_dev_name_cmpl.status = btc_btm_status_to_esp_status(status);
param.get_dev_name_cmpl.name = (char *)osi_malloc(BTC_MAX_LOC_BD_NAME_LEN + 1);
if (param.get_dev_name_cmpl.name) {
BCM_STRNCPY_S(param.get_dev_name_cmpl.name, name, BTC_MAX_LOC_BD_NAME_LEN + 1);
BCM_STRNCPY_S(param.get_dev_name_cmpl.name, name, BTC_MAX_LOC_BD_NAME_LEN);
param.get_dev_name_cmpl.name[BTC_MAX_LOC_BD_NAME_LEN] = '\0';
} else {
param.get_dev_name_cmpl.status = ESP_BT_STATUS_NOMEM;
}
Expand Down
4 changes: 2 additions & 2 deletions components/bt/host/bluedroid/stack/gatt/gatt_sr_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static size_t calculate_database_info_size(void)
// Included service declaration
len += 8 + p_attr->p_value->incl_handle.service_type.len;
} else if (p_attr->uuid == GATT_UUID_CHAR_DECLARE) {
tBT_UUID char_uuid;
tBT_UUID char_uuid = {0};
// Characteristic declaration
p_attr = (tGATT_ATTR16 *)p_attr->p_next;
attr_uuid_to_bt_uuid((void *)p_attr, &char_uuid);
Expand Down Expand Up @@ -96,7 +96,7 @@ static void fill_database_info(UINT8 *p_data)
UINT16_TO_STREAM(p_data, p_attr->p_value->incl_handle.e_handle);
gatt_build_uuid_to_stream(&p_data, p_attr->p_value->incl_handle.service_type);
} else if (p_attr->uuid == GATT_UUID_CHAR_DECLARE) {
tBT_UUID char_uuid;
tBT_UUID char_uuid = {0};
// Characteristic declaration
UINT16_TO_STREAM(p_data, p_attr->handle);
UINT16_TO_STREAM(p_data, GATT_UUID_CHAR_DECLARE);
Expand Down

0 comments on commit 60143c7

Please sign in to comment.