X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-visitor-xml.c;h=7f08031a1e08a579b68af62ebcee97a34f645f5e;hp=68a2e55436eb78cef033073399d3814cc739747d;hb=7d4192cb80178ad534e460d56f67e55679c7d8ee;hpb=fd55fc57942d179105ddda100a5341f9aacdf5c0
diff --git a/formats/ctf/metadata/ctf-visitor-xml.c b/formats/ctf/metadata/ctf-visitor-xml.c
index 68a2e554..7f08031a 100644
--- a/formats/ctf/metadata/ctf-visitor-xml.c
+++ b/formats/ctf/metadata/ctf-visitor-xml.c
@@ -218,13 +218,17 @@ int ctf_visitor_print_type_declarator(FILE *fd, int depth, struct ctf_node *node
print_tabs(fd, depth);
fprintf(fd, "\n");
}
- if (node->u.type_declarator.u.nested.length) {
+ if (!cds_list_empty(&node->u.type_declarator.u.nested.length)) {
print_tabs(fd, depth);
fprintf(fd, "\n");
- ret = ctf_visitor_print_xml(fd, depth + 1,
- node->u.type_declarator.u.nested.length);
+ }
+ cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length,
+ siblings) {
+ ret = ctf_visitor_print_xml(fd, depth + 1, iter);
if (ret)
return ret;
+ }
+ if (!cds_list_empty(&node->u.type_declarator.u.nested.length)) {
print_tabs(fd, depth);
fprintf(fd, "\n");
}
@@ -540,12 +544,18 @@ int ctf_visitor_print_xml(FILE *fd, int depth, struct ctf_node *node)
fprintf(fd, "\n");
depth++;
- if (node->u._enum.container_type) {
+ if (!cds_list_empty(&node->u._enum.container_type)) {
print_tabs(fd, depth);
fprintf(fd, "\n");
- ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
+ }
+
+ cds_list_for_each_entry(iter, &node->u._enum.container_type,
+ siblings) {
+ ret = ctf_visitor_print_xml(fd, depth + 1, iter);
if (ret)
return ret;
+ }
+ if (!cds_list_empty(&node->u._enum.container_type)) {
print_tabs(fd, depth);
fprintf(fd, "\n");
}