From 2626429a59dcb3301db7b59050436a9e4cb4e6f1 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 28 Jan 2023 17:29:46 -0800 Subject: [PATCH] gvpr: remove unnecessary 'agxbinit' calls Zero-initialization already does this work. --- lib/gvpr/actions.c | 1 - lib/gvpr/compile.c | 4 ---- lib/gvpr/gvpr.c | 1 - 3 files changed, 6 deletions(-) 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); -- 2.40.0