From: Ben Pfaff Date: Sun, 9 Feb 2020 17:56:51 +0000 (+0000) Subject: Revert "temporary changes for optimizations" X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a26b5ed5519cdad4dc31947bdaa15b078804c539;p=pspp Revert "temporary changes for optimizations" This reverts commit 5aaebfb786bc3dcecee1f8f9ae4e016bd28f72c6. --- diff --git a/src/output/spv/spvxml-helpers.c b/src/output/spv/spvxml-helpers.c index d9d05e0d0a..fb1420351d 100644 --- a/src/output/spv/spvxml-helpers.c +++ b/src/output/spv/spvxml-helpers.c @@ -29,7 +29,6 @@ #include "gl/c-ctype.h" #include "gl/xvasprintf.h" -#include "gl/xalloc.h" char * WARN_UNUSED_RESULT spvxml_context_finish (struct spvxml_context *ctx, struct spvxml_node *root) @@ -333,16 +332,11 @@ find_attribute (struct spvxml_node_context *nctx, const char *name) for (struct spvxml_attribute *a = nctx->attrs; a < &nctx->attrs[nctx->n_attrs]; a++) { - if (!strcmp (a->name, name)) - return a; - - if (!a->multi) - continue; - size_t a_len = strlen (a->name); - if ((a->name[a_len - 1] == '#' - && !strncmp (name, a->name, a_len - 1) - && all_digits (name + a_len - 1)) + if (!strcmp (a->name, name) + || (a->name[a_len - 1] == '#' + && !strncmp (name, a->name, a_len - 1) + && all_digits (name + a_len - 1)) || (a->name[a_len - 1] == '%' && !strncmp (name, a->name, a_len - 1))) return a; @@ -787,8 +781,6 @@ spvxml_content_error (struct spvxml_node_context *nctx, const xmlNode *node, if (nctx->up->error) return; - nctx->up->error = xstrdup ("error"); - return; struct string s = DS_EMPTY_INITIALIZER; ds_put_cstr (&s, "error parsing content of "); diff --git a/src/output/spv/spvxml-helpers.h b/src/output/spv/spvxml-helpers.h index 6ffdf2a65b..16f7335013 100644 --- a/src/output/spv/spvxml-helpers.h +++ b/src/output/spv/spvxml-helpers.h @@ -79,7 +79,6 @@ struct spvxml_attribute { const char *name; bool required; - bool multi; char *value; }; diff --git a/src/output/spv/xml-parser-generator b/src/output/spv/xml-parser-generator index ba6140de42..df34fbf8ff 100644 --- a/src/output/spv/xml-parser-generator +++ b/src/output/spv/xml-parser-generator @@ -440,9 +440,8 @@ def print_attribute_decls(name, attributes): print(' struct spvxml_attribute attrs[] = {') for unique_name, (xml_name, value, required) in sorted(attributes.items()): c_name = name_to_id(unique_name) - print(' [ATTR_%s] = { "%s", %s, %s, NULL },' - % (c_name.upper(), xml_name, 'true' if required else 'false', - 'true' if '#' in xml_name or '%' in xml_name else 'false')) + print(' [ATTR_%s] = { "%s", %s, NULL },' + % (c_name.upper(), xml_name, 'true' if required else 'false')) print(' };') print(' enum { N_ATTRS = sizeof attrs / sizeof *attrs };')