]> granicus.if.org Git - graphviz/commitdiff
smyrna: use an 'unsigned' for 'topviewcache.edge_id'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Sep 2022 04:37:59 +0000 (21:37 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 00:11:28 +0000 (17:11 -0700)
Squashes 4 -Wsign-conversion warnings. Note that this also changes the sentinel
from `-1` to `UINT_MAX`.

cmd/smyrna/smyrnadefs.h
cmd/smyrna/topviewfuncs.c

index bcaa59c8e350b90fc617bd673c9bb429ce2d9af4..44a4ffd655f61284e6758e0d54e8a292a510381f 100644 (file)
@@ -141,7 +141,7 @@ typedef struct
     typedef struct
     {
        unsigned node_id;
-       int edge_id;
+       unsigned edge_id;
        int selnode_id;
        int seledge_id;
        int nodelabel_id;
index 110948ae2d1f470b9b77cceb67cad7aca9da190c..564fa0fa36898d5cfd84e22d75054f9cc7582669 100644 (file)
@@ -758,7 +758,7 @@ static void cacheNodes(Agraph_t * g,topview* t)
 }
 static void cacheEdges(Agraph_t * g,topview* t)
 {
-    if(t->cache.edge_id!=-1)   /*clean existing cache*/
+    if (t->cache.edge_id != UINT_MAX) // clean existing cache
        glDeleteLists(t->cache.edge_id,1);
     t->cache.edge_id=glGenLists(1);
     glNewList(t->cache.edge_id,GL_COMPILE);
@@ -865,7 +865,7 @@ void initSmGraph(Agraph_t * g,topview* rv)
     rv->fisheyeParams.active = 0;
     rv->cache.node_id = UINT_MAX;
     rv->cache.selnode_id=-1;
-    rv->cache.edge_id=-1;
+    rv->cache.edge_id = UINT_MAX;
     rv->cache.seledge_id=-1;
     rv->sel.selectEdges=0;
     rv->sel.selectNodes=1;