From: Matthew Fernandez Date: Wed, 7 Sep 2022 04:42:00 +0000 (-0700) Subject: smyrna: use an 'unsigned' for 'topviewcache.selnode_id' X-Git-Tag: 6.0.1~4^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52ddaeb3be1bd6d1a18265818107269694b91733;p=graphviz smyrna: use an 'unsigned' for 'topviewcache.selnode_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 44a4ffd65..b94ec3e8c 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -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; diff --git a/cmd/smyrna/topviewfuncs.c b/cmd/smyrna/topviewfuncs.c index 564fa0fa3..bf393552d 100644 --- a/cmd/smyrna/topviewfuncs.c +++ b/cmd/smyrna/topviewfuncs.c @@ -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;