]> granicus.if.org Git - graphviz/commitdiff
In cgraph, use AGSEQ rather than AGID as the former gives a monotonic progression
authorEmden Gansner <erg@research.att.com>
Wed, 2 May 2012 21:25:40 +0000 (17:25 -0400)
committerEmden Gansner <erg@research.att.com>
Wed, 2 May 2012 21:25:40 +0000 (17:25 -0400)
of small integers similar to the ids used in libgraph, where in cgraph, the id is
often a hash value.

lib/common/emit.c
lib/common/types.h

index 4e063e5900225e6c959b0204e1e658ba3d3ff8ee..9056dd3d6dbd82a69d33030cc37f7a06f842b2fe 100644 (file)
@@ -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;
     }
index 6960050670439fc7d4ee5a16ce6ec11a64f78aca..85ed3ea06ab58785a8cf1f11ae130e43af918b46 100644 (file)
@@ -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)