From a27f232cd411fe7c1717168223f02f624906f88c Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Fri, 28 Aug 2020 17:40:56 +0200 Subject: [PATCH] Remove 3 -Wsign-conversion warnings in ccomps --- lib/pack/ccomps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index 5449e0cee..218bcd356 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -288,14 +288,14 @@ packerror: */ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx) { - int c_cnt = 0; + size_t c_cnt = 0; char buffer[SMALLBUF]; char *name; Agraph_t *out; Agnode_t *n; Agraph_t **ccs; size_t len; - int bnd = 10; + size_t bnd = 10; stk_t stk; blk_t blk; Agnode_t* base[INITBUF]; @@ -322,7 +322,7 @@ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx) for (n = agfstnode(g); n; n = agnxtnode(g, n)) { if (MARKED(&stk,n)) continue; - sprintf(name + len, "%d", c_cnt); + sprintf(name + len, "%zu", c_cnt); out = agsubg(g, name,1); agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data dfs(g, n, out, &stk); @@ -337,7 +337,7 @@ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx) ccs = RALLOC(c_cnt, ccs, Agraph_t *); if (name != buffer) free(name); - *ncc = c_cnt; + *ncc = (int) c_cnt; return ccs; } -- 2.50.1