From ebf45965081fc8d93ac7598398200231280caaf2 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 11 Jan 2022 19:57:23 -0800 Subject: [PATCH] standardize on C99 bool literals for calling 'agbindrec' --- cmd/dot/dot.c | 5 +++-- cmd/mingle/minglemain.cpp | 2 +- cmd/smyrna/viewport.c | 3 ++- cmd/tools/bcomps.c | 3 ++- cmd/tools/ccomps.c | 5 +++-- cmd/tools/gv2gml.c | 3 ++- cmd/tools/gvpack.c | 8 ++++---- cmd/tools/mm2gv.c | 3 ++- cmd/tools/sccmap.c | 3 ++- doc/libgraph/sccmap.c | 2 +- lib/cgraph/attr.c | 5 +++-- lib/cgraph/cmpnd.c | 9 +++++---- lib/cgraph/edge.c | 3 ++- lib/cgraph/node.c | 3 ++- lib/cgraph/pend.c | 5 +++-- lib/circogen/blockpath.c | 15 ++++++++------- lib/circogen/blocktree.c | 3 ++- lib/circogen/circularinit.c | 11 ++++++----- lib/common/htmltable.c | 12 ++++++------ lib/common/utils.c | 12 ++++++------ lib/dotgen/dotinit.c | 13 +++++++------ lib/dotgen/dotsplines.c | 8 ++++---- lib/dotgen/mincross.c | 4 ++-- lib/dotgen/rank.c | 8 ++++---- lib/fdpgen/comp.c | 7 ++++--- lib/fdpgen/fdpinit.c | 3 ++- lib/fdpgen/layout.c | 11 ++++++----- lib/gvc/gvlayout.c | 4 ++-- lib/gvpr/compile.c | 8 ++++---- lib/neatogen/constraint.c | 17 +++++++++-------- lib/neatogen/neatoinit.c | 8 ++++---- lib/osage/osageinit.c | 4 ++-- lib/pack/ccomps.c | 14 +++++++------- lib/patchwork/patchworkinit.c | 7 ++++--- lib/sfdpgen/sfdpinit.c | 2 +- lib/twopigen/twopiinit.c | 3 ++- 36 files changed, 129 insertions(+), 107 deletions(-) diff --git a/cmd/dot/dot.c b/cmd/dot/dot.c index 8444d18ab..030c23085 100644 --- a/cmd/dot/dot.c +++ b/cmd/dot/dot.c @@ -20,6 +20,7 @@ #include +#include #include #include #ifdef HAVE_UNISTD_H @@ -70,14 +71,14 @@ static graph_t *create_test_graph(void) for (j = 0; j < NUMNODES; j++) { snprintf(name, sizeof(name), "%d", j); node[j] = agnode(g, name, 1); - agbindrec(node[j], "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(node[j], "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data } /* Connect nodes */ for (j = 0; j < NUMNODES; j++) { for (k = j + 1; k < NUMNODES; k++) { e = agedge(g, node[j], node[k], NULL, 1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data } } sg = agsubg (g, "cluster1", 1); diff --git a/cmd/mingle/minglemain.cpp b/cmd/mingle/minglemain.cpp index 2032dc543..7f2c88da3 100644 --- a/cmd/mingle/minglemain.cpp +++ b/cmd/mingle/minglemain.cpp @@ -431,7 +431,7 @@ bundle (Agraph_t* g, opts_t* opts) } k = insertPM (pm, i, j, -1); assert (k >= 0); - agbindrec (e, "info", sizeof(etoi_t), TRUE); + agbindrec (e, "info", sizeof(etoi_t), true); ED_idx(e) = k; } } diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index f92e9a97b..ae246171a 100644 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -20,6 +20,7 @@ #include "gui.h" #include "menucallbacks.h" #include +#include #include #include "glcompui.h" #include "gltemplate.h" @@ -484,7 +485,7 @@ void updateRecord (Agraph_t* g) static void graphRecord (Agraph_t* g) { - agbindrec(g, "graphRec", sizeof(graphRec), 1); + agbindrec(g, "graphRec", sizeof(graphRec), true); GG_nodelabelcolor(g) = agattr (g, AGRAPH, "nodelabelcolor", 0); GG_edgelabelcolor(g) = agattr (g, AGRAPH, "edgelabelcolor", 0); diff --git a/cmd/tools/bcomps.c b/cmd/tools/bcomps.c index 6bb1acb85..857959c5d 100644 --- a/cmd/tools/bcomps.c +++ b/cmd/tools/bcomps.c @@ -16,6 +16,7 @@ */ #include "config.h" +#include #include #include #include @@ -165,7 +166,7 @@ static Agraph_t *mkBlock(Agraph_t * g, bcstate * stp) stp->nComp++; sg = agsubg(g, blockName(agnameof(g), stp->nComp), 1); - agbindrec(sg, "info", sizeof(Agraphinfo_t), TRUE); + agbindrec(sg, "info", sizeof(Agraphinfo_t), true); NEXTBLK(sg) = stp->blks; stp->blks = sg; return sg; diff --git a/cmd/tools/ccomps.c b/cmd/tools/ccomps.c index fd54de156..80a9a4ff7 100644 --- a/cmd/tools/ccomps.c +++ b/cmd/tools/ccomps.c @@ -17,6 +17,7 @@ #include "config.h" #include +#include #include #include #include @@ -498,7 +499,7 @@ static void deriveClusters(Agraph_t* dg, Agraph_t * g) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { if (!strncmp(agnameof(subg), "cluster", 7)) { dn = agnode(dg, agnameof(subg), 1); - agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), TRUE); + agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), true); ND_ptr(dn) = (Agobj_t*)subg; for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) { if (ND_ptr(n)) { @@ -533,7 +534,7 @@ static Agraph_t *deriveGraph(Agraph_t * g) if (ND_dn(n)) continue; dn = agnode(dg, agnameof(n), 1); - agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), TRUE); + agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), true); ND_ptr(dn) = (Agobj_t*)n; ND_ptr(n) = (Agobj_t*)dn; } diff --git a/cmd/tools/gv2gml.c b/cmd/tools/gv2gml.c index e4a0a856c..c490087e4 100644 --- a/cmd/tools/gv2gml.c +++ b/cmd/tools/gv2gml.c @@ -13,6 +13,7 @@ #include "config.h" +#include #include #include #include @@ -434,7 +435,7 @@ emitNodeAttrs (Agraph_t* G, Agnode_t* np, FILE* outFile, int ix) static void emitNode (Agraph_t* G, Agnode_t* n, FILE* outFile) { - agbindrec(n, "nodeinfo", sizeof(Local_Agnodeinfo_t), TRUE); + agbindrec(n, "nodeinfo", sizeof(Local_Agnodeinfo_t), true); fprintf(outFile, " node [\n id %" PRIu64 "\n name \"%s\"\n", id, agnameof(n)); ID(n) = id++; diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index 2197b8f78..083fb3ea8 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -579,7 +579,7 @@ cloneSubg(Agraph_t * g, Agraph_t * ng, Agsym_t * G_bb, Dt_t * gnames) /* clone subgraphs */ for (subg = agfstsubg (g); subg; subg = agnxtsubg (subg)) { nsubg = agsubg(ng, xName(gnames, agnameof(subg)), 1); - agbindrec (nsubg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec (nsubg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); cloneSubg(subg, nsubg, G_bb, gnames); /* if subgraphs are clusters, point to the new * one so we can find it later. @@ -604,7 +604,7 @@ cloneSubg(Agraph_t * g, Agraph_t * ng, Agsym_t * G_bb, Dt_t * gnames) nt = NEWNODE(agtail(e)); nh = NEWNODE(aghead(e)); ne = agedge(ng, nt, nh, NULL, 1); - agbindrec (ne, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec (ne, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); cloneEdge(e, ne); MARK(e); } @@ -702,14 +702,14 @@ static Agraph_t *cloneGraph(Agraph_t ** gs, int cnt, GVC_t * gvc) doWarn = false; } np = agnode(root, xName(nnames, agnameof(n)), 1); - agbindrec (np, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec (np, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); ND_alg(n) = np; cloneNode(n, np); } /* wrap the clone of g in a subgraph of root */ subg = agsubg(root, xName(gnames, agnameof(g)), 1); - agbindrec (subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec (subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); cloneSubg(g, subg, G_bb, gnames); } dtclose(gnames); diff --git a/cmd/tools/mm2gv.c b/cmd/tools/mm2gv.c index a952fad78..1385f875e 100644 --- a/cmd/tools/mm2gv.c +++ b/cmd/tools/mm2gv.c @@ -12,6 +12,7 @@ #define STANDALONE #include +#include #include #include #include @@ -120,7 +121,7 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim, for (i = 0; i < A->m; i++) { sprintf(buf, "%d", i); n = agnode(g, buf, 1); - agbindrec(n, "nodeinfo", sizeof(Agnodeinfo_t), TRUE); + agbindrec(n, "nodeinfo", sizeof(Agnodeinfo_t), true); ND_id(n) = i; arr[i] = n; } diff --git a/cmd/tools/sccmap.c b/cmd/tools/sccmap.c index 15cde0eb2..e6a1fb8cc 100644 --- a/cmd/tools/sccmap.c +++ b/cmd/tools/sccmap.c @@ -22,6 +22,7 @@ #include "config.h" #include +#include #include #include #ifdef HAVE_UNISTD_H @@ -170,7 +171,7 @@ static unsigned visit(Agnode_t * n, Agraph_t * map, Stack * sp, sccstate * st) Agraph_t *G = agraphof(n);; snprintf(name, sizeof(name), "cluster_%u", st->Comp++); subg = agsubg(G, name, TRUE); - agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), true); setrep(subg, agnode(map, name, TRUE)); do { t = pop(sp); diff --git a/doc/libgraph/sccmap.c b/doc/libgraph/sccmap.c index 150510c77..0d33f723f 100644 --- a/doc/libgraph/sccmap.c +++ b/doc/libgraph/sccmap.c @@ -141,7 +141,7 @@ static int visit(Agnode_t * n, Agraph_t * map, Stack * sp, sccstate * st) Agraph_t *G = agraphof(n);; snprintf(name, sizeof(name), "cluster_%d", (st->Comp)++); subg = agsubg(G, name, TRUE); - agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), true); setrep(subg, agnode(map, name, TRUE)); do { t = pop(sp); diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index 6a3de88db..9fa98e84a 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -11,6 +11,7 @@ #include #include #include +#include /* * dynamic attributes @@ -106,7 +107,7 @@ static Agdatadict_t *agmakedatadict(Agraph_t * g) Agraph_t *par; Agdatadict_t *parent_dd, *dd; - dd = agbindrec(g, DataDictName, sizeof(Agdatadict_t), FALSE); + dd = agbindrec(g, DataDictName, sizeof(Agdatadict_t), false); dd->dict.n = agdtopen(g, &AgDataDictDisc, Dttree); dd->dict.e = agdtopen(g, &AgDataDictDisc, Dttree); dd->dict.g = agdtopen(g, &AgDataDictDisc, Dttree); @@ -182,7 +183,7 @@ static Agrec_t *agmakeattrs(Agraph_t * context, void *obj) Agsym_t *sym; Dict_t *datadict; - rec = agbindrec(obj, AgDataRecName, sizeof(Agattr_t), FALSE); + rec = agbindrec(obj, AgDataRecName, sizeof(Agattr_t), false); datadict = agdictof(context, AGTYPE(obj)); assert(datadict); if (rec->dict == NULL) { diff --git a/lib/cgraph/cmpnd.c b/lib/cgraph/cmpnd.c index 421278e47..ca048fcbe 100644 --- a/lib/cgraph/cmpnd.c +++ b/lib/cgraph/cmpnd.c @@ -10,6 +10,7 @@ #include #include +#include /* * provides "compound nodes" on top of base Libgraph. @@ -60,7 +61,7 @@ typedef struct Agcmpedge_s { static save_stack_t *save_stack_of(Agedge_t * e, Agnode_t * node_being_saved) { int i; - Agcmpedge_t *edgerec = agbindrec(e, Descriptor_id, sizeof(*edgerec), FALSE); + Agcmpedge_t *edgerec = agbindrec(e, Descriptor_id, sizeof(*edgerec), false); if (node_being_saved == AGHEAD(e)) i = IN_STACK; else @@ -183,8 +184,8 @@ int agassociate(Agnode_t * n, Agraph_t * sub) if (agsubnode(sub, n, FALSE)) return FAILURE; /* avoid cycles */ - noderec = agbindrec(n, Descriptor_id, sizeof(*noderec), FALSE); - graphrec = agbindrec(sub, Descriptor_id, sizeof(*graphrec), FALSE); + noderec = agbindrec(n, Descriptor_id, sizeof(*noderec), false); + graphrec = agbindrec(sub, Descriptor_id, sizeof(*graphrec), false); if (noderec->subg || graphrec->node) return FAILURE; noderec->subg = sub; @@ -203,7 +204,7 @@ static void delete_outside_subg(Agraph_t * g, Agnode_t * node, Agraph_t * subg) if ((g != subg) && (n = agsubnode(g, (Agnode_t *) node, FALSE))) { dtdelete(g->n_dict, n); - graphrec = agbindrec(g, Descriptor_id, sizeof(*graphrec), FALSE); + graphrec = agbindrec(g, Descriptor_id, sizeof(*graphrec), false); if ((d = graphrec->hidden_node_set) == NULL) { /* use name disc. to permit search for hidden node by name */ d = graphrec->hidden_node_set = agdtopen(g, &Ag_node_name_disc, Dttree); diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index f42dda6a1..b27ab6b0b 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -10,6 +10,7 @@ #include #include +#include static Agtag_t Tag; /* to silence warnings about initialization */ @@ -215,7 +216,7 @@ static Agedge_t *newedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, installedge(g, out); if (g->desc.has_attrs) { - (void) agbindrec(out, AgDataRecName, sizeof(Agattr_t), FALSE); + (void)agbindrec(out, AgDataRecName, sizeof(Agattr_t), false); agedgeattr_init(g, out); } agmethod_init(g, out); diff --git a/lib/cgraph/node.c b/lib/cgraph/node.c index 1ecd27ac3..03fc205b8 100644 --- a/lib/cgraph/node.c +++ b/lib/cgraph/node.c @@ -10,6 +10,7 @@ #include #include +#include Agnode_t *agfindnode_by_id(Agraph_t * g, IDTYPE id) { @@ -75,7 +76,7 @@ static Agnode_t *newnode(Agraph_t * g, IDTYPE id, uint64_t seq) AGSEQ(n) = seq; n->root = agroot(g); if (agroot(g)->desc.has_attrs) - (void) agbindrec(n, AgDataRecName, sizeof(Agattr_t), FALSE); + (void)agbindrec(n, AgDataRecName, sizeof(Agattr_t), false); /* nodeattr_init and method_init will be called later, from the * subgraph where the node was actually created, but first it has * to be installed in all the (sub)graphs up to root. */ diff --git a/lib/cgraph/pend.c b/lib/cgraph/pend.c index 3e6b1e2f5..a7cf03fda 100644 --- a/lib/cgraph/pend.c +++ b/lib/cgraph/pend.c @@ -11,6 +11,7 @@ #include #include #include +#include static char DRName[] = "_AG_pending"; @@ -190,7 +191,7 @@ void agrecord_callback(Agraph_t * g, Agobj_t * obj, cb_t kind, Agsym_t * optsym) Dict_t *dict; pending_cb_t *handle; - pending = agbindrec(g, DRName, sizeof(pendingset_t), FALSE); + pending = agbindrec(g, DRName, sizeof(pendingset_t), false); switch (kind) { case CB_INITIALIZE: @@ -259,7 +260,7 @@ static void agrelease_callbacks(Agraph_t * g) pendingset_t *pending; if (NOT(g->clos->callbacks_enabled)) { g->clos->callbacks_enabled = TRUE; - pending = agbindrec(g, DRName, sizeof(pendingset_t), FALSE); + pending = agbindrec(g, DRName, sizeof(pendingset_t), false); /* this destroys objects in the opposite of their order of creation */ cb(pending->ins.g, CB_INITIALIZE); cb(pending->ins.n, CB_INITIALIZE); diff --git a/lib/circogen/blockpath.c b/lib/circogen/blockpath.c index 8e26a2050..366e1cd60 100644 --- a/lib/circogen/blockpath.c +++ b/lib/circogen/blockpath.c @@ -13,6 +13,7 @@ #include #include #include +#include /* The code below lays out a single block on a circle. */ @@ -39,13 +40,13 @@ static Agraph_t *clone_graph(Agraph_t * ing, Agraph_t ** xg) snprintf(gname, sizeof(gname), "_clone_%d", id++); clone = agsubg(ing, gname,1); - agbindrec(clone, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(clone, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data snprintf(gname, sizeof(gname), "_clone_%d", id++); xclone = agopen(gname, ing->desc,NULL); for (n = agfstnode(ing); n; n = agnxtnode(ing, n)) { agsubnode(clone,n,1); xn = agnode(xclone, agnameof(n),1); - agbindrec(xn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(xn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data CLONE(n) = xn; } @@ -55,7 +56,7 @@ static Agraph_t *clone_graph(Agraph_t * ing, Agraph_t ** xg) agsubedge(clone,e,1); xh = CLONE(aghead(e)); xe = agedge(xclone, xn, xh, NULL, 1); - agbindrec(xe, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(xe, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data ORIGE(xe) = e; DEGREE(xn) += 1; DEGREE(xh) += 1; @@ -146,7 +147,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg) break; tp = neighbors_without[mark]; hp = neighbors_without[mark + 1]; - agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data + agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data DEGREE(tp)++; DEGREE(hp)++; diff--; @@ -156,7 +157,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg) while (diff > 0) { tp = neighbors_without[0]; hp = neighbors_without[mark]; - agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data + agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data DEGREE(tp)++; DEGREE(hp)++; mark++; @@ -168,7 +169,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg) tp = neighbors_with[0]; for (mark = 0; mark < no_pair_count; mark++) { hp = neighbors_without[mark]; - agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data DEGREE(tp)++; DEGREE(hp)++; } @@ -361,7 +362,7 @@ static Agraph_t *spanning_tree(Agraph_t * g) snprintf(gname, sizeof(gname), "_span_%d", id++); tree = agsubg(g, gname,1); - agbindrec(tree, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(tree, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data for (n = agfstnode(g); n; n = agnxtnode(g, n)) { agsubnode(tree,n,1); diff --git a/lib/circogen/blocktree.c b/lib/circogen/blocktree.c index 1096880a7..86069435f 100644 --- a/lib/circogen/blocktree.c +++ b/lib/circogen/blocktree.c @@ -10,6 +10,7 @@ #include +#include static void addNode(block_t * bp, Agnode_t * n) { @@ -24,7 +25,7 @@ static Agraph_t *makeBlockGraph(Agraph_t * g, circ_state * state) snprintf(name, sizeof(name), "_block_%d", state->blockCount++); subg = agsubg(g, name,1); - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data return subg; } diff --git a/lib/circogen/circularinit.c b/lib/circogen/circularinit.c index 45365cb08..01f07c4e0 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -27,11 +27,12 @@ #include #include #include +#include #include static void circular_init_edge(edge_t * e) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data common_init_edge(e); ED_factor(e) = late_double(e, E_weight, 1.0, 0.0); @@ -77,7 +78,7 @@ static node_t *makeDerivedNode(graph_t * dg, char *name, int isNode, void *orig) { node_t *n = agnode(dg, name,1); - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data ND_alg(n) = NEW(cdata); if (isNode) { ND_pos(n) = N_NEW(Ndim, double); @@ -111,7 +112,7 @@ static Agraph_t **circomps(Agraph_t * g, int *cnt) Agnode_t *p; dg = agopen("derived", Agstrictundirected,NULL); - agbindrec (dg, "info", sizeof(Agraphinfo_t), TRUE); + agbindrec (dg, "info", sizeof(Agraphinfo_t), true); GD_alg(g) = dg; /* store derived graph for closing later */ for (v = agfstnode(g); v; v = agnxtnode(g, v)) { @@ -126,7 +127,7 @@ static Agraph_t **circomps(Agraph_t * g, int *cnt) dt = DNODE(agtail(e)); dh = DNODE(aghead(e)); if (dt != dh) { - agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data } } } @@ -147,7 +148,7 @@ static Agraph_t **circomps(Agraph_t * g, int *cnt) dh = DNODE(aghead(e)); if (n != dh) { ep = agedge(dg, n, dh, NULL, 1); - agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data agsubedge(sg,ep,1); } } diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index e92ae3c43..317d46288 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -1351,7 +1351,7 @@ static void checkChain(graph_t * g) for (h = ND_next(t); h; h = ND_next(h)) { if (!agfindedge(g, t, h)) { e = agedge(g, t, h, NULL, 1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); ED_minlen(e) = 0; elist_append(e, ND_out(t)); elist_append(e, ND_in(h)); @@ -1374,7 +1374,7 @@ checkEdge (graph_t* g, node_t* t, node_t* h, int sz) ED_minlen(e) = MAX(ED_minlen(e), sz); else { e = agedge(g, t, h, NULL, 1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); ED_minlen(e) = sz; elist_append(e, ND_out(t)); elist_append(e, ND_in(h)); @@ -1402,7 +1402,7 @@ static void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) lastn = NULL; for (i = 0; i <= tbl->cc; i++) { t = agnode(colg, nToName(i), 1); - agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); alloc_elist(tbl->rc, ND_in(t)); alloc_elist(tbl->rc, ND_out(t)); if (lastn) { @@ -1415,7 +1415,7 @@ static void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) lastn = NULL; for (i = 0; i <= tbl->rc; i++) { t = agnode(rowg, nToName(i), 1); - agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); alloc_elist(tbl->cc, ND_in(t)); alloc_elist(tbl->cc, ND_out(t)); if (lastn) { @@ -1497,8 +1497,8 @@ static void sizeArray(htmltbl_t * tbl) rowg = agopen("rowg", dir, NULL); colg = agopen("colg", dir, NULL); /* Only need GD_nlist */ - agbindrec(rowg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data - agbindrec(colg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data + agbindrec(rowg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data + agbindrec(colg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data makeGraphs(tbl, rowg, colg); rank(rowg, 2, INT_MAX); rank(colg, 2, INT_MAX); diff --git a/lib/common/utils.c b/lib/common/utils.c index 46722a6d4..05bf4387b 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -932,7 +932,7 @@ static node_t *clustNode(node_t * n, graph_t * cg, agxbuf * xb, agxbprint(xb, "__%d:%s", idx++, agnameof(cg)); cn = agnode(agroot(cg), agxbuse(xb), 1); - agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); SET_CLUST_NODE(cn); agsubnode(cg,cn,1); @@ -1011,7 +1011,7 @@ static edge_t *cloneEdge(edge_t * e, node_t * ct, node_t * ch) { graph_t *g = agraphof(ct); edge_t *ce = agedge(g, ct, ch,NULL,1); - agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); agcopyattr(e, ce); ED_compound(ce) = TRUE; @@ -1171,7 +1171,7 @@ void processClusterEdges(graph_t * g) map = dtopen(&mapDisc, Dtoset); clg = agsubg(g, "__clusternodes",1); - agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); agxbinit(&xb, SMALLBUF, buf); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { if (IS_CLUST_NODE(n)) continue; @@ -1188,7 +1188,7 @@ void processClusterEdges(graph_t * g) agclose(clg); if (num_cl_edges) { cl_edge_t* cl_info; - cl_info = agbindrec(g, CL_EDGE_TAG, sizeof(cl_edge_t), FALSE); + cl_info = agbindrec(g, CL_EDGE_TAG, sizeof(cl_edge_t), false); cl_info->n_cluster_edges = num_cl_edges; } dtclose(cmap); @@ -1218,7 +1218,7 @@ static node_t *mapN(node_t * n, graph_t * clg) if ((nn = agfindnode(g, name))) return nn; nn = agnode(g, name, 1); - agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); SET_CLUST_NODE(nn); /* Set all attributes to default */ @@ -1272,7 +1272,7 @@ void undoClusterEdges(graph_t * g) if (!ecnt) return; clg = agsubg(g, "__clusternodes",1); - agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); elist = N_NEW(ecnt, edge_t*); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { diff --git a/lib/dotgen/dotinit.c b/lib/dotgen/dotinit.c index 56523814a..bd676101a 100644 --- a/lib/dotgen/dotinit.c +++ b/lib/dotgen/dotinit.c @@ -13,6 +13,7 @@ #include #include #include +#include static void dot_init_subg(graph_t * g, graph_t* droot) @@ -20,7 +21,7 @@ dot_init_subg(graph_t * g, graph_t* droot) graph_t* subg; if ((g != agroot(g))) - agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), true); if (g == droot) GD_dotroot(agroot(g)) = droot; @@ -33,7 +34,7 @@ dot_init_subg(graph_t * g, graph_t* droot) static void dot_init_node(node_t * n) { - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //graph custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //graph custom data common_init_node(n); gv_nodesize(n, GD_flip(agraphof(n))); alloc_elist(4, ND_in(n)); @@ -48,7 +49,7 @@ static void dot_init_edge(edge_t * e) { char *tailgroup, *headgroup; - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //graph custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //graph custom data common_init_edge(e); ED_weight(e) = late_int(e, E_weight, 1, 0); @@ -141,7 +142,7 @@ dot_cleanup_graph(graph_t * g) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { dot_cleanup_graph(subg); } - if (! agbindrec(g, "Agraphinfo_t", 0, TRUE)) return; + if (! agbindrec(g, "Agraphinfo_t", 0, true)) return; free (GD_clust(g)); free (GD_rankleader(g)); @@ -324,7 +325,7 @@ static void dotLayout(Agraph_t * g) static void initSubg (Agraph_t* sg, Agraph_t* g) { - agbindrec(sg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(sg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_drawing(sg) = NEW(layout_t); GD_drawing(sg)->quantum = GD_drawing(g)->quantum; GD_drawing(sg)->dpi = GD_drawing(g)->dpi; @@ -382,7 +383,7 @@ copyCluster (Agraph_t* scl, Agraph_t* cl) int nclust, j; Agraph_t* cg; - agbindrec(cl, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(cl, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_bb(cl) = GD_bb(scl); GD_label_pos(cl) = GD_label_pos(scl); memcpy(GD_border(cl), GD_border(scl), 4*sizeof(pointf)); diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index f95ab8da6..7c6de0a95 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -856,7 +856,7 @@ cloneGraph (graph_t* g, attr_state_t* attr_state) auxg = agopen ("auxg",Agdirected, NULL); else auxg = agopen ("auxg",Agundirected, NULL); - agbindrec(auxg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(auxg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); agattr(auxg, AGRAPH, "rank", ""); GD_drawing(auxg) = NEW(layout_t); GD_drawing(auxg)->quantum = GD_drawing(g)->quantum; @@ -950,7 +950,7 @@ static node_t* cloneNode (graph_t* g, node_t* orign, int flipped) { node_t* n = agnode(g, agnameof(orign),1); - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); agcopyattr (orign, n); if (shapeOf(orign) == SH_RECORD) { int lbllen = strlen(ND_label(orign)->text); @@ -968,7 +968,7 @@ static edge_t* cloneEdge (graph_t* g, node_t* tn, node_t* hn, edge_t* orig) { edge_t* e = agedge(g, tn, hn,NULL,1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); agcopyattr (orig, e); return e; @@ -1288,7 +1288,7 @@ make_flat_adj_edges(graph_t* g, path* P, edge_t** edges, int ind, int cnt, edge_ attrs = NEW(attr_state_t); auxg = cloneGraph (g, attrs); subg = agsubg (auxg, "xxx",1); - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); agset (subg, "rank", "source"); rightx = ND_coord(hn).x; leftx = ND_coord(tn).x; diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index dfc0e5f79..4bbe3dfe7 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -306,7 +306,7 @@ checkLabelOrder (graph_t* g) if (!lg) lg = agopen ("lg", Agstrictdirected, 0); snprintf(buf, sizeof(buf), "%d", j); n = agnode(lg, buf, 1); - agbindrec(n, "info", sizeof(info_t), 1); + agbindrec(n, "info", sizeof(info_t), true); lo = ND_order(aghead(ND_out(u).list[0])); hi = ND_order(aghead(ND_out(u).list[1])); if (lo > hi) { @@ -1133,7 +1133,7 @@ realFillRanks (Agraph_t* g, int rnks[], int rnks_sz, Agraph_t* sg) sg = agsubg (dot_root(g), "_new_rank", 1); } n = agnode (sg, NULL, 1); - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); ND_rank(n) = i; ND_lw(n) = ND_rw(n) = 0.5; ND_ht(n) = 1; diff --git a/lib/dotgen/rank.c b/lib/dotgen/rank.c index 35f1f68a2..edddd5c44 100644 --- a/lib/dotgen/rank.c +++ b/lib/dotgen/rank.c @@ -1105,11 +1105,11 @@ static void add_fast_edges (graph_t * g) } static void my_init_graph(Agraph_t *g, Agobj_t *graph, void *arg) -{ int *sz = arg; (void)g; agbindrec(graph,"level graph rec",sz[0],TRUE); } +{ int *sz = arg; (void)g; agbindrec(graph,"level graph rec",sz[0],true); } static void my_init_node(Agraph_t *g, Agobj_t *node, void *arg) -{ int *sz = arg; (void)g; agbindrec(node,"level node rec",sz[1],TRUE); } +{ int *sz = arg; (void)g; agbindrec(node,"level node rec",sz[1],true); } static void my_init_edge(Agraph_t *g, Agobj_t *edge, void *arg) -{ int *sz = arg; (void)g; agbindrec(edge,"level edge rec",sz[2],TRUE); } +{ int *sz = arg; (void)g; agbindrec(edge,"level edge rec",sz[2],true); } static Agcbdisc_t mydisc = { {my_init_graph,0,0}, {my_init_node,0,0}, {my_init_edge,0,0} }; int infosizes[] = { @@ -1127,7 +1127,7 @@ void dot2_rank(graph_t * g, aspect_t* asp) Last_node = NULL; Xg = agopen("level assignment constraints", Agstrictdirected, 0); - agbindrec(Xg,"level graph rec",sizeof(Agraphinfo_t),TRUE); + agbindrec(Xg,"level graph rec",sizeof(Agraphinfo_t),true); agpushdisc(Xg,&mydisc,infosizes); edgelabel_ranks(g); diff --git a/lib/fdpgen/comp.c b/lib/fdpgen/comp.c index a192d61f9..625f384de 100644 --- a/lib/fdpgen/comp.c +++ b/lib/fdpgen/comp.c @@ -24,6 +24,7 @@ #include #include #include +#include #define MARK(n) (marks[ND_id(n)]) @@ -74,7 +75,7 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned) if ((pp = PORTS(g))) { snprintf(name, sizeof(name), "cc%s_%d", agnameof(g), c_cnt++ + C_cnt); subg = agsubg(g, name,1); - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_alg(subg) = NEW(gdata); PORTS(subg) = pp; NPORTS(subg) = NPORTS(g); @@ -95,7 +96,7 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned) if (!subg) { snprintf(name, sizeof(name), "cc%s_%d", agnameof(g), c_cnt++ + C_cnt); subg = agsubg(g, name,1); - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_alg(subg) = NEW(gdata); } pinflag = 1; @@ -110,7 +111,7 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned) continue; snprintf(name, sizeof(name), "cc%s+%d", agnameof(g), c_cnt++ + C_cnt); subg = agsubg(g, name,1); - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data GD_alg(subg) = NEW(gdata); dfs(g, n, subg, marks); nodeInduce(subg); diff --git a/lib/fdpgen/fdpinit.c b/lib/fdpgen/fdpinit.c index d6bb84584..7de124237 100644 --- a/lib/fdpgen/fdpinit.c +++ b/lib/fdpgen/fdpinit.c @@ -21,6 +21,7 @@ #include #include #include +#include static void initialPositions(graph_t * g) { @@ -63,7 +64,7 @@ static void initialPositions(graph_t * g) */ static void init_edge(edge_t * e, attrsym_t * E_len) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data ED_factor(e) = late_double(e, E_weight, 1.0, 0.0); ED_dist(e) = late_double(e, E_len, fdp_parms->K, 0.0); diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index efb743dd1..4adccc30d 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -41,6 +41,7 @@ #include #include #include +#include typedef struct { graph_t* rootg; /* logical root; graph passed in to fdp_layout */ @@ -182,7 +183,7 @@ static node_t *mkDeriveNode(graph_t * dg, char *name) node_t *dn; dn = agnode(dg, name,1); - agbindrec(dn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(dn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data ND_alg(dn) = NEW(dndata); /* free in freeDeriveNode */ ND_pos(dn) = N_GNEW(GD_ndim(dg), double); /* fprintf (stderr, "Creating %s\n", dn->name); */ @@ -427,7 +428,7 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop) infop->gid++; dg = agopen("derived", Agstrictdirected,NULL); - agbindrec(dg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(dg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_alg(dg) = NEW(gdata); /* freed in freeDeriveGraph */ #ifdef DEBUG GORIG(dg) = g; @@ -502,7 +503,7 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop) de = agedge(dg, tl, hd, NULL,1); else de = agedge(dg, hd, tl, NULL,1); - agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); ED_dist(de) = ED_dist(e); ED_factor(de) = ED_factor(e); /* fprintf (stderr, "edge %s -- %s\n", tl->name, hd->name); */ @@ -536,7 +537,7 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop) de = agedge(dg, m, dn, NULL,1); else de = agedge(dg, dn, m, NULL,1); - agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); ED_dist(de) = ED_dist(pp->e); ED_factor(de) = ED_factor(pp->e); addEdge(de, pp->e); @@ -1009,7 +1010,7 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { if (!strncmp(agnameof(subg), "cluster", 7)) { - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_alg(subg) = NEW(gdata); /* freed in cleanup_subgs */ GD_ndim(subg) = GD_ndim(parent); LEVEL(subg) = LEVEL(parent) + 1; diff --git a/lib/gvc/gvlayout.c b/lib/gvc/gvlayout.c index a9f65cc7b..be7fb35a8 100644 --- a/lib/gvc/gvlayout.c +++ b/lib/gvc/gvlayout.c @@ -56,7 +56,7 @@ int gvLayoutJobs(GVC_t * gvc, Agraph_t * g) char *p; int rc; - agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_gvc(g) = gvc; if (g != agroot(g)) GD_gvc(agroot(g)) = gvc; @@ -107,7 +107,7 @@ int gvFreeLayout(GVC_t * gvc, Agraph_t * g) (void)gvc; /* skip if no Agraphinfo_t yet */ - if (! agbindrec(g, "Agraphinfo_t", 0, TRUE)) + if (! agbindrec(g, "Agraphinfo_t", 0, true)) return 0; if (GD_cleanup(g)) { diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index acdd987f2..11d3701fb 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2596,7 +2596,7 @@ Agraph_t *openG(char *name, Agdesc_t desc) #endif g = agopen(name, desc, &gprDisc); if (g) - agbindrec(g, UDATA, sizeof(gdata), 0); + agbindrec(g, UDATA, sizeof(gdata), false); return g; } @@ -2609,7 +2609,7 @@ Agraph_t *openSubg(Agraph_t * g, char *name) sg = agsubg(g, name, 1); if (sg && !aggetrec(sg, UDATA, 0)) - agbindrec(sg, UDATA, sizeof(gdata), 0); + agbindrec(sg, UDATA, sizeof(gdata), false); return sg; } @@ -2622,7 +2622,7 @@ Agnode_t *openNode(Agraph_t * g, char *name) np = agnode(g, name, 1); if (np && !aggetrec(np, UDATA, 0)) - agbindrec(np, UDATA, sizeof(ndata), 0); + agbindrec(np, UDATA, sizeof(ndata), false); return np; } @@ -2645,7 +2645,7 @@ Agedge_t *openEdge(Agraph_t* g, Agnode_t * t, Agnode_t * h, char *key) ep = agedge(g, t, h, key, 1); if (ep && !aggetrec(ep, UDATA, 0)) - agbindrec(ep, UDATA, sizeof(edata), 0); + agbindrec(ep, UDATA, sizeof(edata), false); return ep; } diff --git a/lib/neatogen/constraint.c b/lib/neatogen/constraint.c index 885e5fac5..2c8f000b6 100644 --- a/lib/neatogen/constraint.c +++ b/lib/neatogen/constraint.c @@ -14,6 +14,7 @@ #include #include #include +#include /* For precision, scale up before algorithms, then scale down */ #define SCALE 10 @@ -137,7 +138,7 @@ static void mapGraphs(graph_t * g, graph_t * cg, distfn dist) delta = dist(&tp->bb, &hp->bb); h = hp->cnode; ce = agedge(cg, t, h, NULL, 1); - agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); + agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); ED_weight(ce) = 1; if (ED_minlen(ce) < delta) { if (ED_minlen(ce) == 0.0) { @@ -213,12 +214,12 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, edge_t *e; node_t *lastn = NULL; graph_t *cg = agopen("cg", Agstrictdirected, NULL); - agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data + agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data for (p = (nitem *) dtflatten(list); p; p = (nitem *) dtlink(list, (Dtlink_t *) p)) { n = agnode(cg, agnameof(p->np), 1); /* FIX */ - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data ND_alg(n) = p; p->cnode = n; alloc_elist(0, ND_in(n)); @@ -238,7 +239,7 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, if (intersect(p, nxp)) { double delta = dist(&p->bb, &nxp->bb); e = agedge(cg, p->cnode, nxp->cnode, NULL, 1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data assert (delta <= 0xFFFF); ED_minlen(e) = delta; ED_weight(e) = 1; @@ -282,7 +283,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, int oldval = -INT_MAX; node_t *lastn = NULL; graph_t *cg = agopen("cg", Agstrictdirected, NULL); - agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data + agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data /* count distinct nodes */ cnt = 0; @@ -303,7 +304,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, oldval = p->val; /* n = newNode (cg); */ n = agnode(cg, agnameof(p->np), 1); /* FIX */ - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data ND_alg(n) = p; if (root) { ND_next(lastn) = n; @@ -319,7 +320,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, else alloc_elist(cnt - lcnt - 1, ND_out(prev)); e = agedge(cg, prev, n, NULL, 1); - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data ED_minlen(e) = SCALE; ED_weight(e) = 1; elist_append(e, ND_out(prev)); @@ -341,7 +342,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, for (p = (nitem *) dtflatten(list); p; p = (nitem *) dtlink(list, (Dtlink_t *) p)) { n = agnode(vg, agnameof(p->np), 1); /* FIX */ - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data p->vnode = n; ND_alg(n) = p; } diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index e3792ceb8..18317e045 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -42,7 +42,7 @@ static char *cc_pfx = "_neato_cc"; void neato_init_node(node_t * n) { - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data common_init_node(n); ND_pos(n) = N_NEW(GD_ndim(agraphof(n)), double); gv_nodesize(n, GD_flip(agraphof(n))); @@ -50,7 +50,7 @@ void neato_init_node(node_t * n) static void neato_init_edge(edge_t * e) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data common_init_edge(e); ED_factor(e) = late_double(e, E_weight, 1.0, 1.0); } @@ -469,7 +469,7 @@ dfs(Agraph_t * subg, Agraph_t * parentg, attrsym_t * G_lp, attrsym_t * G_bb) boxf bb; if (!strncmp(agnameof(subg), "cluster", 7) && chkBB(subg, G_bb, &bb)) { - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); GD_bb(subg) = bb; add_cluster(parentg, subg); nop_init_graphs(subg, G_lp, G_bb); @@ -1386,7 +1386,7 @@ addCluster (graph_t* g) graph_t *subg; for (subg = agfstsubg(agroot(g)); subg; subg = agnxtsubg(subg)) { if (!strncmp(agnameof(subg), "cluster", 7)) { - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); add_cluster(g, subg); compute_bb(subg); } diff --git a/lib/osage/osageinit.c b/lib/osage/osageinit.c index 498649763..2349a7df7 100644 --- a/lib/osage/osageinit.c +++ b/lib/osage/osageinit.c @@ -72,7 +72,7 @@ static void cluster_init_graph(graph_t * g) } for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data common_init_edge(e); } } @@ -332,7 +332,7 @@ mkClusters (Agraph_t* g, clist_t* pclist, Agraph_t* parent) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { if (!strncmp(agnameof(subg), "cluster", 7)) { - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); do_graph_label (subg); addCluster(clist, subg); mkClusters(subg, NULL, subg); diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index cfd313bbd..0a173b952 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -231,7 +231,7 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned) if (!out) { sprintf(name + len, "%" PRISIZE_T, c_cnt); out = agsubg(g, name,1); - agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data ccs[c_cnt] = out; c_cnt++; pin = true; @@ -248,7 +248,7 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned) continue; sprintf(name + len, "%" PRISIZE_T, c_cnt); out = agsubg(g, name,1); - agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data if (dfs(g, n, out, &stk) == SIZE_MAX) { error = 1; goto packerror; @@ -319,7 +319,7 @@ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx) continue; sprintf(name + len, "%" PRISIZE_T, c_cnt); out = agsubg(g, name,1); - agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data + agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data if (dfs(g, n, out, &stk) == SIZE_MAX) { freeStk (&stk); free (ccs); @@ -405,7 +405,7 @@ static void deriveClusters(Agraph_t* dg, Agraph_t * g) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { if (isCluster(subg)) { dn = agnode(dg, agnameof(subg), 1); - agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), TRUE); + agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), true); clustOf(dn) = subg; for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) { if (dnodeOf(n)) { @@ -440,7 +440,7 @@ static Agraph_t *deriveGraph(Agraph_t * g) if (dnodeOf(n)) continue; dn = agnode(dg, agnameof(n), 1); - agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), TRUE); + agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), true); nodeOf(dn) = n; dnodeSet(n,dn); } @@ -563,7 +563,7 @@ static Agraph_t *projectG(Agraph_t * subg, Agraph_t * g, int inCluster) node_induce(proj, subg); agcopyattr(subg, proj); if (isCluster(proj)) { - op = agbindrec(proj,ORIG_REC, sizeof(orig_t), 0); + op = agbindrec(proj,ORIG_REC, sizeof(orig_t), false); op->orig = subg; } } @@ -649,7 +649,7 @@ Agraph_t **cccomps(Agraph_t * g, int *ncc, char *pfx) sprintf(name + len, "%" PRISIZE_T, c_cnt); dout = agsubg(dg, name, 1); out = agsubg(g, name, 1); - agbindrec(out, GRECNAME, sizeof(ccgraphinfo_t), FALSE); + agbindrec(out, GRECNAME, sizeof(ccgraphinfo_t), false); GD_cc_subg(out) = 1; n_cnt = dfs(dg, dn, dout, &stk); if (n_cnt == SIZE_MAX) { diff --git a/lib/patchwork/patchworkinit.c b/lib/patchwork/patchworkinit.c index 11a853b46..799be346a 100644 --- a/lib/patchwork/patchworkinit.c +++ b/lib/patchwork/patchworkinit.c @@ -12,6 +12,7 @@ #include #include #include +#include /* the following code shamelessly copied from lib/fdpgen/layout.c and should be extracted and made into a common function */ @@ -70,7 +71,7 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent) for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) { if (!strncmp(agnameof(subg), "cluster", 7)) { - agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); #ifdef FDP_GEN GD_alg(subg) = (void *) NEW(gdata); /* freed in cleanup_subgs */ GD_ndim(subg) = GD_ndim(parent); @@ -99,7 +100,7 @@ static void patchwork_init_node(node_t * n) static void patchwork_init_edge(edge_t * e) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agnodeinfo_t), TRUE); // edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agnodeinfo_t), true); // edge custom data /* common_init_edge(e); */ } @@ -112,7 +113,7 @@ static void patchwork_init_node_edge(graph_t * g) GD_neato_nlist(g) = N_NEW(agnnodes(g) + 1, node_t *); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { - agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); // node custom data + agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); // node custom data ND_alg(n) = alg + i; GD_neato_nlist(g)[i++] = n; patchwork_init_node(n); diff --git a/lib/sfdpgen/sfdpinit.c b/lib/sfdpgen/sfdpinit.c index ed8e43c40..74fb94bc6 100644 --- a/lib/sfdpgen/sfdpinit.c +++ b/lib/sfdpgen/sfdpinit.c @@ -26,7 +26,7 @@ static void sfdp_init_edge(edge_t * e) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data common_init_edge(e); } diff --git a/lib/twopigen/twopiinit.c b/lib/twopigen/twopiinit.c index f2829de1b..97695a898 100644 --- a/lib/twopigen/twopiinit.c +++ b/lib/twopigen/twopiinit.c @@ -18,10 +18,11 @@ #include #include #include +#include static void twopi_init_edge(edge_t * e) { - agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data + agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data common_init_edge(e); ED_factor(e) = late_double(e, E_weight, 1.0, 0.0); } -- 2.40.0