]> granicus.if.org Git - graphviz/commitdiff
smyrna new_attr: remove shadowing of global 'attr'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Dec 2022 05:09:52 +0000 (21:09 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Dec 2022 19:42:15 +0000 (11:42 -0800)
Note that none of the zero assignments in this function were necessary because
`gv_alloc` zeros memory.

cmd/smyrna/gui/frmobjectui.c

index 4cc934135829986d66a629c66093e95510318cae..fca4c4fa270c31890815a88d714094f4ca2f0216 100644 (file)
@@ -61,17 +61,7 @@ static void free_attr(attr_t *at) {
 }
 
 static attr_t *new_attr(void) {
-    attr_t *attr = gv_alloc(sizeof(attr_t));
-    attr->defValG = NULL;
-    attr->defValN = NULL;
-    attr->defValE = NULL;
-    attr->name = NULL;
-    attr->value = NULL;
-    attr->propagate = 0;
-    attr->objType[0] = 0;
-    attr->objType[1] = 0;
-    attr->objType[2] = 0;
-    return attr;
+  return gv_alloc(sizeof(attr_t));
 }
 
 static attr_t *new_attr_with_ref(Agsym_t * sym)