prettify output
[babeltrace.git] / formats / ctf-text / types / struct.c
index 20bc1a7f3f8e872bc1ec72c737e3c6ff57c7c050..4270a21afa65bb99e87b6e5d8955c026e6606a56 100644 (file)
 
 void ctf_text_struct_write(struct stream_pos *ppos, struct definition *definition)
 {
-       struct declaration *declaration = definition->declaration;
        struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
 
        if (!pos->dummy) {
-               print_pos_tabs(pos);
-               fprintf(pos->fp, "{\n");
+               if (pos->depth >= 0) {
+                       print_pos_tabs(pos);
+                       fprintf(pos->fp, "{\n");
+               }
                pos->depth++;
        }
        struct_rw(ppos, definition);
        if (!pos->dummy) {
                pos->depth--;
-               print_pos_tabs(pos);
-               fprintf(pos->fp, "}\n");
+               if (pos->depth >= 0) {
+                       print_pos_tabs(pos);
+                       fprintf(pos->fp, "}\n");
+               }
        }
 }
This page took 0.023474 seconds and 4 git commands to generate.