本文整理汇总了C++中MASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ MASSERT函数的具体用法?C++ MASSERT怎么用?C++ MASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mlan_send_packet
/**
* @brief Function to send packet
*
* @param pmlan_adapter A pointer to mlan_adapter structure
* @param pmbuf A pointer to mlan_buffer structure
*
* @return MLAN_STATUS_PENDING
*/
mlan_status
mlan_send_packet(IN t_void * pmlan_adapter, IN pmlan_buffer pmbuf)
{
mlan_status ret = MLAN_STATUS_PENDING;
mlan_adapter *pmadapter = (mlan_adapter *) pmlan_adapter;
ENTER();
MASSERT(pmlan_adapter && pmbuf);
MASSERT(pmbuf->bss_index < pmadapter->priv_num);
pmbuf->flags = MLAN_BUF_FLAG_MOAL_TX_BUF;
if (((pmadapter->priv[pmbuf->bss_index]->port_ctrl_mode == MTRUE) &&
((mlan_ntohs(*(t_u16 *) & pmbuf->pbuf[pmbuf->data_offset +
MLAN_ETHER_PKT_TYPE_OFFSET]) ==
MLAN_ETHER_PKT_TYPE_EAPOL)
||
(mlan_ntohs
(*(t_u16 *) & pmbuf->
pbuf[pmbuf->data_offset + MLAN_ETHER_PKT_TYPE_OFFSET]) ==
MLAN_ETHER_PKT_TYPE_WAPI)
))
|| (pmbuf->buf_type == MLAN_BUF_TYPE_RAW_DATA)
) {
PRINTM(MINFO, "mlan_send_pkt(): enq(bybass_txq)\n");
wlan_add_buf_bypass_txqueue(pmadapter, pmbuf);
} else {
/* Transmit the packet */
wlan_wmm_add_buf_txqueue(pmadapter, pmbuf);
}
LEAVE();
return ret;
}
示例2: MENTRY
static void *mlowerfs_ext3_start(struct inode *inode, int op)
{
int nblocks = EXT3_SINGLEDATA_TRANS_BLOCKS;
//journal_t *journal = NULL;
void *handle = NULL;
MENTRY();
if (current->journal_info) {
goto journal_start;
}
/* Increase block number according to operation type */
journal_start:
MASSERT(nblocks > 0);
handle = _mlowerfs_ext3_journal_start(inode, nblocks);
if (!IS_ERR(handle)) {
MASSERT(current->journal_info == handle);
} else {
MERROR("error starting handle for op %u (%u credits): rc %ld\n",
op, nblocks, PTR_ERR(handle));
}
MRETURN(handle);
}
示例3: MASSERT
void SPostProcess::DrawRBO(bool redraw)
{
if (p_prog->IsReady)
{
MASSERT(!d_RBO);
MASSERT(!d_resultRBO);
d_resultRBO->Bind(redraw);
Draw();
}
}
示例4: mtfs_branch_getflag
int mtfs_branch_getflag(struct inode *inode, mtfs_bindex_t bindex, __u32 *mtfs_flag)
{
struct inode *hidden_inode = mtfs_i2branch(inode, bindex);
struct mtfs_lowerfs *lowerfs = mtfs_i2blowerfs(inode, bindex);
int ret = 0;
MENTRY();
MASSERT(hidden_inode);
MASSERT(lowerfs);
ret = mlowerfs_getflag(lowerfs, hidden_inode, mtfs_flag);
MRETURN(ret);
}
示例5: ext_support_init
static int ext_support_init(void)
{
int ret = 0;
unsigned long address = 0;
MDEBUG("registering mtfs lowerfs for ext\n");
ret = mtfs_symbol_get("ext3", "ext3_bread", &address, &_mlowerfs_ext3_bread_owner);
if (ret) {
MERROR("failed to get address of symbple ext3_bread, ret = %d\n", ret);
goto out;
}
MASSERT(_mlowerfs_ext3_bread_owner != NULL);
_mlowerfs_ext3_bread_pointer = (_mlowerfs_ext3_bread_t)address;
ret = mtfs_symbol_get("ext3", "ext3_iget", &address, &_mlowerfs_ext3_iget_owner);
if (ret) {
MERROR("failed to get address of symbple ext3_bread, ret = %d\n", ret);
goto out_ext3_bread_put;
}
MASSERT(_mlowerfs_ext3_iget_owner != NULL);
_mlowerfs_ext3_iget_pointer = (_mlowerfs_ext3_iget_t)address;
ret = mlowerfs_register(&lowerfs_ext2);
if (ret) {
MERROR("failed to register lowerfs for ext2, ret = %d\n", ret);
goto out_ext3_iget_put;
}
ret = mlowerfs_register(&lowerfs_ext3);
if (ret) {
MERROR("failed to register lowerfs for ext3, ret = %d\n", ret);
goto out_unregister_ext2;
}
ret = mlowerfs_register(&lowerfs_ext4);
if (ret) {
MERROR("failed to register lowerfs for ext4, ret = %d\n", ret);
goto out_unregister_ext3;
}
goto out;
out_unregister_ext3:
mlowerfs_unregister(&lowerfs_ext3);
out_unregister_ext2:
mlowerfs_unregister(&lowerfs_ext2);
out_ext3_iget_put:
mtfs_symbol_put(_mlowerfs_ext3_iget_owner);
out_ext3_bread_put:
mtfs_symbol_put(_mlowerfs_ext3_bread_owner);
out:
return ret;
}
示例6: mtfs_branch_invalidate_flag
int mtfs_branch_invalidate_flag(struct inode *inode, mtfs_bindex_t bindex, __u32 valid_flags)
{
struct inode *hidden_inode = mtfs_i2branch(inode, bindex);
struct mtfs_lowerfs *lowerfs = NULL;
int ret = 0;
MENTRY();
MASSERT(hidden_inode);
lowerfs = mtfs_i2blowerfs(inode, bindex);
MASSERT(lowerfs);
ret = mlowerfs_invalidate(lowerfs, hidden_inode, valid_flags);
MRETURN(ret);
}
示例7: GetSessions
const Hashtable<const String *, AbstractReflectSessionRef> &
ServerComponent ::
GetSessions() const
{
MASSERT(_owner, "Can not call GetSessions() while not attached to the server");
return _owner->GetSessions();
}
示例8: RemoveAcceptFactory
status_t
ServerComponent ::
RemoveAcceptFactory(uint16 port, const IPAddress & optInterfaceIP)
{
MASSERT(_owner, "Can not call RemoveAcceptFactory() while not attached to the server");
return _owner->RemoveAcceptFactory(port, optInterfaceIP);
}
示例9: GetCentralState
Message &
ServerComponent ::
GetCentralState() const
{
MASSERT(_owner, "Can not call GetCentralState() while not attached to the server");
return _owner->GetCentralState();
}
示例10: DisconnectSession
bool
AbstractReflectSession ::
DisconnectSession()
{
MASSERT(IsAttachedToServer(), "Can not call DisconnectSession() while not attached to the server");
return GetOwner()->DisconnectSession(this);
}
示例11: PutAcceptFactory
status_t
ServerComponent ::
PutAcceptFactory(uint16 port, const ReflectSessionFactoryRef & factoryRef, const IPAddress & optInterfaceIP, uint16 * optRetPort)
{
MASSERT(_owner, "Can not call PutAcceptFactory() while not attached to the server");
return _owner->PutAcceptFactory(port, factoryRef, optInterfaceIP, optRetPort);
}
示例12: GetFactory
ReflectSessionFactoryRef
ServerComponent ::
GetFactory(uint16 port) const
{
MASSERT(_owner, "Can not call GetFactory() while not attached to the server");
return _owner->GetFactory(port);
}
示例13: AddNewDormantConnectSession
status_t
ServerComponent ::
AddNewDormantConnectSession(const AbstractReflectSessionRef & ref, const IPAddress & ip, uint16 port, uint64 autoReconnectDelay, uint64 maxAsyncConnectPeriod)
{
MASSERT(_owner, "Can not call AddNewDormantConnectSession() while not attached to the server");
return _owner->AddNewDormantConnectSession(ref, ip, port, autoReconnectDelay, maxAsyncConnectPeriod);
}
示例14: MASSERT
bool Net::send(node_t *src, node_id_t dst,
std::unique_ptr<net_msg_t> msg) {
auto inqit = inqs.find(dst);
MASSERT(inqs.count(src->get_nid()) > 0, "src unregisterd to network");
if( inqit == inqs.end() ) {
// Can happen when you send to dead node
l::og(l::DEBUG, "send: No inq for node %s\n", id_str(dst));
msg = nullptr;
return false;
}
// "NIC" fills in pkt_num and source of message
// NB: Clients can copy messages before sending them, so best to
// assign number here rather than at message creation
msg->pkt_num = net_msg_t::_pkt_num++;
msg->sent_tick = now();
msg->src = src->get_nid();
stat.tot_msg_send++;
stat.sends[src->get_nid()]++;
// Just log recv
//l::og(l::DEBUG,
// "%s %s to %s S(%03lld)\n",
// src->id_str(), msg->descr, id_str(dst), msg->pkt_num);
inqit->second->push_back(std::move(msg));
return true;
}
示例15: GetPort
uint16
AbstractReflectSession ::
GetPort() const
{
MASSERT(IsAttachedToServer(), "Can not call GetPort() while not attached to the server");
return _ipAddressAndPort.GetPort();
}