From: erg Date: Thu, 7 Dec 2006 22:49:37 +0000 (+0000) Subject: Re-do some .h files to limit exposure of internal values, .h files, X-Git-Tag: LAST_LIBGRAPH~32^2~5770 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e814275b2fca907877bf6a6ccc5f2c48d9e4230a;p=graphviz Re-do some .h files to limit exposure of internal values, .h files, and dependencies on config.h; return to a simple, concrete boolean type --- diff --git a/lib/neatogen/matrix_ops.c b/lib/neatogen/matrix_ops.c index fbb64c180..4f1db91e6 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -22,9 +22,9 @@ static double p_iteration_threshold = 1e-3; -bool +boolean power_iteration(double **square_mat, int n, int neigs, double **eigs, - double *evals, bool initialize) + double *evals, boolean initialize) { /* compute the 'neigs' top eigenvectors of 'square_mat' using power iteration */ diff --git a/lib/neatogen/matrix_ops.h b/lib/neatogen/matrix_ops.h index f851036d4..977cc306d 100644 --- a/lib/neatogen/matrix_ops.h +++ b/lib/neatogen/matrix_ops.h @@ -65,8 +65,8 @@ extern "C" { double ***CC); extern void mult_sparse_dense_mat_transpose(vtx_data *, double **, int, int, float ***); - extern bool power_iteration(double **, int, int, double **, double *, - bool); + extern boolean power_iteration(double **, int, int, double **, double *, + boolean); /***************************** diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index a81959225..23d47fdf5 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -43,7 +43,7 @@ static int Pack; /* If >= 0, layout components separately and pack together */ static char *cc_pfx = "_neato_cc"; -void neato_nodesize(node_t * n, bool flip) +void neato_nodesize(node_t * n, boolean flip) { int w; @@ -236,7 +236,7 @@ static cluster_data* cluster_map(graph_t *mastergraph, graph_t *g) /* array of arrays of node indices in each cluster */ int **cs,*cn; int i,j,nclusters=0; - bool* assigned = N_NEW(agnnodes(g), bool); + boolean* assigned = N_NEW(agnnodes(g), boolean); cluster_data *cdata = GNEW(cluster_data); cdata->ntoplevel = agnnodes(g); @@ -274,7 +274,7 @@ static cluster_data* cluster_map(graph_t *mastergraph, graph_t *g) } /* fprintf(stderr," node=%s, id=%d, ind=%d\n",n->name,n->id,ind); */ *c++=ind; - assigned[ind]=true; + assigned[ind]=TRUE; cdata->ntoplevel--; } } @@ -1365,7 +1365,7 @@ void neato_layout(Agraph_t * g) int n_cc; int i; pack_info pinfo; - bool pin; + boolean pin; cc = pccomps(g, &n_cc, cc_pfx, &pin); @@ -1376,9 +1376,9 @@ void neato_layout(Agraph_t * g) adjustNodes(gc); } if (n_cc > 1) { - bool *bp; + boolean *bp; if (pin) { - bp = N_NEW(n_cc, bool); + bp = N_NEW(n_cc, boolean); bp[0] = TRUE; } else bp = 0; diff --git a/lib/neatogen/neatoprocs.h b/lib/neatogen/neatoprocs.h index 17455a769..a6dbceb43 100644 --- a/lib/neatogen/neatoprocs.h +++ b/lib/neatogen/neatoprocs.h @@ -38,16 +38,16 @@ extern "C" { extern void heapdown(Agnode_t *); extern void heapup(Agnode_t *); extern void initial_positions(graph_t *, int); - extern int init_port(Agnode_t *, Agedge_t *, char *, bool); + extern int init_port(Agnode_t *, Agedge_t *, char *, boolean); extern void jitter3d(Agnode_t *, int); extern void jitter_d(Agnode_t *, int, int); extern Ppoly_t *makeObstacle(node_t * n, double SEP); extern void makeSelfArcs(path * P, edge_t * e, int stepx); - extern void makeSpline(edge_t *, Ppoly_t **, int, bool); + extern void makeSpline(edge_t *, Ppoly_t **, int, boolean); extern void make_spring(graph_t *, Agnode_t *, Agnode_t *, double); extern void move_node(graph_t *, int, Agnode_t *); extern int init_nop(graph_t * g, int); - extern void neato_nodesize(node_t * n, bool flip); + extern void neato_nodesize(node_t * n, boolean flip); extern void neato_cleanup(graph_t * g); extern void neato_cleanup_edge(edge_t * e); extern void neato_cleanup_graph(graph_t * g); diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 62d79d16a..8147a83ff 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -33,12 +33,12 @@ extern double drand48(void); extern void printvis(vconfig_t * cp); extern int in_poly(Ppoly_t argpoly, Ppoint_t q); -static bool spline_merge(node_t * n) +static boolean spline_merge(node_t * n) { return FALSE; } -static bool swap_ends_p(edge_t * e) +static boolean swap_ends_p(edge_t * e) { return FALSE; } @@ -534,7 +534,7 @@ getPath(edge_t * e, vconfig_t * vconfig, int chkPts, Ppoly_t ** obs, * is on or inside one of the obstacles and, if so, tells the shortest path * computation to ignore them. */ -void makeSpline(edge_t * e, Ppoly_t ** obs, int npoly, bool chkPts) +void makeSpline(edge_t * e, Ppoly_t ** obs, int npoly, boolean chkPts) { Ppolyline_t line, spline; Pvector_t slopes[2]; @@ -679,7 +679,7 @@ static int _spline_edges(graph_t * g, double SEP, int splines) * Returns 0 on success. * * The edge function is given the graph, the separation to be added - * around obstacles, and the type of edge. (At present, this is a bool, + * around obstacles, and the type of edge. (At present, this is a boolean, * with 1 meaning splines and 0 meaning line segments.) It must guarantee * that all bounding boxes are current; in particular, the bounding box of * g must reflect the addition of the edges.