本文整理汇总了C++中ChunkList_t::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ ChunkList_t::GetNext方法的具体用法?C++ ChunkList_t::GetNext怎么用?C++ ChunkList_t::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChunkList_t
的用法示例。
在下文中一共展示了ChunkList_t::GetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
/* @todo maybe it is better to combine chunk_get_next and chunk_get_prev
* into a common function However this should be done with the preprocessor
* to avoid addition check conditions that would be evaluated in the
* while loop of the calling function */
chunk_t *chunk_get_next(chunk_t *cur, nav_t nav)
{
if (cur == NULL)
{
return(NULL);
}
chunk_t *pc = g_cl.GetNext(cur);
if ((pc == NULL) || (nav == CNAV_ALL))
{
return(pc);
}
if (cur->flags & PCF_IN_PREPROC)
{
/* If in a preproc, return NULL if trying to leave */
if ((pc->flags & PCF_IN_PREPROC) == 0)
{
return(NULL);
}
return(pc);
}
/* Not in a preproc, skip any preproc */
while ((pc != NULL) && (pc->flags & PCF_IN_PREPROC))
{
pc = g_cl.GetNext(pc);
}
return(pc);
}
示例2: return
/* @todo maybe it is better to combine chunk_get_next and chunk_get_prev
* into a common function However this should be done with the preprocessor
* to avoid addition check conditions that would be evaluated in the
* while loop of the calling function */
chunk_t *chunk_get_next(chunk_t *cur, scope_e scope)
{
if (cur == nullptr)
{
return(nullptr);
}
chunk_t *pc = g_cl.GetNext(cur);
if (pc == nullptr || scope == scope_e::ALL)
{
return(pc);
}
if (cur->flags & PCF_IN_PREPROC)
{
// If in a preproc, return nullptr if trying to leave
if ((pc->flags & PCF_IN_PREPROC) == 0)
{
return(nullptr);
}
return(pc);
}
// Not in a preproc, skip any preproc
while (pc != nullptr && (pc->flags & PCF_IN_PREPROC))
{
pc = g_cl.GetNext(pc);
}
return(pc);
}