From a50e5eae6c7cf45a6dda75225fbf2b0f40b263cc Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 18 Oct 2005 18:42:59 +0000 Subject: [PATCH] boolean -> bool (with configure checks and replacements for pre C99 compilers) --- cmd/gvpr/compile.c | 2 +- cmd/tools/gvpack.c | 6 ++-- configure.ac | 1 + lib/common/arrows.c | 2 +- lib/common/emit.c | 36 ++++++++++---------- lib/common/figgen.c | 2 +- lib/common/gdgen.c | 8 ++--- lib/common/geom.c | 8 ++--- lib/common/geom.h | 8 ++--- lib/common/globals.h | 4 +-- lib/common/hpglgen.c | 4 +-- lib/common/input.c | 6 ++-- lib/common/logic.h | 13 ++++--- lib/common/mifgen.c | 2 +- lib/common/output.c | 2 +- lib/common/postproc.c | 4 +-- lib/common/render.h | 16 ++++----- lib/common/shapes.c | 16 ++++----- lib/common/splines.c | 16 ++++----- lib/common/types.h | 68 ++++++++++++++++++------------------- lib/common/utils.c | 16 ++++----- lib/common/utils.h | 6 ++-- lib/dotgen/conc.c | 10 +++--- lib/dotgen/dotprocs.h | 2 +- lib/dotgen/dotsplines.c | 10 +++--- lib/dotgen/flat.c | 2 +- lib/dotgen/mincross.c | 12 +++---- lib/dotgen/position.c | 4 +-- lib/fdpgen/fdp.h | 2 +- lib/fdpgen/layout.c | 4 +-- lib/gvc/gvcint.h | 8 ++--- lib/gvc/gvconfig.c | 4 +-- lib/gvc/gvcproc.h | 6 ++-- lib/gvc/gvjobs.c | 2 +- lib/gvc/gvlayout.c | 2 +- lib/gvc/gvplugin.c | 6 ++-- lib/gvc/gvplugin_render.h | 2 +- lib/neatogen/defs.h | 3 -- lib/neatogen/neatoinit.c | 8 ++--- lib/neatogen/neatoprocs.h | 6 ++-- lib/neatogen/neatosplines.c | 8 ++--- lib/pack/ccomps.c | 4 +-- lib/pack/pack.c | 2 +- lib/pack/pack.h | 4 +-- 44 files changed, 180 insertions(+), 177 deletions(-) diff --git a/cmd/gvpr/compile.c b/cmd/gvpr/compile.c index 4abd0c78d..94f555816 100644 --- a/cmd/gvpr/compile.c +++ b/cmd/gvpr/compile.c @@ -1630,7 +1630,7 @@ static void checkGuard(Exnode_t * gp, char *src, int line) error_info.file = src; error_info.line = line; } - error(ERROR_WARNING, "assignment used as boolean in guard"); + error(ERROR_WARNING, "assignment used as bool in guard"); } } diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index ddbe96868..438253d0a 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -65,7 +65,7 @@ typedef struct { } pair_t; static int margin = 8; /* Default margin in packing */ -static boolean doSplines = TRUE; /* Use edges in packing */ +static bool doSplines = TRUE; /* Use edges in packing */ static pack_mode packMode = l_clust; /* Default packing mode - use clusters */ static int verbose = 0; static char **myFiles = 0; @@ -241,7 +241,7 @@ static void init_node_edge(Agraph_t * g) * libcommon. If fill is true, we use init_nop (neato -n) to * read in attributes relevant to the layout. */ -static void init_graph(Agraph_t * g, boolean fill) +static void init_graph(Agraph_t * g, bool fill) { int d; @@ -584,7 +584,7 @@ static Agraph_t *cloneGraph(Agraph_t ** gs, int cnt) Dt_t *nnames; /* dict of used node names */ Agsym_t *G_bb; Agsym_t *rv; - boolean doWarn = TRUE; + bool doWarn = TRUE; if (verbose) fprintf(stderr, "Creating clone graph\n"); diff --git a/configure.ac b/configure.ac index fc51f923a..281cb832d 100644 --- a/configure.ac +++ b/configure.ac @@ -1245,6 +1245,7 @@ AC_CHECK_HEADERS(stdarg.h stddef.h stddef.h stdlib.h stdint.h malloc.h \ sys/select.h fpu_control.h sys/fpu.h strings.h sys/socket.h sys/stat.h) AC_HEADER_TIME AC_HEADER_DIRENT +AC_HEADER_STDBOOL # Check for socklen_t AC_MSG_CHECKING([for socklen_t]) diff --git a/lib/common/arrows.c b/lib/common/arrows.c index 909d30ad7..68e84fc4e 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -229,7 +229,7 @@ double arrow_length(edge_t * e, int flag) } /* inside function for calls to bezier_clip */ -static boolean inside(inside_t * inside_context, pointf p) +static bool inside(inside_t * inside_context, pointf p) { return DIST2(p, inside_context->a.p[0]) <= inside_context->a.r[0]; } diff --git a/lib/common/emit.c b/lib/common/emit.c index 870493e58..75b882415 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -155,7 +155,7 @@ static void firstlayer(GVJ_t *job) job->layerNum = 1; } -static boolean validlayer(GVJ_t *job) +static bool validlayer(GVJ_t *job) { return (job->layerNum <= job->numLayers); } @@ -310,7 +310,7 @@ static void firstpage(GVJ_t *job) job->pagesArrayElem = job->pagesArrayFirst; } -static boolean validpage(GVJ_t *job) +static bool validpage(GVJ_t *job) { return ((job->pagesArrayElem.x >= 0) && (job->pagesArrayElem.x < job->pagesArraySize.x) @@ -330,7 +330,7 @@ static void nextpage(GVJ_t *job) } } -static boolean write_edge_test(Agraph_t * g, Agedge_t * e) +static bool write_edge_test(Agraph_t * g, Agedge_t * e) { Agraph_t *sg; int c; @@ -343,7 +343,7 @@ static boolean write_edge_test(Agraph_t * g, Agedge_t * e) return TRUE; } -static boolean write_node_test(Agraph_t * g, Agnode_t * n) +static bool write_node_test(Agraph_t * g, Agnode_t * n) { Agraph_t *sg; int c; @@ -432,7 +432,7 @@ fprintf(stderr,"pagesArrayElem = %d,%d pageSize = %g,%g pageOffset = %g,%g\n", } #if 0 -static boolean node_in_view(GVJ_t *job, node_t * n) +static bool node_in_view(GVJ_t *job, node_t * n) { boxf b; @@ -447,7 +447,7 @@ static boolean node_in_view(GVJ_t *job, node_t * n) } #endif -static boolean is_natural_number(char *sstr) +static bool is_natural_number(char *sstr) { unsigned char *str = (unsigned char *) sstr; @@ -473,14 +473,14 @@ static int layer_index(GVC_t *gvc, char *str, int all) return -1; } -static boolean selectedlayer(GVJ_t *job, char *spec) +static bool selectedlayer(GVJ_t *job, char *spec) { GVC_t *gvc = job->gvc; int n0, n1; unsigned char buf[SMALLBUF]; char *w0, *w1; agxbuf xb; - boolean rval = FALSE; + bool rval = FALSE; agxbinit(&xb, SMALLBUF, buf); agxbput(&xb, spec); @@ -512,7 +512,7 @@ static boolean selectedlayer(GVJ_t *job, char *spec) return rval; } -static boolean node_in_layer(GVJ_t *job, graph_t * g, node_t * n) +static bool node_in_layer(GVJ_t *job, graph_t * g, node_t * n) { char *pn, *pe; edge_t *e; @@ -534,7 +534,7 @@ static boolean node_in_layer(GVJ_t *job, graph_t * g, node_t * n) return FALSE; } -static boolean edge_in_layer(GVJ_t *job, graph_t * g, edge_t * e) +static bool edge_in_layer(GVJ_t *job, graph_t * g, edge_t * e) { char *pe, *pn; int cnt; @@ -554,7 +554,7 @@ static boolean edge_in_layer(GVJ_t *job, graph_t * g, edge_t * e) return FALSE; } -static boolean clust_in_layer(GVJ_t *job, graph_t * sg) +static bool clust_in_layer(GVJ_t *job, graph_t * sg) { char *pg; node_t *n; @@ -573,7 +573,7 @@ static boolean clust_in_layer(GVJ_t *job, graph_t * sg) } #if 1 -static boolean node_in_box(node_t *n, boxf b) +static bool node_in_box(node_t *n, boxf b) { return boxf_overlap(ND_bb(n), b); } @@ -689,7 +689,7 @@ static void emit_attachment(GVJ_t * job, textlabel_t * lp, splines * spl) } #if 0 -static boolean edge_in_view(GVJ_t *job, edge_t * e) +static bool edge_in_view(GVJ_t *job, edge_t * e) { int i, j, np; bezier bz; @@ -739,7 +739,7 @@ void emit_edge_graphics(GVJ_t * job, edge_t * e) bezierf bzf; splinesf offspl, tmpspl; pointf pf0, pf1, pf2 = { 0, 0 }, pf3, *offlist, *tmplist; - boolean saved = FALSE; + bool saved = FALSE; double scale, numc2; char *p; extern int xdemitState; @@ -919,7 +919,7 @@ void emit_edge_graphics(GVJ_t * job, edge_t * e) gvrender_end_context(job); } -static boolean edge_in_box(edge_t *e, boxf b) +static bool edge_in_box(edge_t *e, boxf b) { splines *spl; textlabel_t *lp; @@ -1472,7 +1472,7 @@ void emit_clusters(GVJ_t * job, Agraph_t * g, int flags) } } -static boolean is_style_delim(int c) +static bool is_style_delim(int c) { switch (c) { case '(': @@ -1534,9 +1534,9 @@ static void cleanup(void) char **parse_style(char *s) { static char *parse[FUNLIMIT]; - static boolean is_first = TRUE; + static bool is_first = TRUE; int fun = 0; - boolean in_parens = FALSE; + bool in_parens = FALSE; unsigned char buf[SMALLBUF]; char *p; int c; diff --git a/lib/common/figgen.c b/lib/common/figgen.c index b846ab92c..ad8fe5628 100644 --- a/lib/common/figgen.c +++ b/lib/common/figgen.c @@ -604,7 +604,7 @@ static void fig_polyline(point * A, int n) static void fig_user_shape(char *name, point * A, int n, int filled) { - static boolean onetime = TRUE; + static bool onetime = TRUE; if (onetime) { agerr(AGERR, "custom shapes not available with this driver\n"); onetime = FALSE; diff --git a/lib/common/gdgen.c b/lib/common/gdgen.c index a6cb5964a..ef7be1846 100644 --- a/lib/common/gdgen.c +++ b/lib/common/gdgen.c @@ -189,9 +189,9 @@ static void init2_gd(gdImagePtr im) cstk[0].penwidth = WIDTH_NORMAL; } -static boolean is_format_truecolor_capable(int Output_lang) +static bool is_format_truecolor_capable(int Output_lang) { - boolean rv = FALSE; + bool rv = FALSE; if (Output_lang == GD) { rv = TRUE; @@ -224,8 +224,8 @@ static boolean is_format_truecolor_capable(int Output_lang) static void gd_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb) { char *bgcolor_str, *truecolor_str; - boolean truecolor_p = FALSE; /* try to use cheaper paletted mode */ - boolean bg_transparent_p = FALSE; + bool truecolor_p = FALSE; /* try to use cheaper paletted mode */ + bool bg_transparent_p = FALSE; int bgcolor; external_surface = gvc->job->external_surface; diff --git a/lib/common/geom.c b/lib/common/geom.c index f8aeef29b..322f7235d 100644 --- a/lib/common/geom.c +++ b/lib/common/geom.c @@ -197,22 +197,22 @@ boxf boxf_intersect(boxf b0, boxf b1) return b; } -boolean box_overlap(box b0, box b1) +bool box_overlap(box b0, box b1) { return OVERLAP(b0, b1); } -boolean boxf_overlap(boxf b0, boxf b1) +bool boxf_overlap(boxf b0, boxf b1) { return OVERLAP(b0, b1); } -boolean box_contains(box b0, box b1) +bool box_contains(box b0, box b1) { return CONTAINS(b0, b1); } -boolean boxf_contains(boxf b0, boxf b1) +bool boxf_contains(boxf b0, boxf b1) { return CONTAINS(b0, b1); } diff --git a/lib/common/geom.h b/lib/common/geom.h index 1d30a2bb8..4821bfad9 100644 --- a/lib/common/geom.h +++ b/lib/common/geom.h @@ -79,10 +79,10 @@ extern box box_bb(box, box); extern boxf boxf_bb(boxf, boxf); extern box box_intersect(box, box); extern boxf boxf_intersect(boxf, boxf); -extern boolean box_overlap(box, box); -extern boolean boxf_overlap(boxf, boxf); -extern boolean box_contains(box, box); -extern boolean boxf_contains(boxf, boxf); +extern bool box_overlap(box, box); +extern bool boxf_overlap(boxf, boxf); +extern bool box_contains(box, box); +extern bool boxf_contains(boxf, boxf); extern box flip_rec_box(box b, point p); extern int lineToBox(pointf p1, pointf p2, boxf b); diff --git a/lib/common/globals.h b/lib/common/globals.h index 367c0235c..8cb1c4637 100644 --- a/lib/common/globals.h +++ b/lib/common/globals.h @@ -64,7 +64,7 @@ extern "C" { EXTERN int Obj; #endif - EXTERN boolean Verbose, Reduce, MemTest, Config; + EXTERN bool Verbose, Reduce, MemTest, Config; EXTERN char *HTTPServerEnVar; EXTERN char *Output_file_name; EXTERN int graphviz_errors; @@ -74,7 +74,7 @@ extern "C" { EXTERN int Show_cnt; EXTERN char** Show_boxes; /* emit code for correct box coordinates */ EXTERN int CL_type; /* NONE, LOCAL, GLOBAL */ - EXTERN boolean Concentrate; /* if parallel edges should be merged */ + EXTERN bool Concentrate; /* if parallel edges should be merged */ EXTERN double Epsilon; /* defined in input_graph */ EXTERN double Nodesep; EXTERN double Nodefactor; diff --git a/lib/common/hpglgen.c b/lib/common/hpglgen.c index d69650fb0..651ddf571 100644 --- a/lib/common/hpglgen.c +++ b/lib/common/hpglgen.c @@ -62,7 +62,7 @@ static char *Sep = ";"; static int PageWidth; /* Width of page, in points. */ static char *prefix; /* Machine-dependent prefix and suffix */ static char *suffix; -/* static boolean onetime = TRUE; */ +/* static bool onetime = TRUE; */ #define MAXLINELEN 80 static int bufcnt; /* Number of characters output on current line */ @@ -830,7 +830,7 @@ static void hpgl_polyline(point * A, int n) static void hpgl_user_shape(char *name, point * A, int n, int filled) { - static boolean onetime = TRUE; + static bool onetime = TRUE; if (onetime) { agerr(AGERR, "custom shapes not available with this driver\n"); onetime = FALSE; diff --git a/lib/common/input.c b/lib/common/input.c index 3cae9ddf9..6f0c7fd6c 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -332,13 +332,13 @@ void global_def(char *dcl, * converts a graph attribute to a point. * Returns true if the attribute ends in '!'. */ -static boolean getdoubles2pt(graph_t * g, char *name, point * result) +static bool getdoubles2pt(graph_t * g, char *name, point * result) { char *p; int i; double xf, yf; char c = '\0'; - boolean rv = FALSE; + bool rv = FALSE; if ((p = agget(g, name))) { i = sscanf(p, "%lf,%lf%c", &xf, &yf, &c); @@ -469,7 +469,7 @@ static void setRatio(graph_t * g) } } -void graph_init(graph_t * g, boolean use_rankdir) +void graph_init(graph_t * g, bool use_rankdir) { char *p; double xf; diff --git a/lib/common/logic.h b/lib/common/logic.h index 65d3d0134..715bf638e 100644 --- a/lib/common/logic.h +++ b/lib/common/logic.h @@ -21,14 +21,19 @@ extern "C" { #endif -typedef unsigned char boolean; - #define NOT(v) (!(v)) + +#if ! defined HAVE_BOOL && ! defined __cplusplus +typedef unsigned char bool; +#define false 0 +#define true NOT(false) +#endif + #ifndef FALSE -#define FALSE 0 +#define FALSE false #endif #ifndef TRUE -#define TRUE NOT(FALSE) +#define TRUE true #endif #ifndef NOTUSED diff --git a/lib/common/mifgen.c b/lib/common/mifgen.c index 36f94975e..0e7ec16f7 100644 --- a/lib/common/mifgen.c +++ b/lib/common/mifgen.c @@ -554,7 +554,7 @@ static void mif_polyline(point * A, int n) static void mif_user_shape(char *name, point * A, int n, int filled) { - static boolean onetime = TRUE; + static bool onetime = TRUE; if (onetime) { agerr(AGERR, "custom shapes not available with this driver\n"); onetime = FALSE; diff --git a/lib/common/output.c b/lib/common/output.c index 3bbf883c0..475a3e6f1 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -61,7 +61,7 @@ static void writenodeandport(FILE * fp, node_t * node, char *port) /* _write_plain: */ -static void _write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend) +static void _write_plain(GVJ_t * job, graph_t * g, FILE * f, bool extend) { int i, j, splinePoints; char *tport, *hport; diff --git a/lib/common/postproc.c b/lib/common/postproc.c index 5bb962ebe..1aed0cf3f 100644 --- a/lib/common/postproc.c +++ b/lib/common/postproc.c @@ -22,7 +22,7 @@ static int Rankdir; -static boolean Flip; +static bool Flip; static point Offset; static void place_flip_graph_label(graph_t * g); @@ -142,7 +142,7 @@ void translate_bb(graph_t * g, int rankdir) translate_bb(GD_clust(g)[c], rankdir); } -void dot_nodesize(node_t * n, boolean flip) +void dot_nodesize(node_t * n, bool flip) { double x, y; int ps; diff --git a/lib/common/render.h b/lib/common/render.h index 8c128825f..fe983a231 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -76,7 +76,7 @@ extern "C" { int must_inline; } ps_image_t; - typedef void (*nodesizefn_t) (Agnode_t *, boolean); + typedef void (*nodesizefn_t) (Agnode_t *, bool); extern void add_box(path *, box); extern void arrow_flags(Agedge_t * e, int *sflag, int *eflag); @@ -87,11 +87,11 @@ extern "C" { extern int arrowEndClip(edge_t*, point*, int, int , bezier*, int eflag); extern int arrowStartClip(edge_t*, point* ps, int, int, bezier*, int sflag); extern void attach_attrs(Agraph_t *); - extern void beginpath(path *, Agedge_t *, int, pathend_t *, boolean); + extern void beginpath(path *, Agedge_t *, int, pathend_t *, bool); extern void bezier_clip(inside_t * inside_context, - boolean(*insidefn) (inside_t * inside_context, + bool(*insidefn) (inside_t * inside_context, pointf p), pointf * sp, - boolean left_inside); + bool left_inside); extern shape_desc *bind_shape(char *name, node_t *); extern void clip_and_install(edge_t *, edge_t *, point *, int, splineInfo *); @@ -99,7 +99,7 @@ extern "C" { extern char* charsetToStr (int c); extern point coord(node_t * n); extern void do_graph_label(graph_t * sg); - extern void graph_init(graph_t * g, boolean use_rankdir); + extern void graph_init(graph_t * g, bool use_rankdir); extern void graph_cleanup(graph_t * g); extern void dotneato_args_initialize(GVC_t * gvc, int, char **); extern void dotneato_usage(int); @@ -118,7 +118,7 @@ extern "C" { extern void emit_textlines(GVJ_t*, int, textline_t*, pointf, double, char*, double, char*); extern void enqueue_neighbors(nodequeue *, Agnode_t *, int); - extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean); + extern void endpath(path *, Agedge_t *, int, pathend_t *, bool); extern void epsf_init(node_t * n); extern void epsf_free(node_t * n); extern void extend_attrs(GVJ_t * job, graph_t *g, int s_arrows, int e_arrows); @@ -134,7 +134,7 @@ extern "C" { Agsym_t * (*fun) (Agraph_t *, char *, char *)); extern int gvRenderJobs (GVC_t * gvc, graph_t * g); extern point image_size(graph_t * g, char *shapefile); - extern boolean isPolygon(node_t *); + extern bool isPolygon(node_t *); extern char *strdup_and_subst_graph(char *str, Agraph_t * g); extern char *strdup_and_subst_node(char *str, Agnode_t * n); extern char *strdup_and_subst_edge(char *str, Agedge_t * e); @@ -153,7 +153,7 @@ extern "C" { extern void osize_label(textlabel_t *, int *, int *, int *, int *); extern char **parse_style(char *s); extern void place_graph_label(Agraph_t *); - extern void place_portlabel(edge_t * e, boolean head_p); + extern void place_portlabel(edge_t * e, bool head_p); extern char *ps_string(char *s, int); extern int rank(graph_t * g, int balance, int maxiter); extern void routesplinesinit(void); diff --git a/lib/common/shapes.c b/lib/common/shapes.c index a3912eeed..802e317f8 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -57,20 +57,20 @@ static shape_desc *point_desc; static void poly_init(node_t * n); static void poly_free(node_t * n); static port poly_port(node_t * n, char *portname, char *); -static boolean poly_inside(inside_t * inside_context, pointf p); +static bool poly_inside(inside_t * inside_context, pointf p); static int poly_path(node_t* n, port* p, int side, box rv[], int *kptr); static void poly_gencode(GVJ_t * job, node_t * n); static void record_init(node_t * n); static void record_free(node_t * n); static port record_port(node_t * n, char *portname, char *); -static boolean record_inside(inside_t * inside_context, pointf p); +static bool record_inside(inside_t * inside_context, pointf p); static int record_path(node_t* n, port* p, int side, box rv[], int *kptr); static void record_gencode(GVJ_t * job, node_t * n); static void point_init(node_t * n); -static boolean epsf_inside(inside_t * inside_context, pointf p); +static bool epsf_inside(inside_t * inside_context, pointf p); static void epsf_gencode(GVJ_t * job, node_t * n); /* polygon descriptions. "polygon" with 0 sides takes all user control */ @@ -468,7 +468,7 @@ shape_kind shapeOf(node_t * n) return SH_USER; } -boolean isPolygon(node_t * n) +bool isPolygon(node_t * n) { return (ND_shape(n) && (ND_shape(n)->fns->initfn == poly_init)); } @@ -766,7 +766,7 @@ static void poly_free(node_t * n) #define GET_PORT_BOX(n,e) ((n) == (e)->head ? ED_head_port(e).bp : ED_tail_port(e).bp) -static boolean poly_inside(inside_t * inside_context, pointf p) +static bool poly_inside(inside_t * inside_context, pointf p) { static node_t *lastn; /* last node argument */ static polygon_t *poly; @@ -1189,7 +1189,7 @@ static void poly_gencode(GVJ_t * job, node_t * n) pointf P, *vertices; static point *A; static int A_size; - boolean filled; + bool filled; extern int xdemitState; char *color; @@ -1745,7 +1745,7 @@ static port record_port(node_t * n, char *portname, char *compass) * Note that this does not handle Mrecords correctly. It assumes * everything is a rectangle. */ -static boolean +static bool record_inside(inside_t * inside_context, pointf p) { @@ -1924,7 +1924,7 @@ shape_desc *bind_shape(char *name, node_t * np) return rv; } -static boolean epsf_inside(inside_t * inside_context, pointf p) +static bool epsf_inside(inside_t * inside_context, pointf p) { pointf P; double x2; diff --git a/lib/common/splines.c b/lib/common/splines.c index bb6e613b9..1b050c1cc 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -99,12 +99,12 @@ arrow_clip(edge_t * fe, edge_t * le, * The points p are in node coordinates. */ void bezier_clip(inside_t * inside_context, - boolean(*inside) (inside_t * inside_context, pointf p), - pointf * sp, boolean left_inside) + bool(*inside) (inside_t * inside_context, pointf p), + pointf * sp, bool left_inside) { pointf seg[4], best[4], pt, opt, *left, *right; double low, high, t, *idir, *odir; - boolean found; + bool found; int i; if (left_inside) { @@ -153,7 +153,7 @@ void bezier_clip(inside_t * inside_context, */ static void shape_clip0(inside_t * inside_context, node_t * n, point curve[4], - boolean left_inside) + bool left_inside) { int i, save_real_size; pointf c[4]; @@ -189,7 +189,7 @@ shape_clip0(inside_t * inside_context, node_t * n, point curve[4], void shape_clip(node_t * n, point curve[4]) { int save_real_size; - boolean left_inside; + bool left_inside; pointf c; inside_t inside_context; @@ -385,7 +385,7 @@ void add_box(path * P, box b) * to provide a polygon. */ void -beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) +beginpath(path * P, edge_t * e, int et, pathend_t * endp, bool merge) { int side, mask; node_t *n; @@ -575,7 +575,7 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) } } -void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) +void endpath(path * P, edge_t * e, int et, pathend_t * endp, bool merge) { int side, mask; node_t *n; @@ -1347,7 +1347,7 @@ makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, int sizex, } /* vladimir */ -void place_portlabel(edge_t * e, boolean head_p) +void place_portlabel(edge_t * e, bool head_p) /* place the {head,tail}label (depending on HEAD_P) of edge E */ /* N.B. Assume edges are normalized, so tail is at spl->list[0].list[0] * and head is at spl->list[spl->size-l].list[bez->size-1] diff --git a/lib/common/types.h b/lib/common/types.h index f5c24a1f9..55efdc4d4 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -53,9 +53,9 @@ extern "C" { box *bp; /* if not null, points to bbox of * rectangular area that is port target */ - boolean defined; /* if true, edge has port info at this end */ - boolean constrained; /* if true, constraints such as theta are set */ - boolean clip; /* if true, clip end to node/port shape */ + bool defined; /* if true, edge has port info at this end */ + bool constrained; /* if true, constraints such as theta are set */ + bool clip; /* if true, clip end to node/port shape */ unsigned char order; /* for mincross */ unsigned char side; /* if port is on perimeter of node, this * contains the bitwise OR of the sides (TOP, @@ -64,8 +64,8 @@ extern "C" { } port; typedef struct { - boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */ - boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */ + bool(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */ + bool(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */ } splineInfo; typedef struct pathend_t { @@ -130,8 +130,8 @@ extern "C" { } txt; htmllabel_t *html; } u; - boolean set; /* true if position is set */ - boolean html; /* true if html label */ + bool set; /* true if position is set */ + bool html; /* true if html label */ } textlabel_t; typedef struct polygon_t { /* mutable shape information for a node */ @@ -169,7 +169,7 @@ extern "C" { void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */ void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */ port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */ - boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */ + bool(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */ int (*pboxfn)(node_t* n, port* p, int side, box rv[], int *kptr); /* finds box path to reach port */ void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */ } shape_functions; @@ -181,7 +181,7 @@ extern "C" { char *name; /* as read from graph file */ shape_functions *fns; polygon_t *polygon; /* base polygon info */ - boolean usershape; + bool usershape; } shape_desc; #ifndef DISABLE_CODEGENS @@ -221,7 +221,7 @@ extern "C" { void (*beziercurve) (point * A, int n, int arrow_at_start, int arrow_at_end, int filled); void (*polyline) (point * A, int n); - boolean bezier_has_arrows; + bool bezier_has_arrows; void (*comment) (char *str); void (*textsize) (void); /* not used */ void (*user_shape) (char *name, point * A, int sides, int filled); @@ -254,8 +254,8 @@ extern "C" { node_t **av; /* allocated list of nodes in rank */ int ht1, ht2; /* height below/above centerline */ int pht1, pht2; /* as above, but only primitive nodes */ - boolean candidate; /* for transpose () */ - boolean valid; + bool candidate; /* for transpose () */ + bool valid; int cache_nc; /* caches number of crossings */ adjmatrix_t *flat; } rank_t; @@ -271,9 +271,9 @@ extern "C" { point margin; point page; point size; - boolean filled; - boolean landscape; - boolean centered; + bool filled; + bool landscape; + bool centered; ratio_t ratio_kind; } layout_t; @@ -310,10 +310,10 @@ extern "C" { textlabel_t *label; /* if the cluster has a title */ box bb; /* bounding box */ point border[4]; /* sizes of margins for graph labels */ - boolean has_labels; - boolean has_images; - boolean active; - boolean selected; + bool has_labels; + bool has_images; + bool active; + bool selected; unsigned char charset; /* input character set */ int rankdir; int ht1, ht2; /* below and above extremal ranks */ @@ -343,9 +343,9 @@ extern "C" { short minrank, maxrank; /* various flags */ - boolean has_flat_edges; - boolean showboxes; - boolean cluster_was_collapsed; + bool has_flat_edges; + bool showboxes; + bool cluster_was_collapsed; int nodesep, ranksep; node_t *ln, *rn; /* left, right nodes of bounding box */ @@ -353,11 +353,11 @@ extern "C" { /* for clusters */ node_t *leader, **rankleader; - boolean expanded; + bool expanded; char installed; char set_type; char label_pos; - boolean exact_ranksep; + bool exact_ranksep; #endif } Agraphinfo_t; @@ -425,19 +425,19 @@ extern "C" { textlabel_t *label; void *alg; char state; - boolean clustnode; - boolean active; - boolean selected; + bool clustnode; + bool active; + bool selected; #ifndef DOT_ONLY - boolean pinned; + bool pinned; short xsize, ysize; int id, heapindex, hops; double *pos, dist; #endif #ifndef NEATO_ONLY - boolean showboxes; - boolean has_port; + bool showboxes; + bool has_port; /* fast graph */ char node_type, mark, onstack; @@ -531,8 +531,8 @@ extern "C" { char label_ontop; edge_t *to_orig; /* for dot's shapes.c */ void *alg; - boolean active; - boolean selected; + bool active; + bool selected; #ifndef DOT_ONLY double factor; @@ -540,8 +540,8 @@ extern "C" { Ppolyline_t path; #endif #ifndef NEATO_ONLY - boolean showboxes; - boolean conc_opp_flag; + bool showboxes; + bool conc_opp_flag; short xpenalty; int weight; int cutvalue, tree_index; diff --git a/lib/common/utils.c b/lib/common/utils.c index 3204bc38f..4d59c957b 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -681,11 +681,11 @@ initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi, * Return true if head/tail end of edge should not be clipped * to node. */ -static boolean +static bool noClip(edge_t *e, attrsym_t* sym) { char *str; - boolean rv = FALSE; + bool rv = FALSE; if (sym) { /* mapbool isn't a good fit, because we want "" to mean TRUE */ str = agxget(e,sym->index); @@ -799,7 +799,7 @@ int common_init_edge(edge_t * e) /* addLabelBB: */ -static box addLabelBB(box bb, textlabel_t * lp, boolean flipxy) +static box addLabelBB(box bb, textlabel_t * lp, bool flipxy) { int width, height; point p = lp->p; @@ -1401,7 +1401,7 @@ utf8ToLatin1 (char* s) return ns; } -boolean overlap_node(node_t *n, boxf b) +bool overlap_node(node_t *n, boxf b) { boxf bb; inside_t ictxt; @@ -1423,7 +1423,7 @@ boolean overlap_node(node_t *n, boxf b) return ND_shape(n)->fns->insidefn(&ictxt, p); } -boolean overlap_label(textlabel_t *lp, boxf b) +bool overlap_label(textlabel_t *lp, boxf b) { double sx, sy; boxf bb; @@ -1437,7 +1437,7 @@ boolean overlap_label(textlabel_t *lp, boxf b) return OVERLAP(b, bb); } -static boolean overlap_arrow(pointf p, pointf u, double scale, int flag, boxf b) +static bool overlap_arrow(pointf p, pointf u, double scale, int flag, boxf b) { boxf bb; @@ -1449,7 +1449,7 @@ static boolean overlap_arrow(pointf p, pointf u, double scale, int flag, boxf b) return FALSE; } -static boolean overlap_bezier(bezier bz, boxf b) +static bool overlap_bezier(bezier bz, boxf b) { int i; point pp; @@ -1482,7 +1482,7 @@ static boolean overlap_bezier(bezier bz, boxf b) return FALSE; } -boolean overlap_edge(edge_t *e, boxf b) +bool overlap_edge(edge_t *e, boxf b) { int i; splines *spl; diff --git a/lib/common/utils.h b/lib/common/utils.h index 9eee0e953..0b6f7afed 100644 --- a/lib/common/utils.h +++ b/lib/common/utils.h @@ -58,9 +58,9 @@ extern "C" { extern void updateBB(graph_t * g, textlabel_t * lp); extern void compute_bb(Agraph_t *); - extern boolean overlap_node(node_t *n, boxf b); - extern boolean overlap_label(textlabel_t *lp, boxf b); - extern boolean overlap_edge(edge_t *e, boxf b); + extern bool overlap_node(node_t *n, boxf b); + extern bool overlap_label(textlabel_t *lp, boxf b); + extern bool overlap_edge(edge_t *e, boxf b); extern int processClusterEdges(graph_t * g); extern void undoClusterEdges(graph_t * g); diff --git a/lib/dotgen/conc.c b/lib/dotgen/conc.c index 0a64213fd..636c46489 100644 --- a/lib/dotgen/conc.c +++ b/lib/dotgen/conc.c @@ -25,7 +25,7 @@ #define UP 0 #define DOWN 1 -static boolean samedir(edge_t * e, edge_t * f) +static bool samedir(edge_t * e, edge_t * f) { edge_t *e0, *f0; @@ -39,13 +39,13 @@ static boolean samedir(edge_t * e, edge_t * f) * (ND_rank(e0->tail) - ND_rank(e0->head)) > 0); } -static boolean downcandidate(node_t * v) +static bool downcandidate(node_t * v) { return ((ND_node_type(v) == VIRTUAL) && (ND_in(v).size == 1) && (ND_out(v).size == 1) && (ND_label(v) == NULL)); } -static boolean bothdowncandidates(node_t * u, node_t * v) +static bool bothdowncandidates(node_t * u, node_t * v) { edge_t *e, *f; e = ND_in(u).list[0]; @@ -57,13 +57,13 @@ static boolean bothdowncandidates(node_t * u, node_t * v) return FALSE; } -static boolean upcandidate(node_t * v) +static bool upcandidate(node_t * v) { return ((ND_node_type(v) == VIRTUAL) && (ND_out(v).size == 1) && (ND_in(v).size == 1) && (ND_label(v) == NULL)); } -static boolean bothupcandidates(node_t * u, node_t * v) +static bool bothupcandidates(node_t * u, node_t * v) { edge_t *e, *f; e = ND_out(u).list[0]; diff --git a/lib/dotgen/dotprocs.h b/lib/dotgen/dotprocs.h index 7ca1bdaf7..ccab9e9bb 100644 --- a/lib/dotgen/dotprocs.h +++ b/lib/dotgen/dotprocs.h @@ -77,7 +77,7 @@ extern "C" { #if defined(_BLD_dot) && defined(_DLL) # define extern __EXPORT__ #endif - extern void dot_nodesize(Agnode_t *, boolean); + extern void dot_nodesize(Agnode_t *, bool); extern void dot_concentrate(Agraph_t *); extern void dot_mincross(Agraph_t *); extern void dot_position(Agraph_t *); diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index 4231c86fa..34bbc19a0 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -110,13 +110,13 @@ static Agedge_t *top_bound(Agedge_t *, int); #define GROWEDGES (edges = ALLOC (n_edges + CHUNK, edges, edge_t*)) -static boolean spline_merge(node_t * n) +static bool spline_merge(node_t * n) { return ((ND_node_type(n) == VIRTUAL) && ((ND_in(n).size > 1) || (ND_out(n).size > 1))); } -static boolean swap_ends_p(edge_t * e) +static bool swap_ends_p(edge_t * e) { while (ED_to_orig(e)) e = ED_to_orig(e); @@ -885,7 +885,7 @@ make_flat_adj_edges(path* P, edge_t** edges, int ind, int cnt, edge_t* e0) */ static void makeFlatEnd (spline_info_t* sp, path* P, node_t* n, edge_t* e, pathend_t* endp, - boolean isBegin) + bool isBegin) { box b; graph_t* g = n->graph; @@ -904,7 +904,7 @@ makeFlatEnd (spline_info_t* sp, path* P, node_t* n, edge_t* e, pathend_t* endp, */ static void makeBottomFlatEnd (spline_info_t* sp, path* P, node_t* n, edge_t* e, - pathend_t* endp, boolean isBegin) + pathend_t* endp, bool isBegin) { box b; graph_t* g = n->graph; @@ -2120,7 +2120,7 @@ int dir; return rv; } -static boolean pathscross(n0, n1, ie1, oe1) +static bool pathscross(n0, n1, ie1, oe1) node_t *n0, *n1; edge_t *ie1, *oe1; { diff --git a/lib/dotgen/flat.c b/lib/dotgen/flat.c index 494d4ca1c..76dfd7713 100644 --- a/lib/dotgen/flat.c +++ b/lib/dotgen/flat.c @@ -81,7 +81,7 @@ static void setbounds(node_t * v, int *bounds, int lpos, int rpos) bounds[SRB] = ord; } } else { /* forward */ - boolean onleft, onright; + bool onleft, onright; onleft = onright = FALSE; for (i = 0; (f = ND_out(v).list[i]); i++) { if (ND_order(f->head) <= lpos) { diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index 0c51ed085..c2c95e7e3 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -30,7 +30,7 @@ #define flatindex(v) ((v)->u.low) /* forward declarations */ -static boolean medians(graph_t * g, int r0, int r1); +static bool medians(graph_t * g, int r0, int r1); static int nodeposcmpf(node_t ** n0, node_t ** n1); static int edgeidcmpf(edge_t ** e0, edge_t ** e1); static void flat_breakcycles(graph_t * g); @@ -65,7 +65,7 @@ static graph_t *Root; static int GlobalMinRank, GlobalMaxRank; static edge_t **TE_list; static int *TI_list; -static boolean ReMincross; +static bool ReMincross; /* dot_mincross: * Minimize edge crossings @@ -705,7 +705,7 @@ static void init_mincross(graph_t * g) static void flat_search(graph_t * g, node_t * v) { int i, j; - boolean hascl; + bool hascl; edge_t *e, *rev; adjmatrix_t *M = GD_rank(g)[ND_rank(v)].flat; @@ -1030,7 +1030,7 @@ static void reorder(graph_t * g, int r, int reverse, int hasfixed) { int changed = 0, nelt; - boolean muststay, sawclust; + bool muststay, sawclust; node_t **vlist = GD_rank(g)[r].v; node_t **lp, **rp, **ep = vlist + GD_rank(g)[r].n; @@ -1250,12 +1250,12 @@ flat_mval(node_t * n) #define VAL(node,port) (MC_SCALE * (node)->u.order + (port).order) -static boolean medians(graph_t * g, int r0, int r1) +static bool medians(graph_t * g, int r0, int r1) { int i, j, j0, lm, rm, lspan, rspan, *list; node_t *n, **v; edge_t *e; - boolean hasfixed = FALSE; + bool hasfixed = FALSE; list = TI_list; v = GD_rank(g)[r0].v; diff --git a/lib/dotgen/position.c b/lib/dotgen/position.c index 749d8d2cb..7f7b32b3f 100644 --- a/lib/dotgen/position.c +++ b/lib/dotgen/position.c @@ -876,7 +876,7 @@ static void set_aspect(graph_t * g) { double xf = 0.0, yf = 0.0, actual, desired; node_t *n; - boolean scale_it, filled; + bool scale_it, filled; point sz; rec_bb(g, g); @@ -1144,7 +1144,7 @@ static void contain_nodes(graph_t * g) /* idealsize: * set g->drawing->size to a reasonable default. - * returns a boolean to indicate if drawing is to + * returns a bool to indicate if drawing is to * be scaled and filled */ static int idealsize(graph_t * g, double minallowed) { diff --git a/lib/fdpgen/fdp.h b/lib/fdpgen/fdp.h index e33c26e14..eb6e2eb1c 100644 --- a/lib/fdpgen/fdp.h +++ b/lib/fdpgen/fdp.h @@ -101,7 +101,7 @@ extern "C" { #endif extern void fdp_layout(Agraph_t * g); - extern void fdp_nodesize(node_t *, boolean); + extern void fdp_nodesize(node_t *, bool); extern void fdp_init_graph(Agraph_t * g); extern void fdp_init_node_edge(Agraph_t * g); extern void fdp_cleanup(Agraph_t * g); diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index 9164f1c13..f57bed89d 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -903,9 +903,9 @@ setClustNodes(graph_t* root) * How to combine parts, especially with disparate components? */ if (c_cnt > 1) { - boolean *bp; + bool *bp; if (pinned) { - bp = N_NEW(c_cnt, boolean); + bp = N_NEW(c_cnt, bool); bp[0] = TRUE; } else bp = 0; diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index bed55245e..c376ad155 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -149,7 +149,7 @@ extern "C" { #endif void *surface; /* gd or cairo surface */ - boolean external_surface; /* surface belongs to caller */ + bool external_surface; /* surface belongs to caller */ gvstyle_t *style; /* active style from gvc->styles[] */ @@ -194,7 +194,7 @@ extern "C" { pointf compscale; /* composite device scale incl: scale, zoom, dpi, y_goes_down */ pointf offset; /* composite translation */ - boolean fit_mode, + bool fit_mode, needs_refresh, click, active, @@ -246,7 +246,7 @@ extern "C" { char **info; char *config_path; - boolean config_found; + bool config_found; /* gvrender_config() */ GVJ_t *jobs; /* linked list of jobs */ @@ -276,7 +276,7 @@ extern "C" { point pb; /* page size - including margins (inches) */ boxf bb; /* graph bb in graph units, not including margins */ int rotation; /* rotation - 0 = portrait, 90 = landscape */ - boolean graph_sets_margin, graph_sets_pageSize, graph_sets_rotation; + bool graph_sets_margin, graph_sets_pageSize, graph_sets_rotation; /* layers */ char *layerDelims; /* delimiters in layer names */ diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index 649981a29..b2b2c0b1e 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -390,7 +390,7 @@ codegen_info_t *next_codegen(codegen_info_t * p) ++p; #ifdef QUARTZ_RENDER - static boolean unscanned = TRUE; + static bool unscanned = TRUE; if (!p->name && unscanned) { /* reached end of codegens but haven't yet scanned for Quicktime codegens... */ @@ -445,7 +445,7 @@ codegen_info_t *next_codegen(codegen_info_t * p) /* gvconfig - parse a config file and install the identified plugins */ -void gvconfig(GVC_t * gvc, boolean rescan) +void gvconfig(GVC_t * gvc, bool rescan) { #if 0 gvplugin_library_t **libraryp; diff --git a/lib/gvc/gvcproc.h b/lib/gvc/gvcproc.h index cdc476d01..05fae3bd1 100644 --- a/lib/gvc/gvcproc.h +++ b/lib/gvc/gvcproc.h @@ -32,12 +32,12 @@ extern "C" { /* configuration */ extern char *gvconfig_libdir(void); - extern void gvconfig(GVC_t * gvc, boolean rescan); + extern void gvconfig(GVC_t * gvc, bool rescan); extern char *gvhostname(void); /* plugins */ - extern boolean gvplugin_install(GVC_t * gvc, api_t api, + extern bool gvplugin_install(GVC_t * gvc, api_t api, char *typestr, int quality, char *packagename, char *path, gvplugin_installed_t * typeptr); extern gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *type); @@ -50,7 +50,7 @@ extern "C" { /* job */ extern void gvrender_output_filename_job(GVC_t * gvc, char *name); - extern boolean gvrender_output_langname_job(GVC_t * gvc, char *name); + extern bool gvrender_output_langname_job(GVC_t * gvc, char *name); extern GVJ_t *gvrender_first_job(GVC_t * gvc); extern GVJ_t *gvrender_next_job(GVC_t * gvc); extern void gvrender_delete_jobs(GVC_t * gvc); diff --git a/lib/gvc/gvjobs.c b/lib/gvc/gvjobs.c index e0fbb347e..d6f36abb0 100644 --- a/lib/gvc/gvjobs.c +++ b/lib/gvc/gvjobs.c @@ -75,7 +75,7 @@ void gvrender_output_filename_job(GVC_t * gvc, char *name) } /* -T switches */ -boolean gvrender_output_langname_job(GVC_t * gvc, char *name) +bool gvrender_output_langname_job(GVC_t * gvc, char *name) { if (!gvc->jobs) { output_langname_job = gvc->job = gvc->jobs = diff --git a/lib/gvc/gvlayout.c b/lib/gvc/gvlayout.c index d52b603f2..6f9866f89 100644 --- a/lib/gvc/gvlayout.c +++ b/lib/gvc/gvlayout.c @@ -37,7 +37,7 @@ #include "gvcint.h" #include "gvcproc.h" -extern void graph_init(graph_t *g, boolean use_rankdir); +extern void graph_init(graph_t *g, bool use_rankdir); extern void graph_cleanup(graph_t *g); int gvlayout_select(GVC_t * gvc, char *layout) diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index c87f78ac0..9ef7ae98e 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -67,7 +67,7 @@ char *gvplugin_api_name(api_t api) /* install a plugin description into the list of available plugins */ /* list is alpha sorted by type, the quality sorted within the type, then, if qualities are the same, last install wins */ -boolean gvplugin_install(GVC_t * gvc, api_t api, +bool gvplugin_install(GVC_t * gvc, api_t api, char *typestr, int quality, char *packagename, char *path, gvplugin_installed_t * typeptr) { @@ -255,7 +255,7 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *str) /* string buffer management - FIXME - must have 20 solutions for this same thing */ -static const char *append_buf(char sep, char *str, boolean new) +static const char *append_buf(char sep, char *str, bool new) { static char *buf; static int bufsz, pos; @@ -282,7 +282,7 @@ const char *gvplugin_list(GVC_t * gvc, api_t api, char *str) gvplugin_available_t **pnext, **plugin; const char *buf = NULL; char *s, *p, *typestr_last; - boolean new = TRUE; + bool new = TRUE; /* check for valid apis[] index */ if (api < 0) diff --git a/lib/gvc/gvplugin_render.h b/lib/gvc/gvplugin_render.h index 8b1cb67c0..98a36b1ba 100644 --- a/lib/gvc/gvplugin_render.h +++ b/lib/gvc/gvplugin_render.h @@ -44,7 +44,7 @@ extern "C" { void (*end_edges) (GVJ_t * job); void (*begin_node) (GVJ_t * job, char *nodename, long id); void (*end_node) (GVJ_t * job); - void (*begin_edge) (GVJ_t * job, char *tailname, boolean directed, + void (*begin_edge) (GVJ_t * job, char *tailname, bool directed, char *headname, long id); void (*end_edge) (GVJ_t * job); void (*begin_anchor) (GVJ_t * job, char *href, char *tooltip, diff --git a/lib/neatogen/defs.h b/lib/neatogen/defs.h index ddc7b3bdc..288f62224 100644 --- a/lib/neatogen/defs.h +++ b/lib/neatogen/defs.h @@ -74,9 +74,6 @@ extern "C" { #include extern void *gmalloc(size_t); - typedef unsigned char bool; -#define true TRUE -#define false FALSE #define DIGCOLA 1 #ifdef USE_STYLES diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 5d7813fd1..6a0d7ba73 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, boolean flip) +void neato_nodesize(node_t * n, bool flip) { int w; @@ -1180,7 +1180,7 @@ void neato_layout(Agraph_t * g) int n_cc; int i; pack_info pinfo; - boolean pin; + bool pin; cc = pccomps(g, &n_cc, cc_pfx, &pin); @@ -1191,9 +1191,9 @@ void neato_layout(Agraph_t * g) adjustNodes(gc); } if (n_cc > 1) { - boolean *bp; + bool *bp; if (pin) { - bp = N_NEW(n_cc, boolean); + bp = N_NEW(n_cc, bool); bp[0] = TRUE; } else bp = 0; diff --git a/lib/neatogen/neatoprocs.h b/lib/neatogen/neatoprocs.h index 0d949af01..37d594dfe 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 *, boolean); + extern int init_port(Agnode_t *, Agedge_t *, char *, bool); 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, boolean); + extern void makeSpline(edge_t *, Ppoly_t **, int, bool); 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); - extern void neato_nodesize(node_t * n, boolean flip); + extern void neato_nodesize(node_t * n, bool 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 d63cc3fa0..a89c71956 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 boolean spline_merge(node_t * n) +static bool spline_merge(node_t * n) { return FALSE; } -static boolean swap_ends_p(edge_t * e) +static bool 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, boolean chkPts) +void makeSpline(edge_t * e, Ppoly_t ** obs, int npoly, bool 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 boolean, + * around obstacles, and the type of edge. (At present, this is a bool, * 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. diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index d4b55be8e..568cdfc04 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -70,7 +70,7 @@ static void insertFn(Agnode_t * n, void *state) * Note that the component subgraphs do not contain any edges. These must * be obtained from the root graph. */ -Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned) +Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, bool * pinned) { int c_cnt = 0; char buffer[SMALLBUF]; @@ -80,7 +80,7 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned) Agraph_t **ccs; int len; int bnd = 10; - boolean pin = FALSE; + bool pin = FALSE; if (agnnodes(g) == 0) { *ncc = 0; diff --git a/lib/pack/pack.c b/lib/pack/pack.c index 2fd2527b4..8e564ff1e 100644 --- a/lib/pack/pack.c +++ b/lib/pack/pack.c @@ -578,7 +578,7 @@ point *putGraphs(int ng, Agraph_t ** gs, Agraph_t * root, point *places; Dict_t *ps; int i; - boolean *fixed = pinfo->fixed; + bool *fixed = pinfo->fixed; int fixed_cnt = 0; box fixed_bb = { {0, 0}, {0, 0} }; point center; diff --git a/lib/pack/pack.h b/lib/pack/pack.h index 384a94420..7c8b415ea 100644 --- a/lib/pack/pack.h +++ b/lib/pack/pack.h @@ -44,7 +44,7 @@ extern "C" { unsigned int margin; /* margin left around objects, in points */ int doSplines; /* use splines in constructing graph shape */ pack_mode mode; /* granularity and method */ - boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */ + bool *fixed; /* fixed[i] == true implies g[i] should not be moved */ } pack_info; extern point *putGraphs(int, Agraph_t **, Agraph_t *, pack_info *); @@ -56,7 +56,7 @@ extern "C" { extern int isConnected(Agraph_t *); extern Agraph_t **ccomps(Agraph_t *, int *, char *); - extern Agraph_t **pccomps(Agraph_t *, int *, char *, boolean *); + extern Agraph_t **pccomps(Agraph_t *, int *, char *, bool *); extern int nodeInduce(Agraph_t *); #ifdef __cplusplus -- 2.40.0