From 195e1b89b19e17605b477e83cdb5d05c4cc308d5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 8 Nov 2016 12:21:46 +0200 Subject: [PATCH] Bluetooth: Fix usage of C++ reserved word 'private' is a C++ reserved word and will lead to compilation errors: C++ ble.o In file included from ble.cpp:7:0: include/bluetooth/bluetooth.h:284:10: error: expected unqualified-id before 'private' uint8_t private[4]; Change-Id: I36aef5a84af4fc66e1c810bd0c56e5ab5f803294 Signed-off-by: Johan Hedberg --- include/bluetooth/bluetooth.h | 2 +- subsys/bluetooth/host/hci_core.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/bluetooth/bluetooth.h b/include/bluetooth/bluetooth.h index 800575f274e..7190d3ac9d3 100644 --- a/include/bluetooth/bluetooth.h +++ b/include/bluetooth/bluetooth.h @@ -281,7 +281,7 @@ int bt_le_oob_get_local(struct bt_le_oob *oob); /** @brief BR/EDR discovery result structure */ struct bt_br_discovery_result { /** private */ - uint8_t private[4]; + uint8_t _priv[4]; /** Remote device address */ bt_addr_t addr; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 613672a7de1..82aa7ea7593 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1578,7 +1578,7 @@ static void report_discovery_results(void) for (i = 0; i < discovery_results_count; i++) { struct discovery_priv *priv; - priv = (struct discovery_priv *)&discovery_results[i].private; + priv = (struct discovery_priv *)&discovery_results[i]._priv; if (eir_has_name(discovery_results[i].eir)) { continue; @@ -1673,7 +1673,7 @@ static void inquiry_result_with_rssi(struct net_buf *buf) return; } - priv = (struct discovery_priv *)&result->private; + priv = (struct discovery_priv *)&result->_priv; priv->pscan_rep_mode = evt->pscan_rep_mode; priv->clock_offset = evt->clock_offset; @@ -1705,7 +1705,7 @@ static void extended_inquiry_result(struct net_buf *buf) return; } - priv = (struct discovery_priv *)&result->private; + priv = (struct discovery_priv *)&result->_priv; priv->pscan_rep_mode = evt->pscan_rep_mode; priv->clock_offset = evt->clock_offset; @@ -1728,7 +1728,7 @@ static void remote_name_request_complete(struct net_buf *buf) return; } - priv = (struct discovery_priv *)&result->private; + priv = (struct discovery_priv *)&result->_priv; priv->resolving = 0; if (evt->status) { @@ -1779,7 +1779,7 @@ check_names: for (i = 0; i < discovery_results_count; i++) { struct discovery_priv *priv; - priv = (struct discovery_priv *)&discovery_results[i].private; + priv = (struct discovery_priv *)&discovery_results[i]._priv; if (priv->resolving) { return; @@ -4087,7 +4087,7 @@ int bt_br_discovery_stop(void) struct bt_hci_cp_remote_name_cancel *cp; struct net_buf *buf; - priv = (struct discovery_priv *)&discovery_results[i].private; + priv = (struct discovery_priv *)&discovery_results[i]._priv; if (!priv->resolving) { continue;