本文整理汇总了C++中MASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ MASSERT函数的具体用法?C++ MASSERT怎么用?C++ MASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:foxwolf,项目名称:yjd,代码行数:43,代码来源:mlan_shim.c
示例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);
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:25,代码来源:lowerfs_ext3.c
示例3: MASSERT
void SPostProcess::DrawRBO(bool redraw)
{
if (p_prog->IsReady)
{
MASSERT(!d_RBO);
MASSERT(!d_resultRBO);
d_resultRBO->Bind(redraw);
Draw();
}
}
开发者ID:wingrime,项目名称:ShaderTestPlatform,代码行数:10,代码来源:PostProcess.cpp
示例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);
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:13,代码来源:flag.c
示例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;
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:51,代码来源:lowerfs_ext.c
示例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);
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:14,代码来源:flag.c
示例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();
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例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);
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例9: GetCentralState
Message &
ServerComponent ::
GetCentralState() const
{
MASSERT(_owner, "Can not call GetCentralState() while not attached to the server");
return _owner->GetCentralState();
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例10: DisconnectSession
bool
AbstractReflectSession ::
DisconnectSession()
{
MASSERT(IsAttachedToServer(), "Can not call DisconnectSession() while not attached to the server");
return GetOwner()->DisconnectSession(this);
}
开发者ID:ruurdadema,项目名称:muscle,代码行数:7,代码来源:AbstractReflectSession.cpp
示例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);
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例12: GetFactory
ReflectSessionFactoryRef
ServerComponent ::
GetFactory(uint16 port) const
{
MASSERT(_owner, "Can not call GetFactory() while not attached to the server");
return _owner->GetFactory(port);
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例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);
}
开发者ID:jfriesne,项目名称:muscle,代码行数:7,代码来源:ServerComponent.cpp
示例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;
}
开发者ID:goyalankit,项目名称:fast-paxos,代码行数:25,代码来源:net.cpp
示例15: GetPort
uint16
AbstractReflectSession ::
GetPort() const
{
MASSERT(IsAttachedToServer(), "Can not call GetPort() while not attached to the server");
return _ipAddressAndPort.GetPort();
}
开发者ID:ruurdadema,项目名称:muscle,代码行数:7,代码来源:AbstractReflectSession.cpp
示例16: GetLocalInterfaceAddress
const IPAddress &
AbstractReflectSession ::
GetLocalInterfaceAddress() const
{
MASSERT(IsAttachedToServer(), "Can not call LocalInterfaceAddress() while not attached to the server");
return _ipAddressAndPort.GetIPAddress();
}
开发者ID:ruurdadema,项目名称:muscle,代码行数:7,代码来源:AbstractReflectSession.cpp
示例17: MASSERT
void paxserver::do_fake_init_vc() {
node_id_t pr = nid;
view_t v;
v.backups.insert(pr);
for (const auto id : net->get_serv_ids(nid)) {
v.backups.insert((node_id_t)id);
if (pr < id) {
pr = id;
}
}
v.backups.erase(pr);
MASSERT(v.backups.size() >= 2,
"For fault tolerance, paxos generally runs"
"at least 3 servers");
v.primary = pr;
v.vid.counter = 1;
v.vid.manager = pr;
vc_state.mode = vc_state_t::ACTIVE;
vc_mgr = {};
vc_state.view = v;
vc_state.accepted_view = nullptr;
if (nid == pr) {
ts = 1ULL;
viewstamp_t last_vs_old_view = paxlog.latest_exec();
vc_state.latest_seen = last_vs_old_view;
vc_state.proposed_vid = v.vid;
LOG(l::DBG_VC, "Initial view " << v << "\n");
} else {
viewstamp_t new_vs;
new_vs.vid = vc_state.view.vid;
new_vs.ts = 0ULL;
paxlog.set_latest_exec(new_vs);
}
}
开发者ID:goyalankit,项目名称:os,代码行数:35,代码来源:paxserver.cpp
示例18: AddOutgoingMessage
status_t
AbstractReflectSession ::
AddOutgoingMessage(const MessageRef & ref)
{
MASSERT(IsAttachedToServer(), "Can not call AddOutgoingMessage() while not attached to the server");
return (_gateway()) ? _gateway()->AddOutgoingMessage(ref) : B_ERROR;
}
开发者ID:ruurdadema,项目名称:muscle,代码行数:7,代码来源:AbstractReflectSession.cpp
示例19: mlowerfs_ext3_commit_async
static int mlowerfs_ext3_commit_async(struct inode *inode, void *h,
void **wait_handle)
{
unsigned long tid = 0;
transaction_t *transaction = NULL;
handle_t *handle = h;
journal_t *journal = NULL;
int ret = 0;
MENTRY();
MASSERT(current->journal_info == handle);
transaction = handle->h_transaction;
journal = transaction->t_journal;
tid = transaction->t_tid;
/* we don't want to be blocked */
handle->h_sync = 0;
ret = _mlowerfs_ext3_journal_stop(handle);
if (ret) {
MERROR("error while stopping transaction: %d\n", ret);
goto out;
}
log_start_commit(journal, tid);
*wait_handle = (void *) tid;
out:
MRETURN(ret);
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:28,代码来源:lowerfs_ext3.c
示例20: mlowerfs_ext3_extend
static int mlowerfs_ext3_extend(struct inode *inode, unsigned int nblocks, void *h)
{
handle_t *handle = h;
int ret = 0;
MENTRY();
/* fsfilt_extend called with nblocks = 0 for testing in special cases */
if (nblocks == 0) {
handle->h_buffer_credits = 0;
MWARN("setting credits of handle %p to zero by request\n", h);
}
if (handle->h_buffer_credits > nblocks) {
ret = 0;
goto out;
}
if (_mlowerfs_ext3_journal_extend(handle, nblocks) == 0) {
ret = 0;
goto out;
}
MASSERT(inode->i_sb->s_op->dirty_inode);
inode->i_sb->s_op->dirty_inode(inode);
ret = _lowerfs_ext3_journal_restart(handle, nblocks);
out:
MRETURN(ret);
}
开发者ID:ddn-lixi,项目名称:mtfs,代码行数:29,代码来源:lowerfs_ext3.c
注:本文中的MASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论