X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf-text%2Ftypes%2Fenum.c;h=cf8cc4fa85d19364cf13e3d1bf3ec5f528ab5153;hp=33009da788a5a4dd6577649c40024e5126d14047;hb=312623540c466defab45503fbe0ce7ec79dcce85;hpb=b1a2f5806630289aa0b85edbb7f7c581cfa26178 diff --git a/formats/ctf-text/types/enum.c b/formats/ctf-text/types/enum.c index 33009da7..cf8cc4fa 100644 --- a/formats/ctf-text/types/enum.c +++ b/formats/ctf-text/types/enum.c @@ -32,11 +32,21 @@ int ctf_text_enum_write(struct stream_pos *ppos, struct definition *definition) if (pos->dummy) return 0; - print_pos_tabs(pos); + + if (definition->index != 0 && definition->index != INT_MAX) + fprintf(pos->fp, ","); + if (definition->index != INT_MAX) + fprintf(pos->fp, " "); + if (pos->print_names) + fprintf(pos->fp, "%s = ", + g_quark_to_string(definition->name)); + + //print_pos_tabs(pos); fprintf(pos->fp, "("); pos->depth++; ret = generic_rw(ppos, &integer_definition->p); - print_pos_tabs(pos); + //print_pos_tabs(pos); + fprintf(pos->fp, " :"); qs = enum_definition->value; assert(qs); @@ -44,10 +54,14 @@ int ctf_text_enum_write(struct stream_pos *ppos, struct definition *definition) for (i = 0; i < qs->len; i++) { GQuark q = g_array_index(qs, GQuark, i); const char *str = g_quark_to_string(q); + + if (i != 0) + fprintf(pos->fp, ","); + fprintf(pos->fp, " "); fprintf(pos->fp, "%s\n", str); } pos->depth--; - print_pos_tabs(pos); - fprintf(pos->fp, ")"); + //print_pos_tabs(pos); + fprintf(pos->fp, " )"); return ret; }