X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Ftypes%2Fenum.c;h=381491a4dc81e68560ac6c1467c4b107b339d6af;hb=c6e183c2bacc6ee12b0545ef47fb41b63686d8c8;hp=33009da788a5a4dd6577649c40024e5126d14047;hpb=c5e74408f9786219f6b44400dcf2098ab9cc78fb;p=babeltrace.git diff --git a/formats/ctf-text/types/enum.c b/formats/ctf-text/types/enum.c index 33009da7..381491a4 100644 --- a/formats/ctf-text/types/enum.c +++ b/formats/ctf-text/types/enum.c @@ -32,11 +32,18 @@ int ctf_text_enum_write(struct stream_pos *ppos, struct definition *definition) if (pos->dummy) return 0; - print_pos_tabs(pos); + + if (pos->field_nr++ != 0) + fprintf(pos->fp, ","); + fprintf(pos->fp, " "); + if (pos->print_names) + fprintf(pos->fp, "%s = ", + g_quark_to_string(definition->name)); + fprintf(pos->fp, "("); pos->depth++; ret = generic_rw(ppos, &integer_definition->p); - print_pos_tabs(pos); + fprintf(pos->fp, " :"); qs = enum_definition->value; assert(qs); @@ -44,10 +51,13 @@ 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, ")"); + fprintf(pos->fp, " )"); return ret; }