From: Matthew Fernandez Date: Sun, 29 Jan 2023 01:29:46 +0000 (-0800) Subject: gvpr: remove unnecessary 'agxbinit' calls X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2626429a59dcb3301db7b59050436a9e4cb4e6f1;p=graphviz gvpr: remove unnecessary 'agxbinit' calls Zero-initialization already does this work. --- diff --git a/lib/gvpr/actions.c b/lib/gvpr/actions.c index 4b1878a5e..7f78c3b88 100644 --- a/lib/gvpr/actions.c +++ b/lib/gvpr/actions.c @@ -1311,7 +1311,6 @@ char *colorx(Expr_t *ex, char *incolor, char *fmt) { return ""; agxbuf fp = {0}; - agxbinit(&fp, 0, NULL); switch (type) { case HSVA_DOUBLE : diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 8b2a6727d..a2b988528 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -436,7 +436,6 @@ static int lookup(Expr_t *pgm, Agobj_t *objp, Exid_t *sym, Extype_t * v) { break; case M_name: { agxbuf tmp = {0}; - agxbinit(&tmp, 0, NULL); v->string = nameOf(pgm, objp, &tmp); agxbfree(&tmp); break; @@ -536,7 +535,6 @@ static int lookup(Expr_t *pgm, Agobj_t *objp, Exid_t *sym, Extype_t * v) { if (!gsym) { gsym = agattr(agroot(agraphof(objp)), AGTYPE(objp), sym->name, ""); agxbuf tmp = {0}; - agxbinit(&tmp, 0, NULL); error(ERROR_WARNING, "Using value of uninitialized %s attribute \"%s\" of \"%s\"", kindOf (objp), sym->name, nameOf(pgm, objp, &tmp)); @@ -1335,7 +1333,6 @@ getval(Expr_t * pgm, Exnode_t * node, Exid_t * sym, Exref_t * ref, if (!gsym) { gsym = agattr(agroot(agraphof(objp)), AGTYPE(objp), name, ""); agxbuf tmp = {0}; - agxbinit(&tmp, 0, NULL); error(ERROR_WARNING, "Using value of %s uninitialized attribute \"%s\" of \"%s\" in aget()", kindOf (objp), name, nameOf(pgm, objp, &tmp)); @@ -2107,7 +2104,6 @@ static int stringOf(Expr_t *prog, Exnode_t *x, int arg) { } else { agxbuf tmp = {0}; - agxbinit(&tmp, 0, NULL); x->data.constant.value.string = nameOf(prog, objp, &tmp); agxbfree(&tmp); } diff --git a/lib/gvpr/gvpr.c b/lib/gvpr/gvpr.c index 6a1df2a50..d7bbe02e7 100644 --- a/lib/gvpr/gvpr.c +++ b/lib/gvpr/gvpr.c @@ -721,7 +721,6 @@ static int traverse(Gpr_t * state, Expr_t* prog, comp_block * bp, int cleanup) if (!state->target) { char *target; agxbuf tmp = {0}; - agxbinit(&tmp, 0, NULL); if (state->name_used) { agxbprint(&tmp, "%s%d", state->tgtname, state->name_used);