Use standard types, consistent ifdef style everywhere
Remove the typedefs in stack/include/bt_types.h
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__
Update script to be less disruptive to aligned assignment blocks.
Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0
diff --git a/main/bte_init.c b/main/bte_init.c
index a0b8418..a83667e 100644
--- a/main/bte_init.c
+++ b/main/bte_init.c
@@ -33,33 +33,33 @@
/* Include initialization functions definitions */
#include "port_api.h"
-#if (defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE)
+#if (BNEP_INCLUDED == TRUE)
#include "bnep_api.h"
#endif
#include "gap_api.h"
-#if (defined(PAN_INCLUDED) && PAN_INCLUDED == TRUE)
+#if (PAN_INCLUDED == TRUE)
#include "pan_api.h"
#endif
#include "avrc_api.h"
-#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
+#if (A2D_INCLUDED == TRUE)
#include "a2d_api.h"
#endif
-#if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE)
+#if (HID_HOST_INCLUDED == TRUE)
#include "hidh_api.h"
#endif
-#if (defined(MCA_INCLUDED) && MCA_INCLUDED == TRUE)
+#if (MCA_INCLUDED == TRUE)
#include "mca_api.h"
#endif
-#if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE)
+#if (BLE_INCLUDED == TRUE)
#include "gatt_api.h"
-#if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
+#if (SMP_INCLUDED == TRUE)
#include "smp_api.h"
#endif
#endif
@@ -91,10 +91,10 @@
/**************************
** BNEP and its profiles **
***************************/
-#if (defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE)
+#if (BNEP_INCLUDED == TRUE)
BNEP_Init();
-#if (defined(PAN_INCLUDED) && PAN_INCLUDED == TRUE)
+#if (PAN_INCLUDED == TRUE)
PAN_Init();
#endif /* PAN */
#endif /* BNEP Included */
@@ -103,7 +103,7 @@
/**************************
** AVDT and its profiles **
***************************/
-#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
+#if (A2D_INCLUDED == TRUE)
A2D_Init();
#endif /* AADP */
@@ -116,11 +116,11 @@
************/
GAP_Init();
-#if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE)
+#if (HID_HOST_INCLUDED == TRUE)
HID_HostInit();
#endif
-#if (defined(MCA_INCLUDED) && MCA_INCLUDED == TRUE)
+#if (MCA_INCLUDED == TRUE)
MCA_Init();
#endif
diff --git a/main/bte_logmsg.c b/main/bte_logmsg.c
index 4a59eac..f988011 100644
--- a/main/bte_logmsg.c
+++ b/main/bte_logmsg.c
@@ -41,19 +41,19 @@
#include "sdp_api.h"
#include "stack_config.h"
-#if (AVDT_INCLUDED==TRUE)
+#if (AVDT_INCLUDED == TRUE)
#include "avdt_api.h"
#endif
-#if (A2D_INCLUDED==TRUE)
+#if (A2D_INCLUDED == TRUE)
#include "a2d_api.h"
#endif
-#if (BNEP_INCLUDED==TRUE)
+#if (BNEP_INCLUDED == TRUE)
#include "bnep_api.h"
#endif
-#if (PAN_INCLUDED==TRUE)
+#if (PAN_INCLUDED == TRUE)
#include "pan_api.h"
#endif
-#if (BLE_INCLUDED==TRUE)
+#if (BLE_INCLUDED == TRUE)
#include "gatt_api.h"
#include "smp_api.h"
#endif
@@ -131,26 +131,26 @@
{BTTRC_ID_STK_BTU, BTTRC_ID_STK_HCI, BTU_SetTraceLevel, "TRC_HCI", DEFAULT_CONF_TRACE_LEVEL},
{BTTRC_ID_STK_L2CAP, BTTRC_ID_STK_L2CAP, L2CA_SetTraceLevel, "TRC_L2CAP", DEFAULT_CONF_TRACE_LEVEL},
{BTTRC_ID_STK_RFCOMM, BTTRC_ID_STK_RFCOMM_DATA, PORT_SetTraceLevel, "TRC_RFCOMM", DEFAULT_CONF_TRACE_LEVEL},
-#if (AVDT_INCLUDED==TRUE)
+#if (AVDT_INCLUDED == TRUE)
{BTTRC_ID_STK_AVDT, BTTRC_ID_STK_AVDT, AVDT_SetTraceLevel, "TRC_AVDT", DEFAULT_CONF_TRACE_LEVEL},
#endif
{BTTRC_ID_STK_AVRC, BTTRC_ID_STK_AVRC, AVRC_SetTraceLevel, "TRC_AVRC", DEFAULT_CONF_TRACE_LEVEL},
-#if (AVDT_INCLUDED==TRUE)
+#if (AVDT_INCLUDED == TRUE)
//{BTTRC_ID_AVDT_SCB, BTTRC_ID_AVDT_CCB, NULL, "TRC_AVDT_SCB", DEFAULT_CONF_TRACE_LEVEL},
#endif
-#if (A2D_INCLUDED==TRUE)
+#if (A2D_INCLUDED == TRUE)
{BTTRC_ID_STK_A2D, BTTRC_ID_STK_A2D, A2D_SetTraceLevel, "TRC_A2D", DEFAULT_CONF_TRACE_LEVEL},
#endif
-#if (BNEP_INCLUDED==TRUE)
+#if (BNEP_INCLUDED == TRUE)
{BTTRC_ID_STK_BNEP, BTTRC_ID_STK_BNEP, BNEP_SetTraceLevel, "TRC_BNEP", DEFAULT_CONF_TRACE_LEVEL},
#endif
{BTTRC_ID_STK_BTM_ACL, BTTRC_ID_STK_BTM_SEC, BTM_SetTraceLevel, "TRC_BTM", DEFAULT_CONF_TRACE_LEVEL},
{BTTRC_ID_STK_GAP, BTTRC_ID_STK_GAP, GAP_SetTraceLevel, "TRC_GAP", DEFAULT_CONF_TRACE_LEVEL},
-#if (PAN_INCLUDED==TRUE)
+#if (PAN_INCLUDED == TRUE)
{BTTRC_ID_STK_PAN, BTTRC_ID_STK_PAN, PAN_SetTraceLevel, "TRC_PAN", DEFAULT_CONF_TRACE_LEVEL},
#endif
{BTTRC_ID_STK_SDP, BTTRC_ID_STK_SDP, SDP_SetTraceLevel, "TRC_SDP", DEFAULT_CONF_TRACE_LEVEL},
-#if (BLE_INCLUDED==TRUE)
+#if (BLE_INCLUDED == TRUE)
{BTTRC_ID_STK_GATT, BTTRC_ID_STK_GATT, GATT_SetTraceLevel, "TRC_GATT", DEFAULT_CONF_TRACE_LEVEL},
{BTTRC_ID_STK_SMP, BTTRC_ID_STK_SMP, SMP_SetTraceLevel, "TRC_SMP", DEFAULT_CONF_TRACE_LEVEL},
#endif
diff --git a/main/bte_main.c b/main/bte_main.c
index aa5e15a..9f521d9 100644
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -153,7 +153,7 @@
******************************************************************************/
void bte_main_enable()
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
module_start_up(get_module(BTSNOOP_MODULE));
module_start_up(get_module(HCI_MODULE));
@@ -173,7 +173,7 @@
******************************************************************************/
void bte_main_disable(void)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
module_shut_down(get_module(HCI_MODULE));
module_shut_down(get_module(BTSNOOP_MODULE));
@@ -195,7 +195,7 @@
hci->do_postload();
}
-#if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE)
+#if (HCILP_INCLUDED == TRUE)
/******************************************************************************
**
** Function bte_main_enable_lpm
@@ -205,7 +205,7 @@
** Returns None
**
******************************************************************************/
-void bte_main_enable_lpm(BOOLEAN enable)
+void bte_main_enable_lpm(bool enable)
{
hci->send_low_power_command(enable ? LPM_ENABLE : LPM_DISABLE);
}
@@ -251,9 +251,9 @@
** Returns None
**
******************************************************************************/
-void bte_main_hci_send (BT_HDR *p_msg, UINT16 event)
+void bte_main_hci_send (BT_HDR *p_msg, uint16_t event)
{
- UINT16 sub_event = event & BT_SUB_EVT_MASK; /* local controller ID */
+ uint16_t sub_event = event & BT_SUB_EVT_MASK; /* local controller ID */
p_msg->event = event;