]> granicus.if.org Git - graphviz/commitdiff
smyrna: use an 'unsigned' for 'topviewcache.selnode_id'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Sep 2022 04:42:00 +0000 (21:42 -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 44a4ffd655f61284e6758e0d54e8a292a510381f..b94ec3e8cc4ca823d2b994bf502a87c3712be9e7 100644 (file)
@@ -142,7 +142,7 @@ typedef struct
     {
        unsigned node_id;
        unsigned edge_id;
-       int selnode_id;
+       unsigned selnode_id;
        int seledge_id;
        int nodelabel_id;
        int edgelabel_id;
index 564fa0fa36898d5cfd84e22d75054f9cc7582669..bf393552d017a4f895b27949e0532e6c425c30de 100644 (file)
@@ -780,7 +780,7 @@ void cacheSelectedEdges(Agraph_t * g,topview* t)
 }
 void cacheSelectedNodes(Agraph_t * g,topview* t)
 {
-    if(t->cache.selnode_id!=-1)        /*clean existing cache*/
+    if (t->cache.selnode_id != UINT_MAX) // clean existing cache
        glDeleteLists(t->cache.selnode_id,1);
     t->cache.selnode_id=glGenLists(1);
     glNewList(t->cache.selnode_id,GL_COMPILE);
@@ -864,7 +864,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.selnode_id = UINT_MAX;
     rv->cache.edge_id = UINT_MAX;
     rv->cache.seledge_id=-1;
     rv->sel.selectEdges=0;