diff options
-rw-r--r-- | stack/avdt/avdt_ad.c | 7 | ||||
-rw-r--r-- | stack/avrc/avrc_api.c | 10 | ||||
-rw-r--r-- | stack/avrc/avrc_opt.c | 10 | ||||
-rw-r--r-- | stack/include/wcassert.h | 65 | ||||
-rw-r--r-- | stack/mcap/mca_api.c | 20 | ||||
-rw-r--r-- | stack/mcap/mca_main.c | 6 |
6 files changed, 26 insertions, 92 deletions
diff --git a/stack/avdt/avdt_ad.c b/stack/avdt/avdt_ad.c index 3266d342f..45e6b36e9 100644 --- a/stack/avdt/avdt_ad.c +++ b/stack/avdt/avdt_ad.c @@ -22,7 +22,9 @@ * ******************************************************************************/ +#include <assert.h> #include <string.h> + #include "bt_types.h" #include "bt_target.h" #include "bt_utils.h" @@ -31,7 +33,6 @@ #include "avdt_int.h" #include "l2c_api.h" #include "l2cdefs.h" -#include "wcassert.h" /******************************************************************************* @@ -245,7 +246,7 @@ tAVDT_TC_TBL *avdt_ad_tc_tbl_by_type(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_ } } - WC_ASSERT(i != AVDT_NUM_TC_TBL); + assert(i != AVDT_NUM_TC_TBL); return p_tbl; } @@ -276,7 +277,7 @@ tAVDT_TC_TBL *avdt_ad_tc_tbl_alloc(tAVDT_CCB *p_ccb) } /* sanity check */ - WC_ASSERT(i != AVDT_NUM_TC_TBL); + assert(i != AVDT_NUM_TC_TBL); /* initialize entry */ p_tbl->peer_mtu = L2CAP_DEFAULT_MTU; diff --git a/stack/avrc/avrc_api.c b/stack/avrc/avrc_api.c index 04f59a02d..dbebb993e 100644 --- a/stack/avrc/avrc_api.c +++ b/stack/avrc/avrc_api.c @@ -21,12 +21,12 @@ * Interface to AVRCP mandatory commands * ******************************************************************************/ +#include <assert.h> #include <string.h> #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" -#include "wcassert.h" /***************************************************************************** ** Global data @@ -805,8 +805,8 @@ static BT_HDR * avrc_pass_msg(tAVRC_MSG_PASS *p_msg) BT_HDR *p_cmd = NULL; UINT8 *p_data; - WC_ASSERT(p_msg != NULL); - WC_ASSERT(AVRC_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->pass_len)); + assert(p_msg != NULL); + assert(AVRC_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->pass_len)); if ((p_cmd = (BT_HDR *) GKI_getpoolbuf(AVRC_CMD_POOL_ID)) != NULL) { @@ -1084,7 +1084,7 @@ UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt) UINT16 AVRC_PassCmd(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg) { BT_HDR *p_buf; - WC_ASSERT(p_msg != NULL); + assert(p_msg != NULL); if (p_msg) { p_msg->hdr.ctype = AVRC_CMD_CTRL; @@ -1123,7 +1123,7 @@ UINT16 AVRC_PassCmd(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg) UINT16 AVRC_PassRsp(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg) { BT_HDR *p_buf; - WC_ASSERT(p_msg != NULL); + assert(p_msg != NULL); if (p_msg) { p_buf = avrc_pass_msg(p_msg); diff --git a/stack/avrc/avrc_opt.c b/stack/avrc/avrc_opt.c index ff791557a..28a3f1afc 100644 --- a/stack/avrc/avrc_opt.c +++ b/stack/avrc/avrc_opt.c @@ -21,15 +21,13 @@ * Interface to AVRCP optional commands * ******************************************************************************/ +#include <assert.h> #include <string.h> #include "gki.h" #include "avrc_api.h" #include "avrc_int.h" -#include "wcassert.h" - - /****************************************************************************** ** ** Function avrc_vendor_msg @@ -51,13 +49,13 @@ static BT_HDR * avrc_vendor_msg(tAVRC_MSG_VENDOR *p_msg) BT_HDR *p_cmd; UINT8 *p_data; - WC_ASSERT(p_msg != NULL); + assert(p_msg != NULL); #if AVRC_METADATA_INCLUDED == TRUE - WC_ASSERT(AVRC_META_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->vendor_len)); + assert(AVRC_META_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->vendor_len)); if ((p_cmd = (BT_HDR *) GKI_getpoolbuf(AVRC_META_CMD_POOL_ID)) != NULL) #else - WC_ASSERT(AVRC_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->vendor_len)); + assert(AVRC_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->vendor_len)); if ((p_cmd = (BT_HDR *) GKI_getpoolbuf(AVRC_CMD_POOL_ID)) != NULL) #endif { diff --git a/stack/include/wcassert.h b/stack/include/wcassert.h deleted file mode 100644 index a1d7b47d0..000000000 --- a/stack/include/wcassert.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 1999-2012 Broadcom Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef WC_ASSERT_H -#define WC_ASSERT_H - - -#ifdef _DEBUG - -#include "bt_target.h" - - - -/* debug settings*/ -#ifndef WC_DEBUG_LEVEL -#define WC_DEBUG_LEVEL 0 -#endif - -#if WC_DEBUG_LEVEL == 0 - -#include "stdio.h" /* for printf()*/ - -#ifdef __cplusplus -extern "C" wc_assert(char *message, char *file, UINT32 line); -#else -void wc_assert(char *message, char *file, UINT32 line); -#endif - -#define WC_ASSERT(_x) if ( !(_x) ) wc_assert("ASSERT at %s line %d\n", __FILE__, __LINE__); -#define WC_ASSERT_ALWAYS() wc_assert("ASSERT! at %s line %d\n", __FILE__, __LINE__); - -#elif WC_DEBUG_LEVEL == 1 - -#include "assert.h" - -#define WC_ASSERT(_x) assert(_x); -#define WC_ASSERT_ALWAYS() assert(0); -#endif /* WC_DEBUG_LEVEL*/ - -#else /* _DEBUG*/ - -#ifndef WC_ASSERT -#define WC_ASSERT(_x) ; -#endif - -#ifndef WC_ASSERT_ALWAYS -#define WC_ASSERT_ALWAYS() ; -#endif - -#endif /* _DEBUG*/ -#endif /* WC_ASSERT_H*/ diff --git a/stack/mcap/mca_api.c b/stack/mcap/mca_api.c index 2a2ff8ca1..ae4cdb22b 100644 --- a/stack/mcap/mca_api.c +++ b/stack/mcap/mca_api.c @@ -22,6 +22,7 @@ * Protocol (MCAP). * ******************************************************************************/ +#include <assert.h> #include <string.h> #include "bt_target.h" @@ -31,7 +32,6 @@ #include "mca_defs.h" #include "mca_int.h" -#include "wcassert.h" #include "btu.h" @@ -125,8 +125,8 @@ tMCA_HANDLE MCA_Register(tMCA_REG *p_reg, tMCA_CTRL_CBACK *p_cback) tL2CAP_APPL_INFO l2c_cacp_appl; tL2CAP_APPL_INFO l2c_dacp_appl; - WC_ASSERT(p_reg != NULL ); - WC_ASSERT(p_cback != NULL ); + assert(p_reg != NULL ); + assert(p_cback != NULL ); MCA_TRACE_API ("MCA_Register: ctrl_psm:0x%x, data_psm:0x%x", p_reg->ctrl_psm, p_reg->data_psm); @@ -221,9 +221,9 @@ tMCA_RESULT MCA_CreateDep(tMCA_HANDLE handle, tMCA_DEP *p_dep, tMCA_CS *p_cs) tMCA_RCB *p_rcb = mca_rcb_by_handle(handle); tMCA_CS *p_depcs; - WC_ASSERT(p_dep != NULL ); - WC_ASSERT(p_cs != NULL ); - WC_ASSERT(p_cs->p_data_cback != NULL ); + assert(p_dep != NULL ); + assert(p_cs != NULL ); + assert(p_cs->p_data_cback != NULL ); MCA_TRACE_API ("MCA_CreateDep: %d", handle); if (p_rcb) @@ -508,7 +508,7 @@ tMCA_RESULT MCA_CreateMdlRsp(tMCA_CL mcl, tMCA_DEP dep, tMCA_DCB *p_dcb; MCA_TRACE_API ("MCA_CreateMdlRsp: %d dep=%d mdl_id=%d cfg=%d rsp_code=%d", mcl, dep, mdl_id, cfg, rsp_code); - WC_ASSERT(p_chnl_cfg != NULL ); + assert(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->cong) @@ -605,7 +605,7 @@ tMCA_RESULT MCA_ReconnectMdl(tMCA_CL mcl, tMCA_DEP dep, UINT16 data_psm, tMCA_DCB *p_dcb; MCA_TRACE_API ("MCA_ReconnectMdl: %d ", mcl); - WC_ASSERT(p_chnl_cfg != NULL ); + assert(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->p_tx_req || p_ccb->p_rx_msg || p_ccb->cong) @@ -674,7 +674,7 @@ tMCA_RESULT MCA_ReconnectMdlRsp(tMCA_CL mcl, tMCA_DEP dep, tMCA_DCB *p_dcb; MCA_TRACE_API ("MCA_ReconnectMdlRsp: %d ", mcl); - WC_ASSERT(p_chnl_cfg != NULL ); + assert(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->cong) @@ -739,7 +739,7 @@ tMCA_RESULT MCA_DataChnlCfg(tMCA_CL mcl, const tMCA_CHNL_CFG *p_chnl_cfg) tMCA_TC_TBL *p_tbl; MCA_TRACE_API ("MCA_DataChnlCfg: %d ", mcl); - WC_ASSERT(p_chnl_cfg != NULL ); + assert(p_chnl_cfg != NULL ); if (p_ccb) { result = MCA_NO_RESOURCES; diff --git a/stack/mcap/mca_main.c b/stack/mcap/mca_main.c index 60b99d9da..44307d24a 100644 --- a/stack/mcap/mca_main.c +++ b/stack/mcap/mca_main.c @@ -22,6 +22,7 @@ * Utility functions. * ******************************************************************************/ +#include <assert.h> #include <string.h> #include "bt_target.h" @@ -29,7 +30,6 @@ #include "mca_api.h" #include "mca_defs.h" #include "mca_int.h" -#include "wcassert.h" #include "l2c_api.h" /* Main Control block for MCA */ @@ -134,7 +134,7 @@ tMCA_TC_TBL * mca_tc_tbl_calloc(tMCA_CCB *p_ccb) } /* sanity check */ - WC_ASSERT(i != MCA_NUM_TC_TBL); + assert(i != MCA_NUM_TC_TBL); /* initialize entry */ p_tbl->peer_mtu = L2CAP_DEFAULT_MTU; @@ -175,7 +175,7 @@ tMCA_TC_TBL * mca_tc_tbl_dalloc(tMCA_DCB *p_dcb) } /* sanity check */ - WC_ASSERT(i != MCA_NUM_TC_TBL); + assert(i != MCA_NUM_TC_TBL); /* initialize entry */ p_tbl->peer_mtu = L2CAP_DEFAULT_MTU; |