From: Emden Gansner Date: Wed, 2 May 2012 21:25:40 +0000 (-0400) Subject: In cgraph, use AGSEQ rather than AGID as the former gives a monotonic progression X-Git-Tag: LAST_LIBGRAPH~32^2~438 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3eb0655a0bbf2965ce8050eaa8708cccdd0463c3;p=graphviz In cgraph, use AGSEQ rather than AGID as the former gives a monotonic progression of small integers similar to the ids used in libgraph, where in cgraph, the id is often a hash value. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 4e063e590..9056dd3d6 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -198,16 +198,16 @@ getObjId (GVJ_t* job, void* obj, agxbuf* xb) idnum = ((graph_t*)obj)->meta_node->id; #else case AGRAPH: - idnum = AGID((graph_t*)obj); + idnum = AGSEQ(obj); #endif pfx = "graph"; break; case AGNODE: - idnum = AGID((node_t*)obj); + idnum = AGSEQ((Agnode_t*)obj); pfx = "node"; break; case AGEDGE: - idnum = AGID((edge_t*)obj); + idnum = AGSEQ((Agedge_t*)obj); pfx = "edge"; break; } diff --git a/lib/common/types.h b/lib/common/types.h index 696005067..85ed3ea06 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -741,7 +741,7 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; #define aghead(e) ((e)->head) #define agtail(e) ((e)->tail) #define agisdirected(g) ((g)->kind & AGFLAG_DIRECTED) -#define AGID(x) ((x)->id) +#define AGSEQ(x) ((x)->id) #define agfindgraphattr(g,a) agfindattr((g)->root,a) #define agfindnodeattr(g,a) agfindattr((g)->proto->n,a) #define agfindedgeattr(g,a) agfindattr((g)->proto->e,a)