From 6ac3ad99e624d59a786daa3fa7fa0a253f17fff9 Mon Sep 17 00:00:00 2001 From: Ed J Date: Sat, 26 Dec 2020 19:12:36 +0000 Subject: [PATCH] ignore (or for one internal function remove) unused params --- lib/cdt/dtdisc.c | 2 ++ lib/cgraph/grammar.y | 6 +++--- lib/cgraph/graph.c | 2 ++ lib/cgraph/mem.c | 1 + lib/cgraph/node.c | 7 ++++++- lib/cgraph/utils.c | 1 + 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/cdt/dtdisc.c b/lib/cdt/dtdisc.c index 72c4adfbb..66ec43fc0 100644 --- a/lib/cdt/dtdisc.c +++ b/lib/cdt/dtdisc.c @@ -10,6 +10,8 @@ static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc) { + (void)dt; /* unused */ + (void)disc; /* unused */ if(addr) { if(size == 0) { free(addr); diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 3c2ca4892..13359541d 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -65,7 +65,7 @@ typedef struct gstack_s { static void appendnode(char *name, char *port, char *sport); static void attrstmt(int tkind, char *macroname); static void startgraph(char *name, int directed, int strict); -static void getedgeitems(int x); +static void getedgeitems(void); static void newedge(Agnode_t *t, char *tport, Agnode_t *h, char *hport, char *key); static void edgerhs(Agnode_t *n, char *tport, item *hlist, char *key); static void appendattr(char *name, char *value); @@ -137,7 +137,7 @@ compound : simple rcompound optattr simple : nodelist | subgraph ; -rcompound : T_edgeop {getedgeitems(1);} simple {getedgeitems(2);} rcompound {$$ = 1;} +rcompound : T_edgeop {getedgeitems();} simple {getedgeitems();} rcompound {$$ = 1;} | /* empty */ {$$ = 0;} ; @@ -406,7 +406,7 @@ static void endnode() /* edges - store up node/subg lists until optional edge key can be seen */ -static void getedgeitems(int x) +static void getedgeitems(void) { item *v = 0; diff --git a/lib/cgraph/graph.c b/lib/cgraph/graph.c index c3d698031..736465444 100644 --- a/lib/cgraph/graph.c +++ b/lib/cgraph/graph.c @@ -243,6 +243,8 @@ int agdegree(Agraph_t * g, Agnode_t * n, int want_in, int want_out) static int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { + (void)d; /* unused */ + (void)disc; /* unused */ ptrdiff_t v; Agraph_t *sg0, *sg1; sg0 = (Agraph_t *) arg0; diff --git a/lib/cgraph/mem.c b/lib/cgraph/mem.c index 5e3554a44..6f7e51342 100644 --- a/lib/cgraph/mem.c +++ b/lib/cgraph/mem.c @@ -17,6 +17,7 @@ /* memory management discipline and entry points */ static void *memopen(Agdisc_t* disc) { + (void)disc; /* unused */ return NULL; } diff --git a/lib/cgraph/node.c b/lib/cgraph/node.c index 2edf007b2..37c4de3a3 100644 --- a/lib/cgraph/node.c +++ b/lib/cgraph/node.c @@ -275,6 +275,8 @@ Agnode_t *agsubnode(Agraph_t * g, Agnode_t * n0, int cflag) static int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { + (void)d; /* unused */ + (void)disc; /* unused */ Agsubnode_t *sn0, *sn1; sn0 = (Agsubnode_t *) arg0; @@ -287,6 +289,8 @@ static int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) static int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) { + (void)d; /* unused */ + (void)disc; /* unused */ Agsubnode_t *sn0, *sn1; sn0 = (Agsubnode_t *) arg0; @@ -308,7 +312,8 @@ static int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) static void free_subnode (Dt_t* d, Agsubnode_t* sn, Dtdisc_t * disc) { - + (void)d; /* unused */ + (void)disc; /* unused */ if (!AGSNMAIN(sn)) agfree (sn->node->root, sn); } diff --git a/lib/cgraph/utils.c b/lib/cgraph/utils.c index e06f11f4f..4652c81af 100644 --- a/lib/cgraph/utils.c +++ b/lib/cgraph/utils.c @@ -89,6 +89,7 @@ int agdtclose(Agraph_t * g, Dict_t * dict) void agdtdisc(Agraph_t * g, Dict_t * dict, Dtdisc_t * disc) { + (void)g; /* unused */ if (disc && dtdisc(dict, NULL, 0) != disc) { dtdisc(dict, disc, 0); } -- 2.40.0