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