From: Matthew Fernandez Date: Wed, 7 Sep 2022 04:45:53 +0000 (-0700) Subject: smyrna: use an 'unsigned' for 'topviewcache.seledge_id' X-Git-Tag: 6.0.1~4^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9074437e0250a1e25fc0f76a54b926c6693dde8c;p=graphviz smyrna: use an 'unsigned' for 'topviewcache.seledge_id' Squashes 4 -Wsign-conversion warnings. Note that this also changes the sentinel from `-1` to `UINT_MAX`. --- diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index b94ec3e8c..fe8595ffd 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -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; diff --git a/cmd/smyrna/topviewfuncs.c b/cmd/smyrna/topviewfuncs.c index bf393552d..90c999a0c 100644 --- a/cmd/smyrna/topviewfuncs.c +++ b/cmd/smyrna/topviewfuncs.c @@ -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;