symbol to be set to ensure correct linking.
- **Breaking**: Graphviz headers no longer define the constant `MAXSHORT`. A
drop-in replacement is `SHRT_MAX` in the C standard library’s limits.h.
+- **Breaking**: Graphviz headers no longer define the `NOT` macro. A drop-in
+ replacement is the C/C++ operator `!`.
- **Breaking**: Graphviz headers no longer (re-)define the C constants `INT_MIN`
and `INT_MAX`. Replacements can be found in the C standard library’s limits.h.
- **Breaking**: Graphviz headers no longer define the constant `_DUMMY_ELEM`.
#ifndef TRUE
#define TRUE (!FALSE)
#endif
-#ifndef NOT
-#define NOT(x) (!(x))
-#endif
#ifndef NIL
#define NIL(type) ((type)0)
#endif
/* skip if this is not a collapsed subgraph */
noderec = (Agcmpnode_t *) aggetrec(cmpnode, Descriptor_id, FALSE);
- if (noderec == NULL || NOT(noderec->collapsed))
+ if (noderec == NULL || !noderec->collapsed)
return FAILURE;
/* undo aghide (above) in reverse order. first, expose subgraph */
Agraph_t *agcmpgraph_of(Agnode_t * n)
{
Agcmpnode_t *noderec = (Agcmpnode_t *) aggetrec(n, Descriptor_id, FALSE);
- if (noderec && NOT(noderec->collapsed))
+ if (noderec && !noderec->collapsed)
return noderec->subg;
else
return NULL;
int have_id;
have_id = agmapnametoid(g, AGEDGE, name, &my_id, FALSE);
- if (have_id || (name == NULL && (NOT(cflag) || agisstrict(g)))) {
+ if (have_id || (name == NULL && (!cflag || agisstrict(g)))) {
/* probe for pre-existing edge */
Agtag_t key;
key = Tag;
int agisundirected(Agraph_t * g)
{
- return NOT(agisdirected(g));
+ return !agisdirected(g);
}
int agisstrict(Agraph_t * g)
static void agrelease_callbacks(Agraph_t * g)
{
pendingset_t *pending;
- if (NOT(g->clos->callbacks_enabled)) {
+ if (!g->clos->callbacks_enabled) {
g->clos->callbacks_enabled = TRUE;
pending = agbindrec(g, DRName, sizeof(pendingset_t), false);
/* this destroys objects in the opposite of their order of creation */
int agcallbacks(Agraph_t * g, int flag)
{
- if (flag && NOT(g->clos->callbacks_enabled))
+ if (flag && !g->clos->callbacks_enabled)
agrelease_callbacks(g);
if (g->clos->callbacks_enabled) {
g->clos->callbacks_enabled = flag != 0;
firstrec->next = newrec;
}
}
- if (NOT(obj->tag.mtflock))
+ if (!obj->tag.mtflock)
set_data(obj, newrec, false);
}
bool hasName = true;
strict = "";
- if (NOT(top) && agparent(g))
+ if (!top && agparent(g))
kind = "sub";
else {
root = true;
p = agnameof(e);
g = agraphof(e);
- if (NOT(EMPTY(p))) {
+ if (!EMPTY(p)) {
if (!terminate) {
Level++;
}
g = agraphof(n);
CHKRV(indent(g, ofile));
CHKRV(write_nodename(n, ofile));
- if (NOT(attrs_written(n)))
+ if (!attrs_written(n))
CHKRV(write_nondefault_attrs(n, ofile, d));
return ioput(g, ofile, ";\n");
}
CHKRV(ioput(g, ofile, (agisdirected(agraphof(t)) ? " -> " : " -- ")));
CHKRV(write_nodename(h, ofile));
CHKRV(write_port(e, ofile, Headport));
- if (NOT(attrs_written(e))) {
+ if (!attrs_written(e)) {
CHKRV(write_nondefault_attrs(e, ofile, d));
} else {
CHKRV(write_edge_name(e, ofile, TRUE));
#include <stdbool.h>
-#ifndef NOT
-#define NOT(v) (!(v))
-#endif
-
#ifndef FALSE
#define FALSE (0)
#endif
if (v == agtail(e))
d = dir;
else
- d = NOT(dir);
+ d = !dir;
if (d)
ED_cutvalue(e) += cutvalue;
else
if (mode != 0 || !*reclblp)
return parse_error(rv, tmpport);
mode = HASTABLE;
- if (!(rv->fld[fi++] = parse_reclbl(n, NOT(LR), FALSE, text)))
+ if (!(rv->fld[fi++] = parse_reclbl(n, !LR, FALSE, text)))
return parse_error(rv, tmpport);
break;
case '}':
int sides = BOTTOM | RIGHT | TOP | LEFT;
/* Always use rankdir to determine how records are laid out */
- flip = NOT(GD_realflip(agraphof(n)));
+ flip = !GD_realflip(agraphof(n));
reclblp = ND_label(n)->text;
len = strlen(reclblp);
/* For some forgotten reason, an empty label is parsed into a space, so
#include <signal.h>
typedef unsigned char boolean;
-#ifndef NOT
-#define NOT(v) (!(v))
-#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
-#define TRUE NOT(FALSE)
+#define TRUE (!FALSE)
#endif
#include "geom.h"
hascl = GD_n_cluster(dot_root(g)) > 0;
if (ND_flat_out(v).list)
for (i = 0; (e = ND_flat_out(v).list[i]); i++) {
- if (hascl
- && NOT(agcontains(g, agtail(e)) && agcontains(g, aghead(e))))
+ if (hascl && !(agcontains(g, agtail(e)) && agcontains(g, aghead(e))))
continue;
if (ED_weight(e) == 0)
continue;
extern "C" {
#endif
-#ifndef NOT
-#define NOT(x) (!(x))
-#endif
#ifndef FALSE
#define FALSE 0
-#define TRUE (NOT(FALSE))
+#define TRUE (!FALSE)
#endif
#ifdef GVDLL
obs = malloc(vgp->Npoly * sizeof(Ppoly_t));
for (i = 0; i < vgp->Npoly; i++)
obs[i] = &(vgp->poly[i].boundary);
- if (NOT(Plegal_arrangement(obs, vgp->Npoly)))
+ if (!Plegal_arrangement(obs, vgp->Npoly))
fprintf(stderr, "bad arrangement\n");
else
vgp->vc = Pobsopen(obs, vgp->Npoly);