From 1780e0eace5a83e7f5a79c2213a0c8b701696564 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 19 Feb 2022 13:55:41 -0800 Subject: [PATCH] [nfc] remove 'NOTUSED' and propagate its definition everywhere Gitlab: closes #2195 --- lib/cdt/dthdr.h | 2 -- lib/cdt/dtview.c | 2 +- lib/cgraph/apply.c | 2 +- lib/cgraph/attr.c | 4 ++-- lib/cgraph/cghdr.h | 2 -- lib/cgraph/edge.c | 12 ++++++------ lib/cgraph/id.c | 24 ++++++++++++------------ lib/cgraph/imap.c | 8 ++++---- lib/cgraph/mem.c | 6 +++--- lib/cgraph/node.c | 10 +++++----- lib/cgraph/pend.c | 4 ++-- lib/cgraph/rec.c | 4 ++-- lib/cgraph/refstr.c | 4 ++-- lib/cgraph/utils.c | 8 ++++---- lib/cgraph/write.c | 4 ++-- lib/common/logic.h | 4 ---- lib/common/macros.h | 4 ---- lib/common/utils.c | 6 +++--- lib/fdpgen/grid.c | 8 ++++---- lib/fdpgen/tlayout.c | 2 +- lib/gvc/gvdevice.c | 2 +- lib/neatogen/constraint.c | 4 ++-- lib/neatogen/multispline.c | 24 ++++++++++++------------ lib/neatogen/neatosplines.c | 12 ++++++------ lib/sfdpgen/Multilevel.c | 12 ++++++------ lib/sfdpgen/post_process.c | 4 ++-- lib/sfio/sfhdr.h | 3 --- lib/sfio/sfungetc.c | 2 +- plugin/gd/gvrender_gd.c | 4 +--- tclpkg/tcldot/tcldot-id.c | 10 +++++----- 30 files changed, 90 insertions(+), 107 deletions(-) diff --git a/lib/cdt/dthdr.h b/lib/cdt/dthdr.h index 27ae9463b..0d91056d7 100644 --- a/lib/cdt/dthdr.h +++ b/lib/cdt/dthdr.h @@ -43,5 +43,3 @@ #define RROTATE(x,y) (rrotate(x,y), (x) = (y)) #define LROTATE(x,y) (lrotate(x,y), (x) = (y)) - -#define NOTUSED(x) (void)(x) diff --git a/lib/cdt/dtview.c b/lib/cdt/dtview.c index 8e2a39987..c3d139790 100644 --- a/lib/cdt/dtview.c +++ b/lib/cdt/dtview.c @@ -13,7 +13,7 @@ static void* dtvsearch(Dt_t* dt, void* obj, int type) void *o, *n, *ok, *nk; int cmp, lk, sz, ky; Dtcompar_f cmpf; - NOTUSED(lk); + (void)lk; /* these operations only happen at the top level */ if(type&(DT_INSERT|DT_DELETE|DT_CLEAR|DT_RENEW)) diff --git a/lib/cgraph/apply.c b/lib/cgraph/apply.c index 8804d3355..22a453b07 100644 --- a/lib/cgraph/apply.c +++ b/lib/cgraph/apply.c @@ -30,7 +30,7 @@ static Agobj_t *subedge_search(Agraph_t * sub, Agobj_t * e) static Agobj_t *subgraph_search(Agraph_t * sub, Agobj_t * g) { - NOTUSED(g); + (void)g; return (Agobj_t *) sub; } diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index 64c929e03..0b190282c 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -218,9 +218,9 @@ static void freesym(Dict_t * d, void * obj, Dtdisc_t * disc) { Agsym_t *sym; - NOTUSED(d); + (void)d; sym = obj; - NOTUSED(disc); + (void)disc; agstrfree(Ag_G_global, sym->name); agstrfree(Ag_G_global, sym->defval); agfree(Ag_G_global, sym); diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index 6d398aa92..df6a9810d 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -42,8 +42,6 @@ static inline bool streq(const char *a, const char *b) { return strcmp(a, b) == 0; } -#define NOTUSED(var) (void) var - #define SUCCESS 0 #define FAILURE -1 #define LOCALNAMEPREFIX '%' diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index fa85d2705..20ec358b5 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -159,7 +159,7 @@ static void ins(Dict_t * d, Dtlink_t ** set, Agedge_t * e) static void del(Dict_t * d, Dtlink_t ** set, Agedge_t * e) { void *x; - NOTUSED(x); + (void)x; dtrestore(d, *set); x = dtdelete(d, e); assert(x); @@ -314,7 +314,7 @@ void agdeledgeimage(Agraph_t * g, Agedge_t * e, void *ignored) Agnode_t *t, *h; Agsubnode_t *sn; - NOTUSED(ignored); + (void)ignored; if (AGTYPE(e) == AGINEDGE) { in = e; out = AGIN2OUT(e); @@ -384,10 +384,10 @@ static int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) { Agedge_t *e0, *e1; - NOTUSED(d); + (void)d; e0 = arg_e0; e1 = arg_e1; - NOTUSED(disc); + (void)disc; if (AGID(e0->node) < AGID(e1->node)) return -1; if (AGID(e0->node) > AGID(e1->node)) return 1; @@ -404,10 +404,10 @@ static int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc { Agedge_t *e0, *e1; - NOTUSED(d); + (void)d; e0 = arg_e0; e1 = arg_e1; - NOTUSED(disc); + (void)disc; assert(arg_e0 && arg_e1); if (e0->node != e1->node) { diff --git a/lib/cgraph/id.c b/lib/cgraph/id.c index 3b898e93c..64d3cd953 100644 --- a/lib/cgraph/id.c +++ b/lib/cgraph/id.c @@ -18,7 +18,7 @@ static void *idopen(Agraph_t * g, Agdisc_t* disc) { - NOTUSED(disc); + (void)disc; return g; } @@ -28,7 +28,7 @@ static long idmap(void *state, int objtype, char *str, IDTYPE *id, char *s; static IDTYPE ctr = 1; - NOTUSED(objtype); + (void)objtype; if (str) { Agraph_t *g; g = state; @@ -47,23 +47,23 @@ static long idmap(void *state, int objtype, char *str, IDTYPE *id, /* we don't allow users to explicitly set IDs, either */ static long idalloc(void *state, int objtype, IDTYPE request) { - NOTUSED(state); - NOTUSED(objtype); - NOTUSED(request); + (void)state; + (void)objtype; + (void)request; return FALSE; } static void idfree(void *state, int objtype, IDTYPE id) { - NOTUSED(objtype); + (void)objtype; if (id % 2 == 0) agstrfree(state, (char *)(uintptr_t)id); } static char *idprint(void *state, int objtype, IDTYPE id) { - NOTUSED(state); - NOTUSED(objtype); + (void)state; + (void)objtype; if (id % 2 == 0) return (char *)(uintptr_t)id; else @@ -72,14 +72,14 @@ static char *idprint(void *state, int objtype, IDTYPE id) static void idclose(void *state) { - NOTUSED(state); + (void)state; } static void idregister(void *state, int objtype, void *obj) { - NOTUSED(state); - NOTUSED(objtype); - NOTUSED(obj); + (void)state; + (void)objtype; + (void)obj; } Agiddisc_t AgIdDisc = { diff --git a/lib/cgraph/imap.c b/lib/cgraph/imap.c index 0120c424f..d1126fce9 100644 --- a/lib/cgraph/imap.c +++ b/lib/cgraph/imap.c @@ -22,10 +22,10 @@ static int idcmpf(Dict_t * d, void *arg_p0, void *arg_p1, Dtdisc_t * disc) { IMapEntry_t *p0, *p1; - NOTUSED(d); + (void)d; p0 = arg_p0; p1 = arg_p1; - NOTUSED(disc); + (void)disc; if (p0->id > p1->id) { return 1; @@ -48,10 +48,10 @@ static int namecmpf(Dict_t * d, void *arg_p0, void *arg_p1, { IMapEntry_t *p0, *p1; - NOTUSED(d); + (void)d; p0 = arg_p0; p1 = arg_p1; - NOTUSED(disc); + (void)disc; if (p0->str > p1->str) { return 1; diff --git a/lib/cgraph/mem.c b/lib/cgraph/mem.c index ddae53689..fb30fa812 100644 --- a/lib/cgraph/mem.c +++ b/lib/cgraph/mem.c @@ -22,7 +22,7 @@ static void *memalloc(void *heap, size_t request) { void *rv; - NOTUSED(heap); + (void)heap; rv = calloc(1, request); return rv; } @@ -32,7 +32,7 @@ static void *memresize(void *heap, void *ptr, size_t oldsize, { void *rv; - NOTUSED(heap); + (void)heap; rv = realloc(ptr, request); if (request > oldsize) memset((char *) rv + oldsize, 0, request - oldsize); @@ -41,7 +41,7 @@ static void *memresize(void *heap, void *ptr, size_t oldsize, static void memfree(void *heap, void *ptr) { - NOTUSED(heap); + (void)heap; free(ptr); } diff --git a/lib/cgraph/node.c b/lib/cgraph/node.c index d9397a62b..5074655da 100644 --- a/lib/cgraph/node.c +++ b/lib/cgraph/node.c @@ -87,7 +87,7 @@ static void installnode(Agraph_t * g, Agnode_t * n) { Agsubnode_t *sn; int osize; - NOTUSED(osize); + (void)osize; assert(dtsize(g->n_id) == dtsize(g->n_seq)); osize = dtsize(g->n_id); @@ -177,7 +177,7 @@ void agdelnodeimage(Agraph_t * g, Agnode_t * n, void *ignored) static Agsubnode_t template; template.node = n; - NOTUSED(ignored); + (void)ignored; for (e = agfstedge(g, n); e; e = f) { f = agnxtedge(g, e, n); agdeledgeimage(g, e, 0); @@ -334,14 +334,14 @@ static void agnodesetfinger(Agraph_t * g, Agnode_t * n, void *ignored) static Agsubnode_t template; template.node = n; dtsearch(g->n_seq,&template); - NOTUSED(ignored); + (void)ignored; } static void agnoderenew(Agraph_t * g, Agnode_t * n, void *ignored) { dtrenew(g->n_seq, dtfinger(g->n_seq)); - NOTUSED(n); - NOTUSED(ignored); + (void)n; + (void)ignored; } int agnodebefore(Agnode_t *fst, Agnode_t *snd) diff --git a/lib/cgraph/pend.c b/lib/cgraph/pend.c index 24f707c13..cd58f60f3 100644 --- a/lib/cgraph/pend.c +++ b/lib/cgraph/pend.c @@ -50,8 +50,8 @@ static void freef(Dict_t * dict, void *ptr, Dtdisc_t * disc) { pending_cb_t *pcb; - NOTUSED(dict); - NOTUSED(disc); + (void)dict; + (void)disc; pcb = ptr; free_symlist(pcb); agfree(pcb->g, pcb); diff --git a/lib/cgraph/rec.c b/lib/cgraph/rec.c index 81f463a11..fb947603c 100644 --- a/lib/cgraph/rec.c +++ b/lib/cgraph/rec.c @@ -107,7 +107,7 @@ void *agbindrec(void *arg_obj, const char *recname, unsigned int recsize, /* if obj points to rec, move its data pointer. break any mtf lock(?) */ static void objdelrec(Agraph_t * g, Agobj_t * obj, void *arg_rec) { - NOTUSED(g); + (void)g; Agrec_t *rec = arg_rec, *newrec; if (obj->data == rec) { if (rec->next == rec) @@ -164,7 +164,7 @@ int agdelrec(void *arg_obj, const char *name) static void simple_delrec(Agraph_t * g, Agobj_t * obj, void *rec_name) { - NOTUSED(g); + (void)g; agdelrec(obj, rec_name); } diff --git a/lib/cgraph/refstr.c b/lib/cgraph/refstr.c index 1f7e3974f..a46382886 100644 --- a/lib/cgraph/refstr.c +++ b/lib/cgraph/refstr.c @@ -198,9 +198,9 @@ static int refstrprint(Dict_t * dict, void *ptr, void *user) { refstr_t *r; - NOTUSED(dict); + (void)dict; r = ptr; - NOTUSED(user); + (void)user; fprintf(stderr, "%s\n", r->s); return 0; } diff --git a/lib/cgraph/utils.c b/lib/cgraph/utils.c index e1a56d05f..ff801b36d 100644 --- a/lib/cgraph/utils.c +++ b/lib/cgraph/utils.c @@ -18,8 +18,8 @@ void *agdictobjmem(Dict_t * dict, void * p, size_t size, Dtdisc_t * disc) { Agraph_t *g; - NOTUSED(dict); - NOTUSED(disc); + (void)dict; + (void)disc; g = Ag_dictop_G; if (g) { if (p) @@ -39,8 +39,8 @@ void agdictobjfree(Dict_t * dict, void * p, Dtdisc_t * disc) { Agraph_t *g; - NOTUSED(dict); - NOTUSED(disc); + (void)dict; + (void)disc; g = Ag_dictop_G; if (g) agfree(g, p); diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 902fc0192..e0e2cdda8 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -326,7 +326,7 @@ static int write_hdr(Agraph_t * g, iochan_t * ofile, int top) static int write_trl(Agraph_t * g, iochan_t * ofile) { - NOTUSED(g); + (void)g; Level--; CHKRV(indent(g, ofile)); CHKRV(ioput(g, ofile, "}\n")); @@ -396,7 +396,7 @@ static bool not_default_attrs(Agraph_t * g, Agnode_t * n) Agattr_t *data; Agsym_t *sym; - NOTUSED(g); + (void)g; if ((data = agattrrec(n))) { for (sym = dtfirst(data->dict); sym; sym = dtnext(data->dict, sym)) { if (data->str[sym->id] != sym->defval) diff --git a/lib/common/logic.h b/lib/common/logic.h index dfafc0318..fdfd7c6d0 100644 --- a/lib/common/logic.h +++ b/lib/common/logic.h @@ -23,10 +23,6 @@ extern "C" { #define TRUE (!FALSE) #endif -#ifndef NOTUSED -#define NOTUSED(var) (void) var -#endif - #ifdef __cplusplus } #endif diff --git a/lib/common/macros.h b/lib/common/macros.h index 0b244c6ed..acf9872c7 100644 --- a/lib/common/macros.h +++ b/lib/common/macros.h @@ -12,10 +12,6 @@ #include -#ifndef NOTUSED -#define NOTUSED(var) (void) var -#endif - #define isPinned(n) (ND_pinned(n) == P_PIN) #define hasPos(n) (ND_pinned(n) > 0) #define isFixed(n) (ND_pinned(n) > P_SET) diff --git a/lib/common/utils.c b/lib/common/utils.c index d0f4ba3e9..f2b2f502a 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -955,8 +955,8 @@ typedef struct { static int cmpItem(Dt_t * d, void *p1[], void *p2[], Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; if (p1[0] < p2[0]) return -1; @@ -976,7 +976,7 @@ static void *newItem(Dt_t * d, item * objp, Dtdisc_t * disc) { item *newp = NEW(item); - NOTUSED(disc); + (void)disc; newp->p[0] = objp->p[0]; newp->p[1] = objp->p[1]; newp->t = objp->t; diff --git a/lib/fdpgen/grid.c b/lib/fdpgen/grid.c index 64319932e..029a171df 100644 --- a/lib/fdpgen/grid.c +++ b/lib/fdpgen/grid.c @@ -96,8 +96,8 @@ static int ijcmpf(Dt_t * d, gridpt * p1, gridpt * p2, Dtdisc_t * disc) { int diff; - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; if ((diff = p1->i - p2->i)) return diff; else @@ -115,8 +115,8 @@ static void *newCell(Dt_t * d, void *obj, Dtdisc_t * disc) cell *cellp = obj; cell *newp; - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; newp = getCell(_grid); newp->p.i = cellp->p.i; newp->p.j = cellp->p.j; diff --git a/lib/fdpgen/tlayout.c b/lib/fdpgen/tlayout.c index d27cbd942..86155b541 100644 --- a/lib/fdpgen/tlayout.c +++ b/lib/fdpgen/tlayout.c @@ -289,7 +289,7 @@ static int gridRepulse(Dt_t * dt, cell * cellp, Grid * grid) node_list *p; node_list *q; - NOTUSED(dt); + (void)dt; #ifdef DEBUG if (Verbose >= 3) { prIndent(); diff --git a/lib/gvc/gvdevice.c b/lib/gvc/gvdevice.c index e2bcff3dd..b27558527 100644 --- a/lib/gvc/gvdevice.c +++ b/lib/gvc/gvdevice.c @@ -239,7 +239,7 @@ size_t gvwrite (GVJ_t * job, const char *s, size_t len) } #else - NOTUSED(olen); + (void)olen; (job->common->errorfn) ("No libz support.\n"); graphviz_exit(1); #endif diff --git a/lib/neatogen/constraint.c b/lib/neatogen/constraint.c index 2c8f000b6..ba5e301d2 100644 --- a/lib/neatogen/constraint.c +++ b/lib/neatogen/constraint.c @@ -35,8 +35,8 @@ typedef int (*intersectfn) (nitem *, nitem *); static int cmpitem(Dt_t * d, int *p1, int *p2, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; return (*p1 - *p2); } diff --git a/lib/neatogen/multispline.c b/lib/neatogen/multispline.c index dbc6f6dd3..3fa371ae8 100644 --- a/lib/neatogen/multispline.c +++ b/lib/neatogen/multispline.c @@ -57,8 +57,8 @@ typedef struct { static int cmpItem(Dt_t * d, int p1[], int p2[], Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; if (p1[0] < p2[0]) return -1; @@ -78,8 +78,8 @@ static void *newItem(Dt_t * d, item * objp, Dtdisc_t * disc) { item *newp = NEW(item); - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; newp->a[0] = objp->a[0]; newp->a[1] = objp->a[1]; newp->t = objp->t; @@ -89,8 +89,8 @@ static void *newItem(Dt_t * d, item * objp, Dtdisc_t * disc) static void freeItem(Dt_t * d, item * obj, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; free(obj); } @@ -167,8 +167,8 @@ typedef struct { static int cmpIpair(Dt_t * d, int *p1, int *p2, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; return (*p1 - *p2); } @@ -177,8 +177,8 @@ static void *newIpair(Dt_t * d, Ipair * objp, Dtdisc_t * disc) { Ipair *newp = NEW(Ipair); - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; newp->i = objp->i; newp->j = objp->j; @@ -187,8 +187,8 @@ static void *newIpair(Dt_t * d, Ipair * objp, Dtdisc_t * disc) static void freeIpair(Dt_t * d, Ipair * obj, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; free(obj); } diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 53fa5c608..ab1e9f27b 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -114,8 +114,8 @@ static void *newitem(Dt_t * d, edgeitem * obj, Dtdisc_t * disc) { edgeitem *newp; - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; newp = NEW(edgeitem); newp->id = obj->id; newp->e = obj->e; @@ -126,16 +126,16 @@ static void *newitem(Dt_t * d, edgeitem * obj, Dtdisc_t * disc) static void freeitem(Dt_t * d, edgeitem * obj, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; free(obj); } static int cmpitems(Dt_t * d, edgeinfo * key1, edgeinfo * key2, Dtdisc_t * disc) { - NOTUSED(d); - NOTUSED(disc); + (void)d; + (void)disc; if (key1->n1 > key2->n1) return 1; diff --git a/lib/sfdpgen/Multilevel.c b/lib/sfdpgen/Multilevel.c index f3112093f..dfef1e1e0 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -83,7 +83,7 @@ void Multilevel_delete(Multilevel grid){ static void maximal_independent_vertex_set(SparseMatrix A, int randomize, int **vset, int *nvset, int *nzc){ int i, ii, j, *ia, *ja, m, n, *p = NULL; - NOTUSED(n); + (void)n; assert(A); assert(SparseMatrix_known_strucural_symmetric(A)); ia = A->ia; @@ -136,8 +136,8 @@ static void maximal_independent_vertex_set_RS(SparseMatrix A, int randomize, int */ int i, jj, ii, *p = NULL, j, k, *ia, *ja, m, n, gain, removed, nf = 0; PriorityQueue q; - NOTUSED(removed); - NOTUSED(n); + (void)removed; + (void)n; assert(A); assert(SparseMatrix_known_strucural_symmetric(A)); @@ -326,7 +326,7 @@ static void maximal_independent_edge_set_heavest_edge_pernode(SparseMatrix A, in static void maximal_independent_edge_set_heavest_edge_pernode_leaves_first(SparseMatrix A, int randomize, int **cluster, int **clusterp, int *ncluster){ int i, ii, j, *ia, *ja, m, n, *p = NULL, q; - NOTUSED(n); + (void)n; double *a, amax = 0; int first = TRUE, jamax = 0; int *matched, nz, ncmax = 0, nz0, nzz,k ; @@ -502,7 +502,7 @@ static void maximal_independent_edge_set_heavest_edge_pernode_leaves_first(Spars static void maximal_independent_edge_set_heavest_edge_pernode_supernodes_first(SparseMatrix A, int randomize, int **cluster, int **clusterp, int *ncluster){ int i, ii, j, *ia, *ja, m, n, *p = NULL; - NOTUSED(n); + (void)n; double *a, amax = 0; int first = TRUE, jamax = 0; int *matched, nz, nz0; @@ -646,7 +646,7 @@ static int scomp(const void *s1, const void *s2){ static void maximal_independent_edge_set_heavest_cluster_pernode_leaves_first(SparseMatrix A, int csize, int randomize, int **cluster, int **clusterp, int *ncluster){ int i, ii, j, *ia, *ja, m, n, *p = NULL, q, iv; - NOTUSED(n); + (void)n; double *a; int *matched, nz, nz0, nzz,k, nv; enum {UNMATCHED = -2, MATCHED = -1}; diff --git a/lib/sfdpgen/post_process.c b/lib/sfdpgen/post_process.c index 08fef1bc0..468ae0ba3 100644 --- a/lib/sfdpgen/post_process.c +++ b/lib/sfdpgen/post_process.c @@ -618,8 +618,8 @@ double StressMajorizationSmoother_smooth(StressMajorizationSmoother sm, int dim, #ifdef DEBUG_PRINT if (Verbose) fprintf(stderr, "initial stress = %f\n", get_stress(m, dim, iw, jw, w, d, x, sm->scaling, sm->data, 1)); #else - NOTUSED(iw); - NOTUSED(jw); + (void)iw; + (void)jw; #endif /* for the additional matrix L due to the position constraints */ if (sm->scheme == SM_SCHEME_NORMAL_ELABEL){ diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index e425cf167..346c27412 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -85,9 +85,6 @@ extern "C" { #endif #endif -/* to get rid of pesky compiler warnings */ -#define NOTUSED(x) (void)(x) - /* Private flags in the "bits" field */ #define SF_MMAP 00000001 /* in memory mapping mode */ #define SF_BOTH 00000002 /* both read/write */ diff --git a/lib/sfio/sfungetc.c b/lib/sfio/sfungetc.c index a2cd94f47..61c8af384 100644 --- a/lib/sfio/sfungetc.c +++ b/lib/sfio/sfungetc.c @@ -18,7 +18,7 @@ static int _uexcept(Sfio_t * f, int type, void * val, Sfdisc_t * disc) { - NOTUSED(val); + (void)val; /* hmm! This should never happen */ if (disc != _Sfudisc) diff --git a/plugin/gd/gvrender_gd.c b/plugin/gd/gvrender_gd.c index d8a49fe1a..bc0e43be9 100644 --- a/plugin/gd/gvrender_gd.c +++ b/plugin/gd/gvrender_gd.c @@ -21,8 +21,6 @@ #include /* for gvc->g for agget */ #include -#define NOTUSED(x) (void) (x) - typedef enum { FORMAT_GIF, FORMAT_JPEG, @@ -176,7 +174,7 @@ static void gdgen_end_page(GVJ_t * job) gdImageTrueColorToPalette(im, 0, 256); gdImageGifCtx(im, &ctx); #else - NOTUSED(ctx); + (void)ctx; #endif break; case FORMAT_JPEG: diff --git a/tclpkg/tcldot/tcldot-id.c b/tclpkg/tcldot/tcldot-id.c index a7daf03a2..fc7e192e4 100644 --- a/tclpkg/tcldot/tcldot-id.c +++ b/tclpkg/tcldot/tcldot-id.c @@ -43,9 +43,9 @@ static long myiddisc_map(void *state, int objtype, char *str, uint64_t *id, int } /* we don't allow users to explicitly set IDs, either */ static long myiddisc_alloc(void *state, int objtype, uint64_t request_id) { - NOTUSED(state); - NOTUSED(objtype); - NOTUSED(request_id); + (void)state; + (void)objtype; + (void)request_id; return FALSE; } static void myiddisc_free(void *state, int objtype, uint64_t id) { @@ -69,8 +69,8 @@ static void myiddisc_free(void *state, int objtype, uint64_t id) { agstrfree(gctx->g, (char *) id); } static char *myiddisc_print(void *state, int objtype, uint64_t id) { - NOTUSED(state); - NOTUSED(objtype); + (void)state; + (void)objtype; if (id % 2 == 0) return (char *) id; else -- 2.40.0