From: Matthew Fernandez Date: Sat, 20 Aug 2022 15:54:01 +0000 (-0700) Subject: graphml2gv: remove unused 'compositeReadState' X-Git-Tag: 6.0.1~28^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca69ecf18add50c856202b505ea2103cb53971f7;p=graphviz graphml2gv: remove unused 'compositeReadState' It has never been possible to set this member to true. --- diff --git a/cmd/tools/graphml2gv.c b/cmd/tools/graphml2gv.c index 7c538a183..bb770ebe8 100644 --- a/cmd/tools/graphml2gv.c +++ b/cmd/tools/graphml2gv.c @@ -101,7 +101,6 @@ typedef struct { int listen; int closedElementType; int globalAttrType; - int compositeReadState; int edgeinverted; Dt_t *nameMap; } userdata_t; @@ -149,7 +148,6 @@ static userdata_t *genUserdata(char* dfltname) user->elements = (gv_stack_t){0}; user->closedElementType = TAG_NONE; user->globalAttrType = TAG_NONE; - user->compositeReadState = FALSE; user->edgeinverted = FALSE; user->gname = dfltname; user->nameMap = dtopen(&nameDisc, Dtoset); @@ -540,20 +538,10 @@ static void endElementHandler(void *userData, const char *name) } else if (strcmp(name, "attr") == 0) { char *name; char *value; - char *dynbuf = 0; ud->closedElementType = TAG_NONE; - if (ud->compositeReadState) { - size_t len = sizeof(GRAPHML_COMP) + agxblen(&ud->xml_attr_name); - name = dynbuf = gv_calloc(len, sizeof(char)); - (void)snprintf(name, len, "%s%s", GRAPHML_COMP, agxbuse(&ud->xml_attr_name)); - value = agxbuse(&ud->composite_buffer); - agxbclear(&ud->xml_attr_value); - ud->compositeReadState = FALSE; - } else { - name = agxbuse(&ud->xml_attr_name); - value = agxbuse(&ud->xml_attr_value); - } + name = agxbuse(&ud->xml_attr_name); + value = agxbuse(&ud->xml_attr_value); switch (ud->globalAttrType) { case TAG_NONE: @@ -569,7 +557,6 @@ static void endElementHandler(void *userData, const char *name) setGraphAttr(G, name, value, ud); break; } - free(dynbuf); ud->globalAttrType = TAG_NONE; } } @@ -581,11 +568,6 @@ static void characterDataHandler(void *userData, const char *s, int length) if (!ud->listen) return; - if (ud->compositeReadState) { - agxbput_n(&ud->composite_buffer, s, length); - return; - } - agxbput_n(&ud->xml_attr_value, s, length); }