]> granicus.if.org Git - graphviz/commitdiff
smyrna: use an 'unsigned' for 'topviewcache.seledge_id'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Sep 2022 04:45:53 +0000 (21:45 -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 b94ec3e8cc4ca823d2b994bf502a87c3712be9e7..fe8595ffd92bb67dad386b601fb616982c73f5b4 100644 (file)
@@ -143,7 +143,7 @@ typedef struct
        unsigned node_id;
        unsigned edge_id;
        unsigned selnode_id;
-       int seledge_id;
+       unsigned seledge_id;
        int nodelabel_id;
        int edgelabel_id;
     }topviewcache;
index bf393552d017a4f895b27949e0532e6c425c30de..90c999a0ca8f5099eedc5acf3f7921be3ffdcf1b 100644 (file)
@@ -769,7 +769,7 @@ static void cacheEdges(Agraph_t * g,topview* t)
 }
 void cacheSelectedEdges(Agraph_t * g,topview* t)
 {
-    if(t->cache.seledge_id!=-1)        /*clean existing cache*/
+    if (t->cache.seledge_id != UINT_MAX) // clean existing cache
        glDeleteLists(t->cache.seledge_id,1);
     t->cache.seledge_id=glGenLists(1);
     glNewList(t->cache.seledge_id,GL_COMPILE);
@@ -866,7 +866,7 @@ void initSmGraph(Agraph_t * g,topview* rv)
     rv->cache.node_id = UINT_MAX;
     rv->cache.selnode_id = UINT_MAX;
     rv->cache.edge_id = UINT_MAX;
-    rv->cache.seledge_id=-1;
+    rv->cache.seledge_id = UINT_MAX;
     rv->sel.selectEdges=0;
     rv->sel.selectNodes=1;