Using the heap for a statically-known array of two pointers is inefficient. This
can just be stack-allocated, improving the compiler’s visibility and ability to
optimize. Removes a -Wsign-conversion compiler warning.
static int
vpscAdjust(graph_t* G)
{
- int dim = 2;
+ enum { dim = 2 };
int nnodes = agnnodes(G);
ipsep_options opt;
pointf* nsize = N_GNEW(nnodes, pointf);
- float** coords = N_GNEW(dim, float*);
+ float* coords[dim];
float* f_storage = N_GNEW(dim * nnodes, float);
int i, j;
Agnode_t* v;
free (opt.clusters);
free (f_storage);
- free (coords);
free (nsize);
return 0;
}