From 381195a99ee01216dc7823ca2c4d4b83fdb9224a Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Thu, 1 Sep 2016 19:09:30 +0200 Subject: [PATCH] Resolved four -Wsign-conversion in rec.c `arg_rec_size` is always positive, so it can be an unsigned integer. --- lib/cgraph/rec.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/cgraph/rec.c b/lib/cgraph/rec.c index 573986f11..c2567f5c2 100644 --- a/lib/cgraph/rec.c +++ b/lib/cgraph/rec.c @@ -94,7 +94,7 @@ void *agbindrec(void *arg_obj, char *recname, unsigned int recsize, g = agraphof(obj); rec = aggetrec(obj, recname, FALSE); if ((rec == NIL(Agrec_t *)) && (recsize > 0)) { - rec = (Agrec_t *) agalloc(g, (int) recsize); + rec = (Agrec_t *) agalloc(g, recsize); rec->name = agstrdup(g, recname); switch (obj->tag.objtype) { case AGRAPH: @@ -200,11 +200,18 @@ void aginit(Agraph_t * g, int kind, char *rec_name, int arg_rec_size, int mtf) Agnode_t *n; Agedge_t *e; Agraph_t *s; - int rec_size; - int recur; /* if recursive on subgraphs */ + unsigned int rec_size; + int recur; /* if recursive on subgraphs */ - if (arg_rec_size < 0) {recur = 1; rec_size = -arg_rec_size;} - else {recur = 0; rec_size= arg_rec_size;} + if (arg_rec_size < 0) + { + recur = 1; + } + else + { + recur = 0; + } + rec_size = (unsigned int) abs(arg_rec_size); switch (kind) { case AGRAPH: agbindrec(g, rec_name, rec_size, mtf); -- 2.40.0