]> granicus.if.org Git - graphviz/commitdiff
mark some static functions as such
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Jun 2020 01:38:09 +0000 (18:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Jun 2020 14:00:46 +0000 (07:00 -0700)
This removes 92 -Wmissing-prototypes warnings on GCC 8.3.

39 files changed:
lib/agraph/node.c
lib/agraph/write.c
lib/cgraph/edge.c
lib/cgraph/graph.c
lib/cgraph/io.c
lib/cgraph/node.c
lib/cgraph/write.c
lib/circogen/circularinit.c
lib/common/htmltable.c
lib/dotgen/cluster.c
lib/dotgen/fastgr.c
lib/dotgen/mincross.c
lib/edgepaint/intersection.c
lib/expr/exeval.c
lib/gvpr/parse.c
lib/label/xlabels.c
lib/neatogen/overlap.c
lib/neatogen/sgd.c
lib/neatogen/stuff.c
lib/pack/ccomps.c
lib/pack/pack.c
lib/pathplan/shortestpth.c
lib/pathplan/visibility.c
lib/rbtree/red_black_tree.c
lib/rbtree/test_red_black_tree.c
lib/sfdpgen/Multilevel.c
lib/sfdpgen/post_process.c
lib/sfdpgen/sparse_solve.c
lib/sfdpgen/spring_electrical.c
lib/sfdpgen/stress_model.c
lib/sfdpgen/uniform_stress.c
lib/sparse/DotIO.c
lib/sparse/QuadTree.c
lib/sparse/SparseMatrix.c
lib/sparse/colorutil.c
lib/sparse/general.c
lib/sparse/mq.c
lib/sparse/vector.c
plugin/core/gvloadimage_core.c

index e544122fd49af313cdc0bb3c01af9232a122db15..8fc0c3e3af38b0bb269351192bb5e603d351dff0 100644 (file)
@@ -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;
 
index 96adb5a5311b70cffde18b71e99a14376856cc60..b25bd4ffd19392eac14f8ca581e1ad8b9a33160b 100644 (file)
@@ -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;
 
index e3683fa231f011445f1336a9b6d8fb9f913c3a14..c0c1af4b844c6104b558a085a25ce9507b555c07 100644 (file)
@@ -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;
 
index 0df50d2d74c619f4673b552c2383becfc4e856a3..453ac52c2910c9673d586387ae9ea9ac9f0a9bd4 100644 (file)
@@ -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;
index 5b17dc91a6a5cc4ba0349c7dbe5330256b31d9db..544e76948b99550a6416c3886a874b97594918bf 100644 (file)
@@ -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;
index b43e8bcff2e4481ffc9206bd8f693308cf621b0e..3fc3a5da3de3995d730f1eb7bd27ed078b8079ce 100644 (file)
@@ -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);
index 60ca4d6973b4b42dc0e93916a7e3a9758ed90263..b6d56aaa06c69c15fa836e059c2e946757926ff0 100644 (file)
@@ -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;
 
index d5d89081b1fe3001b2ed9bca9c083424aec452ab..14659443eb4af9464bcef9b696e496a9425bc24c 100644 (file)
@@ -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;
index 7b2815425b2f3726853282ef28183bce60c8e9d6..7fa5b390c83deaa2bf6d84d24f2ac3d76c570332 100644 (file)
@@ -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;
index c84ef3fa459124aab858bc543e88bedec35d2cf1..b1f3ce63b024119ea5efbe350079067534f05222 100644 (file)
@@ -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;
index ecfc201f03227d5eab06d14c39199435e6b4f7d8..637bd84d590ca2817170f16c8ab618e401a4f114 100644 (file)
@@ -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;
 
index 7d5f73ae9f9a75cda4a472621342fd37dbcad730..c0a10614285468d77317c92bb3e672da97d889d0 100644 (file)
@@ -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;
index e7063d098620a3ee6bfd3c9ed9f2f4c6703a439a..1c946e789d0ec3a46f50865dc7a397dfad6687fd 100644 (file)
@@ -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;
index ce2d30cb1243b35bd44b62d148514ca192d6776a..a9e1dab84a6a3ca8fbd62337c2e28186f8861e73 100644 (file)
@@ -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;
index 969bbb812f55890258d9ae8225f7d4dd704a3531..376dd1c71a483c895b381b81da68e5a9bb8924a7 100644 (file)
@@ -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')
index 26146b977619a68b79a4bfdeaaafa405a4c81d24..fa10bf2ba12a4a63332072004d4bb08223b59b5e 100644 (file)
@@ -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;
index f09f8c3f6d6aac445d8608c17521cc7acfdc3847..62044cec04b62513fa68dc66bc5473b1b9082d73 100644 (file)
@@ -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){
   ;
 }
 
index 4d809c56b3f55a8fc9d8df72038376f927e5ff70..906ee03c8d136d96919d8ef4c2d2b893f4b44eff 100644 (file)
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 
 
-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; ij<n_terms; ij++) {
@@ -34,7 +34,7 @@ static void fisheryates_shuffle(term_sgd *terms, int n_terms) {
 }
 
 // graph_sgd data structure exists only to make dijkstras faster
-graph_sgd * extract_adjacency(graph_t *G, int model) {
+static graph_sgd * extract_adjacency(graph_t *G, int model) {
     node_t *np;
     edge_t *ep;
     int n_nodes = 0, n_edges = 0;
@@ -132,7 +132,7 @@ graph_sgd * extract_adjacency(graph_t *G, int model) {
     }
     return graph;
 }
-void free_adjacency(graph_sgd *graph) {
+static void free_adjacency(graph_sgd *graph) {
     free(graph->sources);
     free(graph->pinneds);
     free(graph->targets);
index f504aab3274ece5fc8b29eba34733cf3b24372a7..ba1796551063929d739cba66539a4625a1657a57 100644 (file)
@@ -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;
index a268b58c2ce2008330400e89847909fbc8a9c54a..9f8d27c9676ed40818e213922c858ac6d1a27ccc 100644 (file)
@@ -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;
index acac6f6c18aac36b9269f9fcec605055807c71f5..63f66ff17f6f3d08928c12342783b2798ef73585 100644 (file)
@@ -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);
index 85b49b4bf3cfcceca52ac7058c63b79fcce95c49..2040706fdc2d1ff6727eca0d5f2fc82b4ccbdf4a 100644 (file)
@@ -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;
index ac5743077d943817f18dde35cc74faaab9804af6..31a097c31646a832973dfc9cff16497acad21d35 100644 (file)
@@ -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))
index b0ea5e33983cb1639d9dd5c265ba682d36f046d3..cc9c6dea107d4b6a4b7c328cf35384da023a5978 100644 (file)
@@ -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;
 
index 5b831e9ac7bc1b1e2efa74e7115a0e378c2215d7..3881eb60ce5fa13753bc93932b25baccfc248960 100644 (file)
@@ -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){
   ;
 }
 
index 03a34a5b7163f7a36b69b1ca307986e64e77605b..2e3e4ee213ac5bad9864711d3e4cb297464ecf79 100644 (file)
@@ -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! */
index 33519e715bdcebc6b1ae5b518c0a337d2d2415dc..0e8aa8a4307d71c50a76ee207fba1bdcdb74f4ab 100644 (file)
@@ -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;
index b8fab847193b26b458fc204efa969c18d808067b..e4fe63dc0bd235729c015aeb7f130a5b84708aaa 100644 (file)
@@ -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;
index cf9d30503a8c5028d6a40f875a4df977051a0df4..608bc62ff2e1e26906407d3957c85b5317957f10 100644 (file)
@@ -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||
index b53bc404be012ea99c449a7ba60330ba9628f3dd..f95bfb950339add949259f9ce0c81714e82d38cf 100644 (file)
@@ -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;
index 23269079ca096a3089f560fbd335951f1f8a0019..1fc19b2082559ce2e45d01d1c705536e1c3df1ce 100644 (file)
@@ -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;
index a493a7858bc0fae4afba39e2d80f08f9f595d94a..ad80d5882c8643ba08238b0256660af087d4c20a 100644 (file)
@@ -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);
index ad32ffd851d482284be5c49cc6b0a28bb5ad3c16..08bd95a663a70bf6053c5853425854119aaf440e 100644 (file)
@@ -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;
index b87f1fb0f93470c296aebaa4ed48f86a9b574946..2f89f7336901f67ff3e1469815812007db47c8b2 100644 (file)
@@ -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.
index 4239fc65985aba2be9926eabbe346858a9f077a1..d70179fe245056e120a7934ba88681da7a441a6d 100644 (file)
@@ -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);
index 6e189ed8064eea0fbcb4f0904a8a9a6e9e2562d9..9204d29ce2ea3d62e6594a7560a1fcd410126c6e 100644 (file)
@@ -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;
index eddee3310501ea9b02902b4bf4f1dcc88b1640eb..055628c8172a8ba455ea57a60c075ab97cd52761 100644 (file)
@@ -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;
index 798d690ab2314f2e949330afc302f3188bad6d7e..12db94e0621bf9d8cdd991f78335c5b276ece1be 100644 (file)
@@ -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);
index 21e1e1490f5f51651d578b8d4e4e927267ebcc48..82dc4ba6c5d341f13d3aa36151af2538dba9cd4b 100644 (file)
@@ -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 */
 }