#define RROTATE(x,y) (rrotate(x,y), (x) = (y))
#define LROTATE(x,y) (lrotate(x,y), (x) = (y))
-
-#define NOTUSED(x) (void)(x)
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))
static Agobj_t *subgraph_search(Agraph_t * sub, Agobj_t * g)
{
- NOTUSED(g);
+ (void)g;
return (Agobj_t *) sub;
}
{
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);
return strcmp(a, b) == 0;
}
-#define NOTUSED(var) (void) var
-
#define SUCCESS 0
#define FAILURE -1
#define LOCALNAMEPREFIX '%'
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);
Agnode_t *t, *h;
Agsubnode_t *sn;
- NOTUSED(ignored);
+ (void)ignored;
if (AGTYPE(e) == AGINEDGE) {
in = e;
out = AGIN2OUT(e);
{
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;
{
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) {
static void *idopen(Agraph_t * g, Agdisc_t* disc)
{
- NOTUSED(disc);
+ (void)disc;
return g;
}
char *s;
static IDTYPE ctr = 1;
- NOTUSED(objtype);
+ (void)objtype;
if (str) {
Agraph_t *g;
g = state;
/* 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
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 = {
{
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;
{
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;
{
void *rv;
- NOTUSED(heap);
+ (void)heap;
rv = calloc(1, request);
return rv;
}
{
void *rv;
- NOTUSED(heap);
+ (void)heap;
rv = realloc(ptr, request);
if (request > oldsize)
memset((char *) rv + oldsize, 0, request - oldsize);
static void memfree(void *heap, void *ptr)
{
- NOTUSED(heap);
+ (void)heap;
free(ptr);
}
{
Agsubnode_t *sn;
int osize;
- NOTUSED(osize);
+ (void)osize;
assert(dtsize(g->n_id) == dtsize(g->n_seq));
osize = dtsize(g->n_id);
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);
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)
{
pending_cb_t *pcb;
- NOTUSED(dict);
- NOTUSED(disc);
+ (void)dict;
+ (void)disc;
pcb = ptr;
free_symlist(pcb);
agfree(pcb->g, pcb);
/* 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)
static void simple_delrec(Agraph_t * g, Agobj_t * obj, void *rec_name)
{
- NOTUSED(g);
+ (void)g;
agdelrec(obj, rec_name);
}
{
refstr_t *r;
- NOTUSED(dict);
+ (void)dict;
r = ptr;
- NOTUSED(user);
+ (void)user;
fprintf(stderr, "%s\n", r->s);
return 0;
}
{
Agraph_t *g;
- NOTUSED(dict);
- NOTUSED(disc);
+ (void)dict;
+ (void)disc;
g = Ag_dictop_G;
if (g) {
if (p)
{
Agraph_t *g;
- NOTUSED(dict);
- NOTUSED(disc);
+ (void)dict;
+ (void)disc;
g = Ag_dictop_G;
if (g)
agfree(g, p);
static int write_trl(Agraph_t * g, iochan_t * ofile)
{
- NOTUSED(g);
+ (void)g;
Level--;
CHKRV(indent(g, ofile));
CHKRV(ioput(g, ofile, "}\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)
#define TRUE (!FALSE)
#endif
-#ifndef NOTUSED
-#define NOTUSED(var) (void) var
-#endif
-
#ifdef __cplusplus
}
#endif
#include <stdbool.h>
-#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)
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;
{
item *newp = NEW(item);
- NOTUSED(disc);
+ (void)disc;
newp->p[0] = objp->p[0];
newp->p[1] = objp->p[1];
newp->t = objp->t;
{
int diff;
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
if ((diff = p1->i - p2->i))
return diff;
else
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;
node_list *p;
node_list *q;
- NOTUSED(dt);
+ (void)dt;
#ifdef DEBUG
if (Verbose >= 3) {
prIndent();
}
#else
- NOTUSED(olen);
+ (void)olen;
(job->common->errorfn) ("No libz support.\n");
graphviz_exit(1);
#endif
static int cmpitem(Dt_t * d, int *p1, int *p2, Dtdisc_t * disc)
{
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
return (*p1 - *p2);
}
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;
{
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;
static void freeItem(Dt_t * d, item * obj, Dtdisc_t * disc)
{
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
free(obj);
}
static int cmpIpair(Dt_t * d, int *p1, int *p2, Dtdisc_t * disc)
{
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
return (*p1 - *p2);
}
{
Ipair *newp = NEW(Ipair);
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
newp->i = objp->i;
newp->j = objp->j;
static void freeIpair(Dt_t * d, Ipair * obj, Dtdisc_t * disc)
{
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
free(obj);
}
{
edgeitem *newp;
- NOTUSED(d);
- NOTUSED(disc);
+ (void)d;
+ (void)disc;
newp = NEW(edgeitem);
newp->id = obj->id;
newp->e = obj->e;
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;
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;
*/
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));
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 ;
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;
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};
#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){
#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 */
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)
#include <gvc/gvcint.h> /* for gvc->g for agget */
#include <gd.h>
-#define NOTUSED(x) (void) (x)
-
typedef enum {
FORMAT_GIF,
FORMAT_JPEG,
gdImageTrueColorToPalette(im, 0, 256);
gdImageGifCtx(im, &ctx);
#else
- NOTUSED(ctx);
+ (void)ctx;
#endif
break;
case FORMAT_JPEG:
}
/* 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) {
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