static void layoutTree(treenode_t * tree)
{
rectangle *recs;
- treenode_t** nodes;
- double* areas_sorted;
int i, nc;
treenode_t* cp;
if (tree->n_children == 0) return;
nc = tree->n_children;
- nodes = N_NEW(nc, treenode_t*);
+ treenode_t** nodes = gv_calloc(nc, sizeof(treenode_t*));
cp = tree->leftchild;
for (i = 0; i < nc; i++) {
nodes[i] = cp;
}
qsort (nodes, nc, sizeof(treenode_t*), (qsort_cmpf)nodecmp);
- areas_sorted = N_NEW(nc,double);
+ double* areas_sorted = gv_calloc(nc, sizeof(double));
for (i = 0; i < nc; i++) {
areas_sorted[i] = nodes[i]->area;
}