From b25836334408f719380547942a360a4729d3060f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 5 Jun 2020 18:38:09 -0700 Subject: [PATCH] mark some static functions as such This removes 92 -Wmissing-prototypes warnings on GCC 8.3. --- lib/agraph/node.c | 2 +- lib/agraph/write.c | 2 +- lib/cgraph/edge.c | 4 ++-- lib/cgraph/graph.c | 2 +- lib/cgraph/io.c | 2 +- lib/cgraph/node.c | 10 +++++----- lib/cgraph/write.c | 2 +- lib/circogen/circularinit.c | 2 +- lib/common/htmltable.c | 12 ++++++------ lib/dotgen/cluster.c | 2 +- lib/dotgen/fastgr.c | 2 +- lib/dotgen/mincross.c | 2 +- lib/edgepaint/intersection.c | 2 +- lib/expr/exeval.c | 6 +++--- lib/gvpr/parse.c | 2 +- lib/label/xlabels.c | 2 +- lib/neatogen/overlap.c | 10 +++++----- lib/neatogen/sgd.c | 6 +++--- lib/neatogen/stuff.c | 2 +- lib/pack/ccomps.c | 2 +- lib/pack/pack.c | 3 +-- lib/pathplan/shortestpth.c | 2 +- lib/pathplan/visibility.c | 2 +- lib/rbtree/red_black_tree.c | 12 ++++++------ lib/rbtree/test_red_black_tree.c | 4 ++-- lib/sfdpgen/Multilevel.c | 6 +++--- lib/sfdpgen/post_process.c | 2 +- lib/sfdpgen/sparse_solve.c | 16 ++++++++-------- lib/sfdpgen/spring_electrical.c | 12 ++++++------ lib/sfdpgen/stress_model.c | 2 +- lib/sfdpgen/uniform_stress.c | 4 ++-- lib/sparse/DotIO.c | 2 +- lib/sparse/QuadTree.c | 12 ++++++------ lib/sparse/SparseMatrix.c | 6 +++--- lib/sparse/colorutil.c | 2 +- lib/sparse/general.c | 8 ++++---- lib/sparse/mq.c | 8 ++++---- lib/sparse/vector.c | 8 ++++---- plugin/core/gvloadimage_core.c | 2 +- 39 files changed, 94 insertions(+), 95 deletions(-) diff --git a/lib/agraph/node.c b/lib/agraph/node.c index e544122fd..8fc0c3e3a 100644 --- a/lib/agraph/node.c +++ b/lib/agraph/node.c @@ -24,7 +24,7 @@ Agnode_t *agfindnode_by_id(Agraph_t * g, unsigned long id) return n; } -Agnode_t *agfindnode_by_name(Agraph_t * g, char *name) +static Agnode_t *agfindnode_by_name(Agraph_t * g, char *name) { unsigned long id; diff --git a/lib/agraph/write.c b/lib/agraph/write.c index 96adb5a53..b25bd4ffd 100644 --- a/lib/agraph/write.c +++ b/lib/agraph/write.c @@ -312,7 +312,7 @@ static int irrelevant_subgraph(Agraph_t * g) return TRUE; } -int node_in_subg(Agraph_t * g, Agnode_t * n) +static int node_in_subg(Agraph_t * g, Agnode_t * n) { Agraph_t *subg; diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index e3683fa23..c0c1af4b8 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -402,7 +402,7 @@ Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int cflag) } /* edge comparison. AGTYPE(e) == 0 means ID is a wildcard. */ -int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) +static int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) { Agedge_t *e0, *e1; @@ -422,7 +422,7 @@ int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) } /* edge comparison. for ordered traversal. */ -int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) +static int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) { Agedge_t *e0, *e1; diff --git a/lib/cgraph/graph.c b/lib/cgraph/graph.c index 0df50d2d7..453ac52c2 100644 --- a/lib/cgraph/graph.c +++ b/lib/cgraph/graph.c @@ -239,7 +239,7 @@ int agdegree(Agraph_t * g, Agnode_t * n, int want_in, int want_out) return rv; } -int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) +static int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { ptrdiff_t v; Agraph_t *sg0, *sg1; diff --git a/lib/cgraph/io.c b/lib/cgraph/io.c index 5b17dc91a..544e76948 100644 --- a/lib/cgraph/io.c +++ b/lib/cgraph/io.c @@ -128,7 +128,7 @@ memiofread(void *chan, char *buf, int bufsize) static Agiodisc_t memIoDisc = {memiofread, 0, 0}; -Agraph_t *agmemread0(Agraph_t *arg_g, const char *cp) +static Agraph_t *agmemread0(Agraph_t *arg_g, const char *cp) { Agraph_t* g; rdr_t rdr; diff --git a/lib/cgraph/node.c b/lib/cgraph/node.c index b43e8bcff..3fc3a5da3 100644 --- a/lib/cgraph/node.c +++ b/lib/cgraph/node.c @@ -25,7 +25,7 @@ Agnode_t *agfindnode_by_id(Agraph_t * g, IDTYPE id) return sn ? sn->node : NILnode; } -Agnode_t *agfindnode_by_name(Agraph_t * g, char *name) +static Agnode_t *agfindnode_by_name(Agraph_t * g, char *name) { IDTYPE id; @@ -271,7 +271,7 @@ Agnode_t *agsubnode(Agraph_t * g, Agnode_t * n0, int cflag) return n; } -int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) +static int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { Agsubnode_t *sn0, *sn1; @@ -283,7 +283,7 @@ int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) return 0; } -int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) +static int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { Agsubnode_t *sn0, *sn1; @@ -335,7 +335,7 @@ Dtdisc_t Ag_subnode_seq_disc = { NIL(Dtevent_f) }; -void agnodesetfinger(Agraph_t * g, Agnode_t * n, void *ignored) +static void agnodesetfinger(Agraph_t * g, Agnode_t * n, void *ignored) { static Agsubnode_t template; template.node = n; @@ -343,7 +343,7 @@ void agnodesetfinger(Agraph_t * g, Agnode_t * n, void *ignored) NOTUSED(ignored); } -void agnoderenew(Agraph_t * g, Agnode_t * n, void *ignored) +static void agnoderenew(Agraph_t * g, Agnode_t * n, void *ignored) { dtrenew(g->n_seq, dtfinger(g->n_seq)); NOTUSED(n); diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 60ca4d697..b6d56aaa0 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -377,7 +377,7 @@ static int irrelevant_subgraph(Agraph_t * g) return TRUE; } -int node_in_subg(Agraph_t * g, Agnode_t * n) +static int node_in_subg(Agraph_t * g, Agnode_t * n) { Agraph_t *subg; diff --git a/lib/circogen/circularinit.c b/lib/circogen/circularinit.c index d5d89081b..14659443e 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -100,7 +100,7 @@ static node_t *makeDerivedNode(graph_t * dg, char *name, int isNode, * Each component has its blocks as subgraphs. * FIX: Check that blocks are disjoint. */ -Agraph_t **circomps(Agraph_t * g, int *cnt) +static Agraph_t **circomps(Agraph_t * g, int *cnt) { int c_cnt; Agraph_t **ccs; diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 7b2815425..7fa5b390c 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -828,7 +828,7 @@ void free_html_text(htmltxt_t * t) free(t); } -void free_html_img(htmlimg_t * ip) +static void free_html_img(htmlimg_t * ip) { free(ip->src); free(ip); @@ -1333,7 +1333,7 @@ static int processTbl(graph_t * g, htmltbl_t * tbl, htmlenv_t * env) * A cell spanning columns contributes proportionately to each column * it is in. */ -void sizeLinearArray(htmltbl_t * tbl) +static void sizeLinearArray(htmltbl_t * tbl) { htmlcell_t *cp; htmlcell_t **cells; @@ -1375,7 +1375,7 @@ static char *nnames[] = { /* nToName: * Convert int to its decimal string representation. */ -char *nToName(int c) +static char *nToName(int c) { static char name[100]; @@ -1453,7 +1453,7 @@ checkEdge (graph_t* g, node_t* t, node_t* h, int sz) * Ditto for rows. * */ -void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) +static void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) { htmlcell_t *cp; htmlcell_t **cells; @@ -1510,7 +1510,7 @@ void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) * give the coordinate, so to get the width/height, we have * to subtract the previous value. */ -void setSizes(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) +static void setSizes(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) { int i; node_t *n; @@ -1538,7 +1538,7 @@ void setSizes(htmltbl_t * tbl, graph_t * rowg, graph_t * colg) * a dag on a chain. We then run network simplex, using * LR_balance. */ -void sizeArray(htmltbl_t * tbl) +static void sizeArray(htmltbl_t * tbl) { graph_t *rowg; graph_t *colg; diff --git a/lib/dotgen/cluster.c b/lib/dotgen/cluster.c index c84ef3fa4..b1f3ce63b 100644 --- a/lib/dotgen/cluster.c +++ b/lib/dotgen/cluster.c @@ -161,7 +161,7 @@ make_interclust_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig) * attach and install edges between clusters. * essentially, class2() for interclust edges. */ -void interclexp(graph_t * subg) +static void interclexp(graph_t * subg) { graph_t *g; node_t *n; diff --git a/lib/dotgen/fastgr.c b/lib/dotgen/fastgr.c index ecfc201f0..637bd84d5 100644 --- a/lib/dotgen/fastgr.c +++ b/lib/dotgen/fastgr.c @@ -237,7 +237,7 @@ void delete_fast_node(graph_t * g, node_t * n) GD_nlist(g) = ND_next(n); } -node_t *named_virtual_node(graph_t * g, char *s) +static node_t *named_virtual_node(graph_t * g, char *s) { node_t *n; diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index 7d5f73ae9..c0a106142 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -1200,7 +1200,7 @@ static void init_mincross(graph_t * g) GlobalMaxRank = GD_maxrank(g); } -void flat_rev(Agraph_t * g, Agedge_t * e) +static void flat_rev(Agraph_t * g, Agedge_t * e) { int j; Agedge_t *rev; diff --git a/lib/edgepaint/intersection.c b/lib/edgepaint/intersection.c index e7063d098..1c946e789 100644 --- a/lib/edgepaint/intersection.c +++ b/lib/edgepaint/intersection.c @@ -62,7 +62,7 @@ static real dist(int dim, real *x, real *y){ return sqrt(d); } -real point_line_distance(real *p, real *q, real *r){ +static real point_line_distance(real *p, real *q, real *r){ /* distance between point p and line q--r */ enum {dim = 2}; real t = 0, b = 0; diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index ce2d30cb1..a9e1dab84 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -690,7 +690,7 @@ addItem (Dt_t* arr, Extype_t v, char* tok) * break string into possibly empty fields and store in array * return number of fields */ -Extype_t +static Extype_t exsplit(Expr_t * ex, register Exnode_t * expr, void *env) { Extype_t v; @@ -742,7 +742,7 @@ exsplit(Expr_t * ex, register Exnode_t * expr, void *env) * tokenize string and store in array * return number of tokens */ -Extype_t +static Extype_t extokens(Expr_t * ex, register Exnode_t * expr, void *env) { Extype_t v; @@ -781,7 +781,7 @@ extokens(Expr_t * ex, register Exnode_t * expr, void *env) /* exsub: * return string after pattern substitution */ -Extype_t +static Extype_t exsub(Expr_t * ex, register Exnode_t * expr, void *env, int global) { char *str; diff --git a/lib/gvpr/parse.c b/lib/gvpr/parse.c index 969bbb812..376dd1c71 100644 --- a/lib/gvpr/parse.c +++ b/lib/gvpr/parse.c @@ -141,7 +141,7 @@ static int readc(Sfio_t * str, Sfio_t * ostr) * push character back onto stream; * if newline, reduce lineno. */ -void unreadc(Sfio_t * str, int c) +static void unreadc(Sfio_t * str, int c) { sfungetc(str, c); if (c == '\n') diff --git a/lib/label/xlabels.c b/lib/label/xlabels.c index 26146b977..fa10bf2ba 100644 --- a/lib/label/xlabels.c +++ b/lib/label/xlabels.c @@ -119,7 +119,7 @@ static int floorLog2(unsigned int n) * determine the order(depth) of the hilbert sfc so that we satisfy the * precondition of hd_hil_s_from_xy() */ -unsigned int xlhorder(XLabels_t * xlp) +static unsigned int xlhorder(XLabels_t * xlp) { double maxx = xlp->params->bb.UR.x, maxy = xlp->params->bb.UR.y; return floorLog2(maxx > maxy ? maxx : maxy) + 1; diff --git a/lib/neatogen/overlap.c b/lib/neatogen/overlap.c index f09f8c3f6..62044cec0 100644 --- a/lib/neatogen/overlap.c +++ b/lib/neatogen/overlap.c @@ -107,18 +107,18 @@ static int comp_scan_points(const void *p, const void *q){ } -void NodeDest(void* a) { +static void NodeDest(void* a) { /* free((int*)a);*/ } -int NodeComp(const void* a,const void* b) { +static int NodeComp(const void* a,const void* b) { return comp_scan_points(a,b); } -void NodePrint(const void* a) { +static void NodePrint(const void* a) { scan_point *aa; aa = (scan_point *) a; @@ -126,11 +126,11 @@ void NodePrint(const void* a) { } -void InfoPrint(void* a) { +static void InfoPrint(void* a) { ; } -void InfoDest(void *a){ +static void InfoDest(void *a){ ; } diff --git a/lib/neatogen/sgd.c b/lib/neatogen/sgd.c index 4d809c56b..906ee03c8 100644 --- a/lib/neatogen/sgd.c +++ b/lib/neatogen/sgd.c @@ -7,7 +7,7 @@ #include -float calculate_stress(float *pos, term_sgd *terms, int n_terms) { +static float calculate_stress(float *pos, term_sgd *terms, int n_terms) { float stress = 0; int ij; for (ij=0; ijsources); free(graph->pinneds); free(graph->targets); diff --git a/lib/neatogen/stuff.c b/lib/neatogen/stuff.c index f504aab32..ba1796551 100644 --- a/lib/neatogen/stuff.c +++ b/lib/neatogen/stuff.c @@ -451,7 +451,7 @@ void solve_model(graph_t * G, int nG) MaxIter, agnameof(G)); } -void update_arrays(graph_t * G, int nG, int i) +static void update_arrays(graph_t * G, int nG, int i) { int j, k; double del[MAXDIM], dist, old; diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index a268b58c2..9f8d27c96 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -497,7 +497,7 @@ static int clMarkFn (Agnode_t* n, int v) * with both endpoints in g. * Returns the number of edges added. */ -int node_induce(Agraph_t * g, Agraph_t* eg) +static int node_induce(Agraph_t * g, Agraph_t* eg) { Agnode_t *n; Agedge_t *e; diff --git a/lib/pack/pack.c b/lib/pack/pack.c index acac6f6c1..63f66ff17 100644 --- a/lib/pack/pack.c +++ b/lib/pack/pack.c @@ -108,8 +108,7 @@ static int cmpf(const void *X, const void *Y) * Mark cells crossed by line from cell p to cell q. * Bresenham's algorithm, from Graphics Gems I, pp. 99-100. */ -/* static */ -void fillLine(pointf p, pointf q, PointSet * ps) +static void fillLine(pointf p, pointf q, PointSet * ps) { int x1 = ROUND(p.x); int y1 = ROUND(p.y); diff --git a/lib/pathplan/shortestpth.c b/lib/pathplan/shortestpth.c index 85b49b4bf..2040706fd 100644 --- a/lib/pathplan/shortestpth.c +++ b/lib/pathplan/shortestpth.c @@ -32,7 +32,7 @@ static COORD unseen = (double) INT_MAX; * This implementation only uses the lower left triangle of the * adjacency matrix, i.e., the values a[i][j] where i >= j. */ -int *shortestPath(int root, int target, int V, array2 wadj) +static int *shortestPath(int root, int target, int V, array2 wadj) { int *dad; COORD *vl; diff --git a/lib/pathplan/visibility.c b/lib/pathplan/visibility.c index ac5743077..31a097c31 100644 --- a/lib/pathplan/visibility.c +++ b/lib/pathplan/visibility.c @@ -89,7 +89,7 @@ static int open_intersect(Ppoint_t a, Ppoint_t b, Ppoint_t c, Ppoint_t d) /* inBetween: * Return true if c is in (a,b), assuming a,b,c are collinear. */ -int inBetween(Ppoint_t a, Ppoint_t b, Ppoint_t c) +static int inBetween(Ppoint_t a, Ppoint_t b, Ppoint_t c) { if (a.x != b.x) /* not vertical */ return (((a.x < c.x) && (c.x < b.x)) diff --git a/lib/rbtree/red_black_tree.c b/lib/rbtree/red_black_tree.c index b0ea5e339..cc9c6dea1 100644 --- a/lib/rbtree/red_black_tree.c +++ b/lib/rbtree/red_black_tree.c @@ -83,7 +83,7 @@ rb_red_blk_tree* RBTreeCreate( int (*CompFunc) (const void*,const void*), /* accordingly. */ /***********************************************************************/ -void LeftRotate(rb_red_blk_tree* tree, rb_red_blk_node* x) { +static void LeftRotate(rb_red_blk_tree* tree, rb_red_blk_node* x) { rb_red_blk_node* y; rb_red_blk_node* nil=tree->nil; @@ -138,7 +138,7 @@ void LeftRotate(rb_red_blk_tree* tree, rb_red_blk_node* x) { /* accordingly. */ /***********************************************************************/ -void RightRotate(rb_red_blk_tree* tree, rb_red_blk_node* y) { +static void RightRotate(rb_red_blk_tree* tree, rb_red_blk_node* y) { rb_red_blk_node* x; rb_red_blk_node* nil=tree->nil; @@ -189,7 +189,7 @@ void RightRotate(rb_red_blk_tree* tree, rb_red_blk_node* y) { /* by the RBTreeInsert function and not by the user */ /***********************************************************************/ -void TreeInsertHelp(rb_red_blk_tree* tree, rb_red_blk_node* z) { +static void TreeInsertHelp(rb_red_blk_tree* tree, rb_red_blk_node* z) { /* This function should only be called by InsertRBTree (see above) */ rb_red_blk_node* x; rb_red_blk_node* y; @@ -382,7 +382,7 @@ rb_red_blk_node* TreePredecessor(rb_red_blk_tree* tree, rb_red_blk_node* x) { /* Note: This function should only be called from RBTreePrint */ /***********************************************************************/ -void InorderTreePrint(rb_red_blk_tree* tree, rb_red_blk_node* x) { +static void InorderTreePrint(rb_red_blk_tree* tree, rb_red_blk_node* x) { rb_red_blk_node* nil=tree->nil; rb_red_blk_node* root=tree->root; if (x != tree->nil) { @@ -418,7 +418,7 @@ void InorderTreePrint(rb_red_blk_tree* tree, rb_red_blk_node* x) { /* Note: This function should only be called by RBTreeDestroy */ /***********************************************************************/ -void TreeDestHelper(rb_red_blk_tree* tree, rb_red_blk_node* x) { +static void TreeDestHelper(rb_red_blk_tree* tree, rb_red_blk_node* x) { rb_red_blk_node* nil=tree->nil; if (x != nil) { TreeDestHelper(tree,x->left); @@ -519,7 +519,7 @@ rb_red_blk_node* RBExactQuery(rb_red_blk_tree* tree, void* q) { /* The algorithm from this function is from _Introduction_To_Algorithms_ */ /***********************************************************************/ -void RBDeleteFixUp(rb_red_blk_tree* tree, rb_red_blk_node* x) { +static void RBDeleteFixUp(rb_red_blk_tree* tree, rb_red_blk_node* x) { rb_red_blk_node* root=tree->root->left; rb_red_blk_node* w; diff --git a/lib/rbtree/test_red_black_tree.c b/lib/rbtree/test_red_black_tree.c index 5b831e9ac..3881eb60c 100644 --- a/lib/rbtree/test_red_black_tree.c +++ b/lib/rbtree/test_red_black_tree.c @@ -30,11 +30,11 @@ void IntPrint(const void* a) { printf("%i",*(int*)a); } -void InfoPrint(void* a) { +static void InfoPrint(void* a) { ; } -void InfoDest(void *a){ +static void InfoDest(void *a){ ; } diff --git a/lib/sfdpgen/Multilevel.c b/lib/sfdpgen/Multilevel.c index 03a34a5b7..2e3e4ee21 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -812,7 +812,7 @@ static void maximal_independent_edge_set_heavest_edge_pernode_scaled(SparseMatri } } -SparseMatrix DistanceMatrix_restrict_cluster(int ncluster, int *clusterp, int *cluster, SparseMatrix P, SparseMatrix R, SparseMatrix D){ +static SparseMatrix DistanceMatrix_restrict_cluster(int ncluster, int *clusterp, int *cluster, SparseMatrix P, SparseMatrix R, SparseMatrix D){ #if 0 /* this construct a distance matrix of a coarse graph, for a coarsen give by merging all nodes in each cluster */ SparseMatrix cD = NULL; @@ -932,13 +932,13 @@ SparseMatrix DistanceMatrix_restrict_cluster(int ncluster, int *clusterp, int *c return NULL; } -SparseMatrix DistanceMatrix_restrict_matching(int *matching, SparseMatrix D){ +static SparseMatrix DistanceMatrix_restrict_matching(int *matching, SparseMatrix D){ if (!D) return NULL; assert(0);/* not yet implemented! */ return NULL; } -SparseMatrix DistanceMatrix_restrict_filtering(int *mask, int is_C, int is_F, SparseMatrix D){ +static SparseMatrix DistanceMatrix_restrict_filtering(int *mask, int is_C, int is_F, SparseMatrix D){ /* max independent vtx set based coarsening. Coarsen nodes has mask >= is_C. Fine nodes == is_F. */ if (!D) return NULL; assert(0);/* not yet implemented! */ diff --git a/lib/sfdpgen/post_process.c b/lib/sfdpgen/post_process.c index 33519e715..0e8aa8a43 100644 --- a/lib/sfdpgen/post_process.c +++ b/lib/sfdpgen/post_process.c @@ -248,7 +248,7 @@ real get_full_stress(SparseMatrix A, int dim, real *x, int weighting_scheme){ #endif -SparseMatrix ideal_distance_matrix(SparseMatrix A, int dim, real *x){ +static SparseMatrix ideal_distance_matrix(SparseMatrix A, int dim, real *x){ /* find the ideal distance between edges, either 1, or |N[i] \Union N[j]| - |N[i] \Intersection N[j]| */ SparseMatrix D; diff --git a/lib/sfdpgen/sparse_solve.c b/lib/sfdpgen/sparse_solve.c index b8fab8471..e4fe63dc0 100644 --- a/lib/sfdpgen/sparse_solve.c +++ b/lib/sfdpgen/sparse_solve.c @@ -34,7 +34,7 @@ void Operator_uniform_stress_matmul_delete(Operator o){ FREE(o->data); } -real *Operator_uniform_stress_matmul_apply(Operator o, real *x, real *y){ +static real *Operator_uniform_stress_matmul_apply(Operator o, real *x, real *y){ struct uniform_stress_matmul_data *d = (struct uniform_stress_matmul_data*) (o->data); SparseMatrix A = d->A; real alpha = d->alpha; @@ -66,13 +66,13 @@ Operator Operator_uniform_stress_matmul(SparseMatrix A, real alpha){ } -real *Operator_matmul_apply(Operator o, real *x, real *y){ +static real *Operator_matmul_apply(Operator o, real *x, real *y){ SparseMatrix A = (SparseMatrix) o->data; SparseMatrix_multiply_vector(A, x, &y, FALSE); return y; } -Operator Operator_matmul_new(SparseMatrix A){ +static Operator Operator_matmul_new(SparseMatrix A){ Operator o; o = GNEW(struct Operator_struct); @@ -82,12 +82,12 @@ Operator Operator_matmul_new(SparseMatrix A){ } -void Operator_matmul_delete(Operator o){ +static void Operator_matmul_delete(Operator o){ if (o) FREE(o); } -real* Operator_diag_precon_apply(Operator o, real *x, real *y){ +static real* Operator_diag_precon_apply(Operator o, real *x, real *y){ int i, m; real *diag = (real*) o->data; m = (int) diag[0]; @@ -126,7 +126,7 @@ Operator Operator_uniform_stress_diag_precon_new(SparseMatrix A, real alpha){ } -Operator Operator_diag_precon_new(SparseMatrix A){ +static Operator Operator_diag_precon_new(SparseMatrix A){ Operator o; real *diag; int i, j, m = A->m, *ia = A->ia, *ja = A->ja; @@ -154,7 +154,7 @@ Operator Operator_diag_precon_new(SparseMatrix A){ return o; } -void Operator_diag_precon_delete(Operator o){ +static void Operator_diag_precon_delete(Operator o){ if (o->data) FREE(o->data); if (o) FREE(o); } @@ -246,7 +246,7 @@ real cg(Operator Ax, Operator precond, int n, int dim, real *x0, real *rhs, real } -real* jacobi(SparseMatrix A, int dim, real *x0, real *rhs, int maxit, int *flag){ +static real* jacobi(SparseMatrix A, int dim, real *x0, real *rhs, int maxit, int *flag){ /* maxit iteration of jacobi */ real *x, *y, *b, sum, diag, *a; int k, i, j, n = A->n, *ia, *ja, iter; diff --git a/lib/sfdpgen/spring_electrical.c b/lib/sfdpgen/spring_electrical.c index cf9d30503..608bc62ff 100644 --- a/lib/sfdpgen/spring_electrical.c +++ b/lib/sfdpgen/spring_electrical.c @@ -316,14 +316,14 @@ static real update_step(int adaptive_cooling, real step, real Fnorm, real Fnorm0 #define node_degree(i) (ia[(i)+1] - ia[(i)]) -void check_real_array_size(real **a, int len, int *lenmax){ +static void check_real_array_size(real **a, int len, int *lenmax){ if (len >= *lenmax){ *lenmax = len + MAX((int) 0.2*len, 10); *a = REALLOC(*a, sizeof(real)*(*lenmax)); } } -void check_int_array_size(int **a, int len, int *lenmax){ +static void check_int_array_size(int **a, int len, int *lenmax){ if (len >= *lenmax){ *lenmax = len + MAX((int) 0.2*len, 10); *a = REALLOC(*a, sizeof(int)*(*lenmax)); @@ -331,7 +331,7 @@ void check_int_array_size(int **a, int len, int *lenmax){ } -real get_angle(real *x, int dim, int i, int j){ +static real get_angle(real *x, int dim, int i, int j){ /* between [0, 2Pi)*/ int k; real y[2], res; @@ -352,7 +352,7 @@ real get_angle(real *x, int dim, int i, int j){ return res; } -int comp_real(const void *x, const void *y){ +static int comp_real(const void *x, const void *y){ real *xx = (real*) x; real *yy = (real*) y; @@ -683,7 +683,7 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica } -void spring_electrical_embedding_slow(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){ +static void spring_electrical_embedding_slow(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){ /* a version that does vertex moves in one go, instead of one at a time, use for debugging the fast version. Quadtree is not used. */ /* x is a point to a 1D array, x[i*dim+j] gives the coordinate of the i-th node at dimension j. */ SparseMatrix A = A0; @@ -1255,7 +1255,7 @@ static real dmean_get(int n, int *id, int *jd, real* d){ return dmean/((real) id[n]); } -void spring_maxent_embedding(int dim, SparseMatrix A0, SparseMatrix D, spring_electrical_control ctrl, real *node_weights, real *x, real rho, int *flag){ +static void spring_maxent_embedding(int dim, SparseMatrix A0, SparseMatrix D, spring_electrical_control ctrl, real *node_weights, real *x, real rho, int *flag){ /* x is a point to a 1D array, x[i*dim+j] gives the coordinate of the i-th node at dimension j. Minimize \Sum_{(i,j)\in E} w_ij (||x_i-x_j||-d_ij)^2 - \rho \Sum_{(i,j)\NotIn E} Log ||x_i-x_j|| diff --git a/lib/sfdpgen/stress_model.c b/lib/sfdpgen/stress_model.c index b53bc404b..f95bfb950 100644 --- a/lib/sfdpgen/stress_model.c +++ b/lib/sfdpgen/stress_model.c @@ -4,7 +4,7 @@ #include "post_process.h" #include "stress_model.h" -void stress_model_core(int dim, SparseMatrix B, real **x, int edge_len_weighted, int maxit_sm, real tol, int *flag){ +static void stress_model_core(int dim, SparseMatrix B, real **x, int edge_len_weighted, int maxit_sm, real tol, int *flag){ int m; SparseStressMajorizationSmoother sm; real lambda = 0; diff --git a/lib/sfdpgen/uniform_stress.c b/lib/sfdpgen/uniform_stress.c index 23269079c..1fc19b208 100644 --- a/lib/sfdpgen/uniform_stress.c +++ b/lib/sfdpgen/uniform_stress.c @@ -103,13 +103,13 @@ void UniformStressSmoother_delete(UniformStressSmoother sm){ } -real UniformStressSmoother_smooth(UniformStressSmoother sm, int dim, real *x, int maxit_sm) { +static real UniformStressSmoother_smooth(UniformStressSmoother sm, int dim, real *x, int maxit_sm) { return StressMajorizationSmoother_smooth(sm, dim, x, maxit_sm, 0.001); } -SparseMatrix get_distance_matrix(SparseMatrix A, real scaling){ +static SparseMatrix get_distance_matrix(SparseMatrix A, real scaling){ /* get a distance matrix from a graph, at the moment we just symmetrize the matrix. At the moment if the matrix is not real, we just assume distance of 1 among edges. Then we apply scaling to the entire matrix */ SparseMatrix B; diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index a493a7858..ad80d5882 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -650,7 +650,7 @@ char *cat_string(char *s1, char *s2){ return s; } -char *cat_string3(char *s1, char *s2, char *s3, int id){ +static char *cat_string3(char *s1, char *s2, char *s3, int id){ char *s; char sid[1000]; sprintf(sid,"%d",id); diff --git a/lib/sparse/QuadTree.c b/lib/sparse/QuadTree.c index ad32ffd85..08bd95a66 100644 --- a/lib/sparse/QuadTree.c +++ b/lib/sparse/QuadTree.c @@ -42,24 +42,24 @@ static node_data node_data_new(int dim, real weight, real *coord, int id){ return nd; } -void node_data_delete(void *d){ +static void node_data_delete(void *d){ node_data nd = (node_data) d; FREE(nd->coord); /*delete outside if (nd->data) FREE(nd->data);*/ FREE(nd); } -real node_data_get_weight(void *d){ +static real node_data_get_weight(void *d){ node_data nd = (node_data) d; return nd->node_weight; } -real* node_data_get_coord(void *d){ +static real* node_data_get_coord(void *d){ node_data nd = (node_data) d; return nd->coord; } -int node_data_get_id(void *d){ +static int node_data_get_id(void *d){ node_data nd = (node_data) d; return nd->id; } @@ -67,7 +67,7 @@ int node_data_get_id(void *d){ #define node_data_get_data(d) (((node_data) (d))->data) -void check_or_realloc_arrays(int dim, int *nsuper, int *nsupermax, real **center, real **supernode_wgts, real **distances){ +static void check_or_realloc_arrays(int dim, int *nsuper, int *nsupermax, real **center, real **supernode_wgts, real **distances){ if (*nsuper >= *nsupermax) { *nsupermax = *nsuper + MAX(10, (int) 0.2*(*nsuper)); @@ -77,7 +77,7 @@ void check_or_realloc_arrays(int dim, int *nsuper, int *nsupermax, real **center } } -void QuadTree_get_supernodes_internal(QuadTree qt, real bh, real *point, int nodeid, int *nsuper, int *nsupermax, real **center, real **supernode_wgts, real **distances, real *counts, int *flag){ +static void QuadTree_get_supernodes_internal(QuadTree qt, real bh, real *point, int nodeid, int *nsuper, int *nsupermax, real **center, real **supernode_wgts, real **distances, real *counts, int *flag){ SingleLinkedList l; real *coord, dist; int dim, i; diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index b87f1fb0f..2f89f7336 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -417,7 +417,7 @@ void SparseMatrix_delete(SparseMatrix A){ if (A->a) FREE(A->a); FREE(A); } -void SparseMatrix_print_csr(char *c, SparseMatrix A){ +static void SparseMatrix_print_csr(char *c, SparseMatrix A){ int *ia, *ja; real *a; int *ai; @@ -478,7 +478,7 @@ void SparseMatrix_print_csr(char *c, SparseMatrix A){ -void SparseMatrix_print_coord(char *c, SparseMatrix A){ +static void SparseMatrix_print_coord(char *c, SparseMatrix A){ int *ia, *ja; real *a; int *ai; @@ -2492,7 +2492,7 @@ int SparseMatrix_has_diagonal(SparseMatrix A){ return FALSE; } -void SparseMatrix_level_sets_internal(int khops, SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask){ +static void SparseMatrix_level_sets_internal(int khops, SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask){ /* mask is assumed to be initialized to negative if provided. . On exit, mask = levels for visited nodes (1 for root, 2 for its neighbors, etc), . unless reinitialize_mask = TRUE, in which case mask = -1. diff --git a/lib/sparse/colorutil.c b/lib/sparse/colorutil.c index 4239fc659..d70179fe2 100644 --- a/lib/sparse/colorutil.c +++ b/lib/sparse/colorutil.c @@ -39,7 +39,7 @@ void rgb2hex(float r, float g, float b, char *cstring, char *opacity){ } } -real Hue2RGB(real v1, real v2, real H) { +static real Hue2RGB(real v1, real v2, real H) { if(H < 0.0) H += 1.0; if(H > 1.0) H -= 1.0; if((6.0*H) < 1.0) return (v1 + (v2 - v1) * 6.0 * H); diff --git a/lib/sparse/general.c b/lib/sparse/general.c index 6e189ed80..9204d29ce 100644 --- a/lib/sparse/general.c +++ b/lib/sparse/general.c @@ -155,7 +155,7 @@ void vector_float_take(int n, float *v, int m, int *p, float **u){ } -int comp_ascend(const void *s1, const void *s2){ +static int comp_ascend(const void *s1, const void *s2){ real *ss1, *ss2; ss1 = (real*) s1; ss2 = (real*) s2; @@ -168,7 +168,7 @@ int comp_ascend(const void *s1, const void *s2){ return 0; } -int comp_descend(const void *s1, const void *s2){ +static int comp_descend(const void *s1, const void *s2){ real *ss1, *ss2; ss1 = (real*) s1; ss2 = (real*) s2; @@ -180,7 +180,7 @@ int comp_descend(const void *s1, const void *s2){ } return 0; } -int comp_descend_int(const void *s1, const void *s2){ +static int comp_descend_int(const void *s1, const void *s2){ int *ss1, *ss2; ss1 = (int*) s1; ss2 = (int*) s2; @@ -193,7 +193,7 @@ int comp_descend_int(const void *s1, const void *s2){ return 0; } -int comp_ascend_int(const void *s1, const void *s2){ +static int comp_ascend_int(const void *s1, const void *s2){ int *ss1, *ss2; ss1 = (int*) s1; ss2 = (int*) s2; diff --git a/lib/sparse/mq.c b/lib/sparse/mq.c index eddee3310..055628c81 100644 --- a/lib/sparse/mq.c +++ b/lib/sparse/mq.c @@ -153,7 +153,7 @@ static real get_mq(SparseMatrix A, int *assignment, int *ncluster0, real *mq_in0 } } -Multilevel_MQ_Clustering Multilevel_MQ_Clustering_init(SparseMatrix A, int level){ +static Multilevel_MQ_Clustering Multilevel_MQ_Clustering_init(SparseMatrix A, int level){ Multilevel_MQ_Clustering grid; int n = A->n, i; int *matching; @@ -207,7 +207,7 @@ Multilevel_MQ_Clustering Multilevel_MQ_Clustering_init(SparseMatrix A, int level return grid; } -void Multilevel_MQ_Clustering_delete(Multilevel_MQ_Clustering grid){ +static void Multilevel_MQ_Clustering_delete(Multilevel_MQ_Clustering grid){ if (!grid) return; if (grid->A){ if (grid->level == 0) { @@ -226,7 +226,7 @@ void Multilevel_MQ_Clustering_delete(Multilevel_MQ_Clustering grid){ FREE(grid); } -Multilevel_MQ_Clustering Multilevel_MQ_Clustering_establish(Multilevel_MQ_Clustering grid, int maxcluster){ +static Multilevel_MQ_Clustering Multilevel_MQ_Clustering_establish(Multilevel_MQ_Clustering grid, int maxcluster){ int *matching = grid->matching; SparseMatrix A = grid->A; int n = grid->n, level = grid->level, nc = 0, nclusters = n; @@ -509,7 +509,7 @@ Multilevel_MQ_Clustering Multilevel_MQ_Clustering_establish(Multilevel_MQ_Cluste return grid; } -Multilevel_MQ_Clustering Multilevel_MQ_Clustering_new(SparseMatrix A0, int maxcluster){ +static Multilevel_MQ_Clustering Multilevel_MQ_Clustering_new(SparseMatrix A0, int maxcluster){ /* maxcluster is used to specify the maximum number of cluster desired, e.g., maxcluster=10 means that a maximum of 10 clusters is desired. this may not always be realized, and mq may be low when this is specified. Default: maxcluster = 0 */ Multilevel_MQ_Clustering grid; diff --git a/lib/sparse/vector.c b/lib/sparse/vector.c index 798d690ab..12db94e06 100644 --- a/lib/sparse/vector.c +++ b/lib/sparse/vector.c @@ -31,7 +31,7 @@ Vector Vector_new(int maxlen, size_t size_of_elem, void (*deallocator)(void *v)) return v; } -Vector Vector_assign(Vector v, void *stuff, int i){ +static Vector Vector_assign(Vector v, void *stuff, int i){ memcpy(((char*) v->v)+(v->size_of_elem)*i/sizeof(char), stuff, v->size_of_elem); return v; } @@ -77,7 +77,7 @@ int Vector_get_length(Vector v){ /*---------------- integer vector --------------- */ -void intdealloactor(void *v){ +static void intdealloactor(void *v){ } Vector IntegerVector_new(int len){ @@ -112,10 +112,10 @@ Vector IntegerVector_reset(Vector v, int content, int pos){ /*---------------- string vector --------------- */ -void nulldealloactor(void *v){ +static void nulldealloactor(void *v){ return; } -void strdealloactor(void *v){ +static void strdealloactor(void *v){ char **s; s = (char**) v; free(*s); diff --git a/plugin/core/gvloadimage_core.c b/plugin/core/gvloadimage_core.c index 21e1e1490..82dc4ba6c 100644 --- a/plugin/core/gvloadimage_core.c +++ b/plugin/core/gvloadimage_core.c @@ -257,7 +257,7 @@ static void core_loadimage_tk(GVJ_t * job, usershape_t *us, boxf b, boolean fill us->name, (b.UR.x + b.LL.x) / 2, (b.UR.y + b.LL.y) / 2); } -void core_loadimage_null(GVJ_t *gvc, usershape_t *us, boxf b, boolean filled) +static void core_loadimage_null(GVJ_t *gvc, usershape_t *us, boxf b, boolean filled) { /* null function - basically suppress the missing loader message */ } -- 2.40.0