From 73b139db121b1ff7762aecfdf481a4c852eb370c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 6 Sep 2022 21:37:59 -0700 Subject: [PATCH] smyrna: use an 'unsigned' for 'topviewcache.edge_id' Squashes 4 -Wsign-conversion warnings. Note that this also changes the sentinel from `-1` to `UINT_MAX`. --- cmd/smyrna/smyrnadefs.h | 2 +- cmd/smyrna/topviewfuncs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index bcaa59c8e..44a4ffd65 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -141,7 +141,7 @@ typedef struct typedef struct { unsigned node_id; - int edge_id; + unsigned edge_id; int selnode_id; int seledge_id; int nodelabel_id; diff --git a/cmd/smyrna/topviewfuncs.c b/cmd/smyrna/topviewfuncs.c index 110948ae2..564fa0fa3 100644 --- a/cmd/smyrna/topviewfuncs.c +++ b/cmd/smyrna/topviewfuncs.c @@ -758,7 +758,7 @@ static void cacheNodes(Agraph_t * g,topview* t) } static void cacheEdges(Agraph_t * g,topview* t) { - if(t->cache.edge_id!=-1) /*clean existing cache*/ + if (t->cache.edge_id != UINT_MAX) // clean existing cache glDeleteLists(t->cache.edge_id,1); t->cache.edge_id=glGenLists(1); glNewList(t->cache.edge_id,GL_COMPILE); @@ -865,7 +865,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.edge_id=-1; + rv->cache.edge_id = UINT_MAX; rv->cache.seledge_id=-1; rv->sel.selectEdges=0; rv->sel.selectNodes=1; -- 2.40.0