From: Simon Marchi Date: Wed, 1 Jun 2011 14:53:28 +0000 (-0400) Subject: Fix XML output in ctf-parser-test X-Git-Tag: v0.1~14 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=a10a7e5ba860f8294c3248b9951f50b5737ac7df;hp=8895362d406b7e7752aed90dcdfa3903910cbbbd Fix XML output in ctf-parser-test Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/metadata/ctf-visitor-xml.c b/formats/ctf/metadata/ctf-visitor-xml.c index 7115126f..49fa9928 100644 --- a/formats/ctf/metadata/ctf-visitor-xml.c +++ b/formats/ctf/metadata/ctf-visitor-xml.c @@ -76,15 +76,15 @@ int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *nod break; case UNARY_SIGNED_CONSTANT: print_tabs(fd, depth); - fprintf(fd, "u.unary_expression.u.signed_constant); - fprintf(fd, " />\n"); + fprintf(fd, "\" />\n"); break; case UNARY_UNSIGNED_CONSTANT: print_tabs(fd, depth); - fprintf(fd, "u.unary_expression.u.signed_constant); - fprintf(fd, " />\n"); + fprintf(fd, "\" />\n"); break; case UNARY_SBRAC: print_tabs(fd, depth); @@ -137,6 +137,7 @@ int ctf_visitor_print_type_specifier_list(FILE *fd, int depth, struct ctf_node * static int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node) { + int ret; print_tabs(fd, depth); switch (node->u.type_specifier.type) { @@ -154,7 +155,7 @@ int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node) case TYPESPEC_IMAGINARY: case TYPESPEC_CONST: case TYPESPEC_ID_TYPE: - fprintf(fd, "u.type_specifier.node); + ret = ctf_visitor_print_xml(fd, depth, node->u.type_specifier.node); + if (ret) + return ret; + break; case TYPESPEC_UNKNOWN: default: fprintf(stderr, "[error] %s: unknown type specifier %d\n", __func__, @@ -252,9 +256,9 @@ int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node) case TYPESPEC_STRUCT: case TYPESPEC_VARIANT: case TYPESPEC_ENUM: + depth--; print_tabs(fd, depth); fprintf(fd, "\n"); - depth--; break; case TYPESPEC_UNKNOWN: default: @@ -293,7 +297,7 @@ int ctf_visitor_print_type_declarator(FILE *fd, int depth, struct ctf_node *node case TYPEDEC_ID: if (node->u.type_declarator.u.id) { print_tabs(fd, depth); - fprintf(fd, "u.type_declarator.u.id); fprintf(fd, "\" />\n"); }