aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2011-06-08 23:30:01 +0200
committerDaniel Lezcano <daniel.lezcano@free.fr>2011-06-08 23:30:01 +0200
commitcb86e1da685c1b6d77e82b8df43434045583a6bd (patch)
treeb37764d81b8b07b3d7f7ddbe72e4f62c1ebf3261 /tree.c
parentfabe20a77d38e1e91ad0b7bf396a9f63d62c397e (diff)
downloadpowerdebug-cb86e1da685c1b6d77e82b8df43434045583a6bd.tar.gz
compute the number of children for a specific node
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tree.c b/tree.c
index 8f546a9..dd53ff2 100644
--- a/tree.c
+++ b/tree.c
@@ -57,6 +57,7 @@ static inline struct tree *tree_alloc(const char *path, int depth)
t->next = NULL;
t->prev = NULL;
t->private = NULL;
+ t->nrchild = 0;
return t;
}
@@ -161,6 +162,8 @@ static int tree_scan(struct tree *tree, tree_filter_t filter)
tree_add_child(tree, child);
+ tree->nrchild++;
+
ret = tree_scan(child, filter);
}