本文整理汇总了C++中IS_NODE函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_NODE函数的具体用法?C++ IS_NODE怎么用?C++ IS_NODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IS_NODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: node_remove_wire
gint
node_remove_wire (Node *node, Wire *wire)
{
gboolean dot;
g_return_val_if_fail (node != NULL, FALSE);
g_return_val_if_fail (IS_NODE (node), FALSE);
g_return_val_if_fail (wire != NULL, FALSE);
g_return_val_if_fail (IS_WIRE (wire), FALSE);
if (node->wire_count == 0)
return FALSE;
if (!g_slist_find (node->wires, wire)) {
NG_DEBUG ("node_remove_wire: not there.\n");
return FALSE;
}
dot = node_needs_dot (node);
node->wires = g_slist_remove (node->wires, wire);
node->wire_count--;
if (dot && (!node_needs_dot (node)))
g_signal_emit_by_name (G_OBJECT (node), "node_dot_removed", &node->key);
return TRUE;
}
示例2: fs_ptree_new_node
nodeid fs_ptree_new_node(fs_ptree *pt)
{
if (pt->header->node_free != FS_PTREE_NULL_NODE) {
nodeid n = pt->header->node_free;
if (!IS_NODE(n)) {
fs_error(LOG_ERR, "got free'd node (%08x) that is actually a leaf", n);
} else {
node *nr = NODE_REF(pt, n);
pt->header->node_free = nr->branch[0];
for (int i=0; i<FS_PTREE_BRANCHES; i++) {
nr->branch[i] = FS_PTREE_NULL_NODE;
}
return n;
}
}
if (pt->header->node_base == pt->header->node_size) {
fs_ptree_grow_nodes(pt);
}
nodeid n = pt->header->node_base | 0x80000000;
pt->header->node_base++;
pt->header->node_count++;
node *nn = NODE_REF(pt, n);
for (int i=0; i<FS_PTREE_BRANCHES; i++) {
nn->branch[i] = FS_PTREE_NULL_NODE;
}
return n;
}
示例3: node_add_wire
gint
node_add_wire (Node *node, Wire *wire)
{
gboolean dot;
g_return_val_if_fail (node != NULL, FALSE);
g_return_val_if_fail (IS_NODE (node), FALSE);
g_return_val_if_fail (wire != NULL, FALSE);
g_return_val_if_fail (IS_WIRE (wire), FALSE);
if (g_slist_find (node->wires, wire)) {
NG_DEBUG ("node_add_wire: wire already there.\n");
return FALSE;
}
dot = node_needs_dot (node);
node->wires = g_slist_prepend (node->wires, wire);
node->wire_count++;
if (!dot && node_needs_dot (node))
g_signal_emit_by_name (G_OBJECT (node), "node_dot_added", &node->key);
return TRUE;
}
示例4: fmalloc
FeriteAMTTree *ferite_amt_compressed_dup( FeriteScript *script, FeriteAMTTree *tree, void*(*dup)(FeriteScript*,void*,void*), void *extra ) {
FeriteAMTTree *newTree = fmalloc(sizeof(FeriteAMTTree));
memset(newTree, 0, sizeof(FeriteAMTTree));
newTree->map = tree->map;
newTree->index_type = tree->index_type;
newTree->base_size = tree->base_size;
newTree->base = ferite_amt_create_base( script, newTree->base_size );
if( newTree->map ) {
int i = 0;
FeriteAMTNode *node = NULL;
for( i = 0; i < newTree->base_size; i++ ) {
if( (node = tree->base[i]) != NULL ) {
newTree->base[i] = fmalloc(sizeof(FeriteAMTNode));
memset(newTree->base[i], 0, sizeof(FeriteAMTNode));
newTree->base[i]->type = node->type;
if( IS_NODE(node) ) {
newTree->base[i]->u.value.id = node->u.value.id;
newTree->base[i]->u.value.data = (dup ? (dup)( script, node->u.value.data, extra ) : node->u.value.data);
newTree->base[i]->u.value.key = NULL;
if( node->u.value.key ) {
newTree->base[i]->u.value.key = fstrdup(node->u.value.key);
}
} else if( node->type == FeriteAMTType_Tree ) {
newTree->base[i]->u.tree = __ferite_amt_tree_dup( script, node->u.tree, dup, extra );
}
}
}
}
return newTree;
}
示例5: node_set_visited
void
node_set_visited (Node *node, gboolean is_visited)
{
g_return_if_fail (node != NULL);
g_return_if_fail (IS_NODE (node));
node->visited = is_visited;
}
示例6: node_is_visited
gint
node_is_visited (Node *node)
{
g_return_val_if_fail (node != NULL, FALSE);
g_return_val_if_fail (IS_NODE (node), FALSE);
return node->visited;
}
示例7: reset_pnodes
int reset_pnodes(int curr, int pnode)
{
struct msm_bus_inode_info *info;
struct msm_bus_fabric_device *fabdev;
int index, next_pnode;
fabdev = msm_bus_get_fabric_device(GET_FABID(curr));
if (!fabdev) {
MSM_BUS_ERR("Fabric not found for: %d\n",
(GET_FABID(curr)));
return -ENXIO;
}
index = GET_INDEX(pnode);
info = fabdev->algo->find_node(fabdev, curr);
if (!info) {
MSM_BUS_ERR("Cannot find node info!\n");
return -ENXIO;
}
MSM_BUS_DBG("Starting the loop--remove\n");
do {
struct msm_bus_inode_info *hop;
fabdev = msm_bus_get_fabric_device(GET_FABID(curr));
if (!fabdev) {
MSM_BUS_ERR("Fabric not found\n");
return -ENXIO;
}
next_pnode = info->pnode[index].next;
info->pnode[index].next = -2;
curr = GET_NODE(next_pnode);
index = GET_INDEX(next_pnode);
if (IS_NODE(curr))
hop = fabdev->algo->find_node(fabdev, curr);
else
hop = fabdev->algo->find_gw_node(fabdev, curr);
if (!hop) {
MSM_BUS_ERR("Null Info found for hop\n");
return -ENXIO;
}
MSM_BUS_DBG("%d[%d] = %d\n", info->node_info->priv_id, index,
info->pnode[index].next);
MSM_BUS_DBG("num_pnodes: %d: %d\n", info->node_info->priv_id,
info->num_pnodes);
info = hop;
} while (GET_NODE(info->pnode[index].next) != info->node_info->priv_id);
info->pnode[index].next = -2;
MSM_BUS_DBG("%d[%d] = %d\n", info->node_info->priv_id, index,
info->pnode[index].next);
MSM_BUS_DBG("num_pnodes: %d: %d\n", info->node_info->priv_id,
info->num_pnodes);
return 0;
}
示例8: node_is_empty
gint
node_is_empty (Node *node)
{
g_return_val_if_fail (node != NULL, FALSE);
g_return_val_if_fail (IS_NODE (node), FALSE);
if ((node->wire_count == 0) && (node->pin_count == 0))
return TRUE;
return FALSE;
}
示例9: fs_ptree_free_leaf
void fs_ptree_free_leaf(fs_ptree *pt, nodeid n)
{
if (IS_NODE(n)) {
fs_error(LOG_ERR, "tried to free node as leaf");
return;
}
leaf *lr = LEAF_REF(pt, n);
lr->block = pt->header->leaf_free;
pt->header->leaf_free = n;
}
示例10: cgfunc_store_nodes
void* cgfunc_store_nodes(callsite_t *site, int level, int flags, void *ptr)
{
if( flags==VISIT_BACKTRACK )
return ptr;
if( IS_NODE(site) ) {
(*((void**)ptr))=site;
return ((char*)ptr)+sizeof(void*);
}
return ptr;
}
示例11: P1
parse_node_t *optimize_loop_test P1(parse_node_t *, pn) {
parse_node_t *ret;
if (IS_NODE(pn, NODE_BINARY_OP, F_LT) &&
IS_NODE(pn->l.expr, NODE_OPCODE_1, F_LOCAL)) {
if (IS_NODE(pn->r.expr, NODE_OPCODE_1, F_LOCAL)) {
CREATE_OPCODE_2(ret, F_LOOP_COND_LOCAL, 0,
pn->l.expr->l.number,
pn->r.expr->l.number);
} else if (pn->r.expr->kind == NODE_NUMBER) {
CREATE_OPCODE_2(ret, F_LOOP_COND_NUMBER, 0,
pn->l.expr->l.number,
pn->r.expr->v.number);
} else
ret = pn;
} else if (IS_NODE(pn, NODE_UNARY_OP, F_POST_DEC) &&
IS_NODE(pn->r.expr, NODE_OPCODE_1, F_LOCAL_LVALUE)) {
int lvar = pn->r.expr->l.number;
CREATE_OPCODE_1(ret, F_WHILE_DEC, 0, lvar);
} else
ret = pn;
return ret;
}
示例12: node_traverse
static void node_traverse (Node *node)
{
GSList *iter;
g_return_if_fail (node != NULL);
g_return_if_fail (IS_NODE (node));
if (node_is_visited (node))
return;
node_set_visited (node, TRUE);
for (iter = node->wires; iter; iter = iter->next) {
Wire *wire = iter->data;
wire_traverse (wire);
}
}
示例13: wire_add_node
gint wire_add_node (Wire *wire, Node *node)
{
WirePriv *priv;
g_return_val_if_fail (wire != NULL, FALSE);
g_return_val_if_fail (IS_WIRE (wire), FALSE);
g_return_val_if_fail (node != NULL, FALSE);
g_return_val_if_fail (IS_NODE (node), FALSE);
priv = wire->priv;
if (g_slist_find (priv->nodes, node)) {
return FALSE;
}
priv->nodes = g_slist_prepend (priv->nodes, node);
return TRUE;
}
示例14: node_traverse
static void
node_traverse (Node *node)
{
GSList *wires;
g_return_if_fail (node != NULL);
g_return_if_fail (IS_NODE (node));
if (node_is_visited (node))
return;
node_set_visited (node, TRUE);
for (wires = node->wires; wires; wires = wires->next) {
Wire *wire = wires->data;
wire_traverse (wire);
}
g_slist_free_full (wires, g_object_unref);
}
示例15: changeActiveLane
void Lanes::afterMerge() {
if (boundary)
return; // will be reset by changeActiveLane()
for (unsigned int i = 0; i < typeVec.size(); ++i) {
int& t = typeVec[i];
if (isHead(t) || isJoin(t) || t == CROSS)
t = NOT_ACTIVE;
else if (t == CROSS_EMPTY)
t = EMPTY;
else if (IS_NODE(t))
t = ACTIVE;
}
}