projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize size to 0 to eliminate incorrect gcc uninitialized var warning
[babeltrace.git]
/
formats
/
ctf
/
metadata
/
ctf-visitor-generate-io-struct.c
diff --git
a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
index f0e5b4744667d7a1e8a52f638082ba32e4727f9a..6fbc7c02b0f74aeb41026a7bc0ed8391febaf2d6 100644
(file)
--- a/
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
+++ b/
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
@@
-1093,7
+1093,7
@@
struct declaration *ctf_declaration_integer_visit(FILE *fd, int depth,
struct ctf_trace *trace)
{
struct ctf_node *expression;
struct ctf_trace *trace)
{
struct ctf_node *expression;
- uint64_t alignment = 1, size;
+ uint64_t alignment = 1, size
= 0
;
int byte_order = trace->byte_order;
int signedness = 0;
int has_alignment = 0, has_size = 0;
int byte_order = trace->byte_order;
int signedness = 0;
int has_alignment = 0, has_size = 0;
@@
-1957,7
+1957,6
@@
int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
int ret = 0;
struct ctf_node *iter;
int ret = 0;
struct ctf_node *iter;
-restart:
if (trace->declaration_scope)
return -EEXIST;
trace->declaration_scope = new_declaration_scope(trace->root_declaration_scope);
if (trace->declaration_scope)
return -EEXIST;
trace->declaration_scope = new_declaration_scope(trace->root_declaration_scope);
@@
-2007,10
+2006,6
@@
error:
g_ptr_array_free(trace->streams, TRUE);
free_declaration_scope(trace->declaration_scope);
trace->declaration_scope = NULL;
g_ptr_array_free(trace->streams, TRUE);
free_declaration_scope(trace->declaration_scope);
trace->declaration_scope = NULL;
- /* byte order changed while creating types, retry. */
- if (ret == -EINTR) {
- goto restart;
- }
return ret;
}
return ret;
}
@@
-2066,9
+2061,11
@@
int ctf_visitor_construct_metadata(FILE *fd, int depth, struct ctf_node *node,
struct ctf_node *iter;
printf_verbose("CTF visitor: metadata construction... ");
struct ctf_node *iter;
printf_verbose("CTF visitor: metadata construction... ");
- trace->root_declaration_scope = new_declaration_scope(NULL);
trace->byte_order = byte_order;
trace->byte_order = byte_order;
+retry:
+ trace->root_declaration_scope = new_declaration_scope(NULL);
+
switch (node->type) {
case NODE_ROOT:
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
switch (node->type) {
case NODE_ROOT:
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
@@
-2081,6
+2078,15
@@
int ctf_visitor_construct_metadata(FILE *fd, int depth, struct ctf_node *node,
}
cds_list_for_each_entry(iter, &node->u.root.trace, siblings) {
ret = ctf_trace_visit(fd, depth + 1, iter, trace);
}
cds_list_for_each_entry(iter, &node->u.root.trace, siblings) {
ret = ctf_trace_visit(fd, depth + 1, iter, trace);
+ if (ret == -EINTR) {
+ free_declaration_scope(trace->root_declaration_scope);
+ /*
+ * Need to restart creation of type
+ * definitions, aliases and
+ * trace header declarations.
+ */
+ goto retry;
+ }
if (ret) {
fprintf(fd, "[error] %s: trace declaration error\n", __func__);
goto error;
if (ret) {
fprintf(fd, "[error] %s: trace declaration error\n", __func__);
goto error;
This page took
0.023383 seconds
and
4
git commands to generate.