]> granicus.if.org Git - graphviz/commitdiff
circogen prGraph: remove unnecessary casts
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Dec 2022 22:17:43 +0000 (14:17 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 1 Jan 2023 00:32:15 +0000 (16:32 -0800)
These casts were also unsafe in that they were casting pointers into a type that
is smaller on, e.g. x86-64, and would truncate the pointer.

lib/circogen/circular.c

index 95a858446f930fa8342e19b96ce242d673c2bffb..ea194112a2e8b21bbf8030e19af2c4ef9ca677c5 100644 (file)
@@ -109,11 +109,10 @@ void prGraph(Agraph_t * g)
 
     fprintf(stderr, "%s\n", agnameof(g));
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-       fprintf(stderr, "%s (%x)\n", agnameof(n), (unsigned int) n);
+       fprintf(stderr, "%s (%p)\n", agnameof(n), n);
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            fprintf(stderr, "%s", agnameof(n));
-           fprintf(stderr, " -- %s (%x)\n", agnameof(aghead(e)),
-                   (unsigned int) e);
+           fprintf(stderr, " -- %s (%p)\n", agnameof(aghead(e)), e);
        }
     }
 }