]> granicus.if.org Git - graphviz/commitdiff
sccmap.c: use an unsigned type to squash some -Wconversion warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 13 Nov 2021 02:49:26 +0000 (18:49 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 19 Nov 2021 01:51:37 +0000 (17:51 -0800)
The `val` member of `Agnodeinfo_t` is unsigned and all uses of this function
store the return value in an unsigned. So it seems this function always should
have been declared as returning an unsigned.

cmd/tools/sccmap.c

index fe922e3f02dc13cb1c09020250df3ccda90a9d1b..030eb83ca715f427d8bcb08f5ff2dabaad08b617 100644 (file)
@@ -68,8 +68,7 @@ static void setscc(Agnode_t * n, Agraph_t * scc)
 {
     ((Agnodeinfo_t *) (n->base.data))->scc = scc;
 }
-static int getval(Agnode_t * n)
-{
+static unsigned getval(Agnode_t *n) {
     return (((Agnodeinfo_t *) (n->base.data))->val);
 }
 static void setval(Agnode_t * n, int v)