• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IS_NODE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IS_NODE函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_NODE函数的具体用法?C++ IS_NODE怎么用?C++ IS_NODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IS_NODE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:28,代码来源:node.c


示例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;
}
开发者ID:rafl,项目名称:4store,代码行数:31,代码来源:ptree.c


示例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;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:25,代码来源:node.c


示例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;
}
开发者ID:cention,项目名称:ferite-1.1.18,代码行数:30,代码来源:ferite_amt.c


示例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;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:8,代码来源:node.c


示例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;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:8,代码来源:node.c


示例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;
}
开发者ID:Fuzion24,项目名称:SM-G900V_NA_KK_Opensource-S5-Kernel-,代码行数:55,代码来源:msm_bus_arb.c


示例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;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:11,代码来源:node.c


示例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;
}
开发者ID:rafl,项目名称:4store,代码行数:11,代码来源:ptree.c


示例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;
}
开发者ID:RSE-Cambridge,项目名称:IPM,代码行数:12,代码来源:mod_callpath_cstable.c


示例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;
}
开发者ID:quixadhal,项目名称:discworld,代码行数:24,代码来源:trees.c


示例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);
	}
}
开发者ID:LukasGibeh,项目名称:oregano,代码行数:17,代码来源:wire-item.c


示例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;
}
开发者ID:neuroidss,项目名称:oregano,代码行数:18,代码来源:wire.c


示例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);
}
开发者ID:dionysos-sf,项目名称:oregano,代码行数:19,代码来源:wire-item.c


示例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;
	}
}
开发者ID:Teivaz,项目名称:TortoiseGit,代码行数:19,代码来源:lanes.cpp


示例16: if

void Lanes::afterFork() {

	for (unsigned int i = 0; i < typeVec.size(); ++i) {

		int& t = typeVec[i];

		if (t == CROSS)
			t = NOT_ACTIVE;

		else if (isTail(t) || t == CROSS_EMPTY)
			t = EMPTY;

		if (!boundary && IS_NODE(t))
			t = ACTIVE; // boundary will be reset by changeActiveLane()
	}
	while (typeVec.back() == EMPTY) {
		typeVec.pop_back();
		nextShaVec.pop_back();
	}
}
开发者ID:Teivaz,项目名称:TortoiseGit,代码行数:20,代码来源:lanes.cpp


示例17: node_remove_pin

gint
node_remove_pin (Node *node, Pin *pin)
{
	gboolean dot;

	g_return_val_if_fail (node != NULL, FALSE);
	g_return_val_if_fail (IS_NODE (node), FALSE);
	g_return_val_if_fail (pin != NULL, FALSE);

	if (node->pin_count == 0)
		return FALSE;

	dot = node_needs_dot (node);

	node->pins = g_slist_remove (node->pins, pin);
	node->pin_count--;

	if (dot && !node_needs_dot (node))
		g_signal_emit_by_name (G_OBJECT (node), "node_dot_removed", &node->key);

	return TRUE;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:22,代码来源:node.c


示例18: node_add_pin

gint
node_add_pin (Node *node, Pin *pin)
{
	gboolean dot;

	g_return_val_if_fail (node != NULL, FALSE);
	g_return_val_if_fail (IS_NODE (node), FALSE);
	g_return_val_if_fail (pin != NULL, FALSE);

	if (g_slist_find (node->pins, pin)) {
		NG_DEBUG ("node_add_pin: pin already there.\n");
		return FALSE;
	}

	dot = node_needs_dot (node);

	node->pins = g_slist_prepend (node->pins, pin);
	node->pin_count++;

	if (!dot && node_needs_dot (node))
		g_signal_emit_by_name (G_OBJECT (node), "node_dot_added", &node->key);

	return TRUE;
}
开发者ID:wohinzd,项目名称:oregano,代码行数:24,代码来源:node.c


示例19: update_path

/**
 * update_path() - Update the path with the bandwidth and clock values, as
 * requested by the client.
 *
 * @curr: Current source node, as specified in the client vector (master)
 * @pnode: The first-hop node on the path, stored in the internal client struct
 * @req_clk: Requested clock value from the vector
 * @req_bw: Requested bandwidth value from the vector
 * @curr_clk: Current clock frequency
 * @curr_bw: Currently allocated bandwidth
 *
 * This function updates the nodes on the path calculated using getpath(), with
 * clock and bandwidth values. The sum of bandwidths, and the max of clock
 * frequencies is calculated at each node on the path. Commit data to be sent
 * to RPM for each master and slave is also calculated here.
 */
static int update_path(int curr, int pnode, unsigned long req_clk, unsigned
	long req_bw, unsigned long curr_clk, unsigned long curr_bw,
	unsigned int ctx, unsigned int cl_active_flag)
{
	int index, ret = 0;
	struct msm_bus_inode_info *info;
	int next_pnode;
	long int add_bw = req_bw - curr_bw;
	unsigned bwsum = 0;
	unsigned req_clk_hz, curr_clk_hz, bwsum_hz;
	int *master_tiers;
	struct msm_bus_fabric_device *fabdev = msm_bus_get_fabric_device
		(GET_FABID(curr));

	MSM_BUS_DBG("args: %d %d %d %lu %lu %lu %lu %u\n",
		curr, GET_NODE(pnode), GET_INDEX(pnode), req_clk, req_bw,
		curr_clk, curr_bw, ctx);
	index = GET_INDEX(pnode);
	MSM_BUS_DBG("Client passed index :%d\n", index);
	info = fabdev->algo->find_node(fabdev, curr);
	if (!info) {
		MSM_BUS_ERR("Cannot find node info!\n");
		return -ENXIO;
	}

	info->link_info.sel_bw = &info->link_info.bw[ctx];
	info->link_info.sel_clk = &info->link_info.clk[ctx];
	*info->link_info.sel_bw += add_bw;

	info->pnode[index].sel_bw = &info->pnode[index].bw[ctx];

	/**
	 * To select the right clock, AND the context with
	 * client active flag.
	 */
	info->pnode[index].sel_clk = &info->pnode[index].clk[ctx &
		cl_active_flag];
	*info->pnode[index].sel_bw += add_bw;

	info->link_info.num_tiers = info->node_info->num_tiers;
	info->link_info.tier = info->node_info->tier;
	master_tiers = info->node_info->tier;

	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;
		}
		MSM_BUS_DBG("id: %d\n", info->node_info->priv_id);

		/* find next node and index */
		next_pnode = info->pnode[index].next;
		curr = GET_NODE(next_pnode);
		index = GET_INDEX(next_pnode);
		MSM_BUS_DBG("id:%d, next: %d\n", info->
		    node_info->priv_id, curr);

		/* Get hop */
		/* check if we are here as gateway, or does the hop belong to
		 * this fabric */
		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;
		}

		hop->link_info.sel_bw = &hop->link_info.bw[ctx];
		hop->link_info.sel_clk = &hop->link_info.clk[ctx];
		*hop->link_info.sel_bw += add_bw;

		hop->pnode[index].sel_bw = &hop->pnode[index].bw[ctx];
		hop->pnode[index].sel_clk = &hop->pnode[index].clk[ctx &
			cl_active_flag];

		if (!hop->node_info->buswidth) {
			MSM_BUS_WARN("No bus width found. Using default\n");
			hop->node_info->buswidth = 8;
		}
		*hop->pnode[index].sel_clk = BW_TO_CLK_FREQ_HZ(hop->node_info->
//.........这里部分代码省略.........
开发者ID:cooldudezach,项目名称:android_kernel_zte_warplte,代码行数:101,代码来源:msm_bus_arb.c


示例20: getpath


//.........这里部分代码省略.........
				MSM_BUS_DBG("returning: %d, %d\n", GET_NODE
				(next_pnode_id), GET_INDEX(next_pnode_id));
				return next_pnode_id;
			}
		}
		next_pnode_id = CREATE_PNODE_ID(src, (info->num_pnodes + 1));
		pnode_num = add_path_node(info, next_pnode_id);
		if (pnode_num < 0) {
			MSM_BUS_ERR("Error adding path node\n");
			return -ENXIO;
		}
		MSM_BUS_DBG("returning: %d, %d\n", GET_NODE(next_pnode_id),
			GET_INDEX(next_pnode_id));
		return next_pnode_id;
	} else if (_src == _dst) {
		/*
		 * src and dest belong to same fabric, find the destination
		 * from the radix tree
		 */
		info = fabdev->algo->find_node(fabdev, dest);
		if (ZERO_OR_NULL_PTR(info)) {
			MSM_BUS_ERR("Node %d not found\n", dest);
			return -ENXIO;
		}

		ret_pnode = getpath(info->node_info->priv_id, dest);
		next_pnode_id = ret_pnode;
	} else {
		/* find the dest fabric */
		int trynextgw = true;
		struct list_head *gateways = fabdev->algo->get_gw_list(fabdev);
		list_for_each_entry(fabnodeinfo, gateways, list) {
		/* see if the destination is at a connected fabric */
			if (_dst == (fabnodeinfo->info->node_info->priv_id /
				FABRIC_ID_KEY)) {
				/* Found the fab on which the device exists */
				info = fabnodeinfo->info;
				trynextgw = false;
				ret_pnode = getpath(info->node_info->priv_id,
					dest);
				pnode_num = add_path_node(info, ret_pnode);
				if (pnode_num < 0) {
					MSM_BUS_ERR("Error adding path node\n");
					return -ENXIO;
				}
				next_pnode_id = CREATE_PNODE_ID(
					info->node_info->priv_id, pnode_num);
				break;
			}
		}

		/* find the gateway */
		if (trynextgw) {
			gateways = fabdev->algo->get_gw_list(fabdev);
			list_for_each_entry(fabnodeinfo, gateways, list) {
				struct msm_bus_fabric_device *gwfab =
					msm_bus_get_fabric_device(fabnodeinfo->
						info->node_info->priv_id);
				if (!gwfab->visited) {
					MSM_BUS_DBG("VISITED ID: %d\n",
						gwfab->id);
					gwfab->visited = true;
					info = fabnodeinfo->info;
					ret_pnode = getpath(info->
						node_info->priv_id, dest);
					pnode_num = add_path_node(info,
						ret_pnode);
					if (pnode_num < 0) {
						MSM_BUS_ERR("Malloc failure in"
						" adding path node\n");
						return -ENXIO;
					}
					next_pnode_id = CREATE_PNODE_ID(
					info->node_info->priv_id, pnode_num);
					break;
				}
			}
			if (next_pnode_id < 0)
				return -ENXIO;
		}
	}

	if (!IS_NODE(src)) {
		MSM_BUS_DBG("Returning next_pnode_id:%d[%d]\n", GET_NODE(
			next_pnode_id), GET_INDEX(next_pnode_id));
		return next_pnode_id;
	}
	info = fabdev->algo->find_node(fabdev, src);
	if (!info) {
		MSM_BUS_ERR("Node info not found.\n");
		return -ENXIO;
	}

	pnode_num = add_path_node(info, next_pnode_id);
	MSM_BUS_DBG(" Last: %d[%d] = (%d, %d)\n",
		src, info->num_pnodes, GET_NODE(next_pnode_id),
		GET_INDEX(next_pnode_id));
	MSM_BUS_DBG("returning: %d, %d\n", src, pnode_num);
	return CREATE_PNODE_ID(src, pnode_num);
}
开发者ID:cooldudezach,项目名称:android_kernel_zte_warplte,代码行数:101,代码来源:msm_bus_arb.c



注:本文中的IS_NODE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IS_NPC函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_MOBILE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap