From: Matthew Fernandez Date: Wed, 7 Sep 2022 04:30:51 +0000 (-0700) Subject: smyrna: use an 'unsigned' for 'topviewcache.node_id' X-Git-Tag: 6.0.1~4^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cb1c2fada3ee656045ff3df4baa1a62bd14761b;p=graphviz smyrna: use an 'unsigned' for 'topviewcache.node_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 02181381f..bcaa59c8e 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -140,7 +140,7 @@ typedef struct typedef struct { - int node_id; + unsigned node_id; int edge_id; int selnode_id; int seledge_id; diff --git a/cmd/smyrna/topviewfuncs.c b/cmd/smyrna/topviewfuncs.c index f7387d426..110948ae2 100644 --- a/cmd/smyrna/topviewfuncs.c +++ b/cmd/smyrna/topviewfuncs.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -744,7 +745,7 @@ static void renderEdgeLabels(Agraph_t * g) static void cacheNodes(Agraph_t * g,topview* t) { - if(t->cache.node_id!=-1) /*clean existing cache*/ + if (t->cache.node_id != UINT_MAX) // clean existing cache glDeleteLists(t->cache.node_id,1); t->cache.node_id=glGenLists(1); glNewList(t->cache.node_id,GL_COMPILE); @@ -862,7 +863,7 @@ void initSmGraph(Agraph_t * g,topview* rv) rv->fisheyeParams.h = NULL; rv->fisheyeParams.active = 0; - rv->cache.node_id=-1; + rv->cache.node_id = UINT_MAX; rv->cache.selnode_id=-1; rv->cache.edge_id=-1; rv->cache.seledge_id=-1;