X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-visitor-parent-links.c;h=8c4b2124c73d3fd8a34dd42015b774a68439b625;hp=44e2031535839ff3d9fac0e707dfa737e22b8715;hb=7d4192cb80178ad534e460d56f67e55679c7d8ee;hpb=67905e421502703d87176702b4844f70fd60ded4 diff --git a/formats/ctf/metadata/ctf-visitor-parent-links.c b/formats/ctf/metadata/ctf-visitor-parent-links.c index 44e20315..8c4b2124 100644 --- a/formats/ctf/metadata/ctf-visitor-parent-links.c +++ b/formats/ctf/metadata/ctf-visitor-parent-links.c @@ -29,7 +29,7 @@ #include "ctf-parser.h" #include "ctf-ast.h" -#define printf_dbg(fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) +#define fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) static int ctf_visitor_unary_expression(FILE *fd, int depth, struct ctf_node *node) @@ -92,6 +92,7 @@ int ctf_visitor_type_specifier(FILE *fd, int depth, struct ctf_node *node) case TYPESPEC_UNSIGNED: case TYPESPEC_BOOL: case TYPESPEC_COMPLEX: + case TYPESPEC_IMAGINARY: case TYPESPEC_CONST: case TYPESPEC_ID_TYPE: break; @@ -134,10 +135,10 @@ int ctf_visitor_type_declarator(FILE *fd, int depth, struct ctf_node *node) if (ret) return ret; } - if (node->u.type_declarator.u.nested.length) { - node->u.type_declarator.u.nested.length->parent = node; - ret = ctf_visitor_parent_links(fd, depth + 1, - node->u.type_declarator.u.nested.length); + cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length, + siblings) { + iter->parent = node; + ret = ctf_visitor_parent_links(fd, depth + 1, iter); if (ret) return ret; } @@ -347,9 +348,6 @@ int ctf_visitor_parent_links(FILE *fd, int depth, struct ctf_node *node) } break; case NODE_ENUMERATOR: - if (node->u.enumerator.id) - fprintf(fd, " id=\"%s\"", node->u.enumerator.id); - fprintf(fd, ">\n"); cds_list_for_each_entry(iter, &node->u.enumerator.values, siblings) { iter->parent = node; ret = ctf_visitor_parent_links(fd, depth + 1, iter); @@ -358,16 +356,12 @@ int ctf_visitor_parent_links(FILE *fd, int depth, struct ctf_node *node) } break; case NODE_ENUM: - if (node->u._struct.name) - fprintf(fd, "\n", - node->u._enum.enum_id); - else - fprintf(fd, "\n"); depth++; - if (node->u._enum.container_type) { - node->u._enum.container_type->parent = node; - ret = ctf_visitor_parent_links(fd, depth + 1, node->u._enum.container_type); + cds_list_for_each_entry(iter, &node->u._enum.container_type, + siblings) { + iter->parent = node; + ret = ctf_visitor_parent_links(fd, depth + 1, iter); if (ret) return ret; } @@ -395,8 +389,6 @@ int ctf_visitor_parent_links(FILE *fd, int depth, struct ctf_node *node) } break; case NODE_VARIANT: - if (node->u.variant.choice) - fprintf(fd, " choice=\"%s\"", node->u.variant.choice); cds_list_for_each_entry(iter, &node->u.variant.declaration_list, siblings) { iter->parent = node; ret = ctf_visitor_parent_links(fd, depth + 1, iter);