From: Magnus Jacobsson Date: Fri, 28 Aug 2020 15:40:56 +0000 (+0200) Subject: Remove 3 -Wsign-conversion warnings in ccomps X-Git-Tag: 2.46.0~20^2^2~93^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a27f232cd411fe7c1717168223f02f624906f88c;p=graphviz Remove 3 -Wsign-conversion warnings in ccomps --- 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; }