]> granicus.if.org Git - graphviz/commitdiff
gvpr: remove unnecessary 'agxbinit' calls
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Jan 2023 01:29:46 +0000 (17:29 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Jan 2023 02:02:17 +0000 (18:02 -0800)
Zero-initialization already does this work.

lib/gvpr/actions.c
lib/gvpr/compile.c
lib/gvpr/gvpr.c

index 4b1878a5ec05fd83bce015ece501462585d9c2fe..7f78c3b888f5b85eec45e5695d0997f26f2de493 100644 (file)
@@ -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 :
index 8b2a6727d3bf14435d7ec3277515a09f5bf15470..a2b9885281a9ee59eca404aa904048e367b11206 100644 (file)
@@ -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);
        }
index 6a1df2a50088ea85b6cca18cfda46411bf7e44f5..d7bbe02e7d6bf4ca5455e6924c7e2fc20bb9092c 100644 (file)
@@ -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);