projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: ctf-text irregular output with disabled field names
[babeltrace.git]
/
formats
/
ctf-text
/
types
/
struct.c
diff --git
a/formats/ctf-text/types/struct.c
b/formats/ctf-text/types/struct.c
index cbfcc7cde2b00ea2a6b6686ad51ada158f56fb33..a2aee3a7bda69073db0b83254321d410043951f9 100644
(file)
--- a/
formats/ctf-text/types/struct.c
+++ b/
formats/ctf-text/types/struct.c
@@
-31,11
+31,7
@@
int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *definition)
{
- struct bt_declaration *declaration = definition->declaration;
- struct declaration_struct *struct_declaration =
- container_of(declaration, struct declaration_struct, p);
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
struct ctf_text_stream_pos *pos = ctf_text_pos(ppos);
- uint64_t len = bt_struct_declaration_len(struct_declaration);
int field_nr_saved;
int ret;
int field_nr_saved;
int ret;
@@
-46,13
+42,11
@@
int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *defi
if (pos->depth >= 0) {
if (pos->field_nr++ != 0)
fprintf(pos->fp, ",");
if (pos->depth >= 0) {
if (pos->field_nr++ != 0)
fprintf(pos->fp, ",");
- if (pos->print_names || len > 1)
- fprintf(pos->fp, " ");
+ fprintf(pos->fp, " ");
if (pos->print_names && definition->name != 0)
fprintf(pos->fp, "%s = ",
rem_(g_quark_to_string(definition->name)));
if (pos->print_names && definition->name != 0)
fprintf(pos->fp, "%s = ",
rem_(g_quark_to_string(definition->name)));
- if (pos->print_names || len > 1)
- fprintf(pos->fp, "{");
+ fprintf(pos->fp, "{");
}
pos->depth++;
}
}
pos->depth++;
}
@@
-61,7
+55,7
@@
int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *defi
ret = bt_struct_rw(ppos, definition);
if (!pos->dummy) {
pos->depth--;
ret = bt_struct_rw(ppos, definition);
if (!pos->dummy) {
pos->depth--;
- if (pos->depth >= 0
&& (pos->print_names || len > 1)
) {
+ if (pos->depth >= 0) {
fprintf(pos->fp, " }");
}
}
fprintf(pos->fp, " }");
}
}
This page took
0.024972 seconds
and
4
git commands to generate.