]> granicus.if.org Git - graphviz/commitdiff
smyrna: use an 'unsigned' for 'topviewcache.nodelabel_id'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Sep 2022 04:49:51 +0000 (21:49 -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 fe8595ffd92bb67dad386b601fb616982c73f5b4..775d632fa0ddd717307034fd2f6b783be124496a 100644 (file)
@@ -144,7 +144,7 @@ typedef struct
        unsigned edge_id;
        unsigned selnode_id;
        unsigned seledge_id;
-       int nodelabel_id;
+       unsigned nodelabel_id;
        int edgelabel_id;
     }topviewcache;
 
index 90c999a0ca8f5099eedc5acf3f7921be3ffdcf1b..ce8e862c0caa9d9b5edd14ade959c2263ab7c71b 100644 (file)
@@ -789,7 +789,7 @@ void cacheSelectedNodes(Agraph_t * g,topview* t)
 }
 static void cacheNodeLabels(Agraph_t * g,topview* t)
 {
-    if(t->cache.nodelabel_id!=-1)      /*clean existing cache*/
+    if (t->cache.nodelabel_id != UINT_MAX) // clean existing cache
        glDeleteLists(t->cache.nodelabel_id,1);
     t->cache.nodelabel_id=glGenLists(1);
     glNewList(t->cache.nodelabel_id,GL_COMPILE);