projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix gcc 4.6 warnings
[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 640b8fdff7c1ae6dc5095735328b2224972a1c79..fcb73838ddc4abebe740284a4f80a5eb5593cc71 100644
(file)
--- a/
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
+++ b/
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
@@
-119,7
+119,7
@@
int get_unary_uuid(struct cds_list_head *head, uuid_t *uuid)
assert(node->u.unary_expression.link == UNARY_LINK_UNKNOWN);
assert(i == 0);
src_string = node->u.unary_expression.u.string;
assert(node->u.unary_expression.link == UNARY_LINK_UNKNOWN);
assert(i == 0);
src_string = node->u.unary_expression.u.string;
- ret = uuid_parse(
node->u.unary_expression.u.
string, *uuid);
+ ret = uuid_parse(
src_
string, *uuid);
}
return ret;
}
}
return ret;
}
@@
-468,6
+468,13
@@
int ctf_variant_type_declarators_visit(FILE *fd, int depth,
fprintf(fd, "[error] %s: unable to find variant field declaration type\n", __func__);
return -EINVAL;
}
fprintf(fd, "[error] %s: unable to find variant field declaration type\n", __func__);
return -EINVAL;
}
+
+ if (untagged_variant_declaration_get_field_from_tag(untagged_variant_declaration, field_name) != NULL) {
+ fprintf(fd, "[error] %s: duplicate field %s in variant\n", __func__, g_quark_to_string(field_name));
+ return -EINVAL;
+ }
+
+
untagged_variant_declaration_add_field(untagged_variant_declaration,
g_quark_to_string(field_name),
field_declaration);
untagged_variant_declaration_add_field(untagged_variant_declaration,
g_quark_to_string(field_name),
field_declaration);
@@
-577,7
+584,9
@@
int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope,
return 0;
error:
return 0;
error:
- type_declaration->declaration_free(type_declaration);
+ if (type_declaration) {
+ type_declaration->declaration_free(type_declaration);
+ }
return err;
}
return err;
}
@@
-717,7
+726,7
@@
struct declaration *ctf_declaration_struct_visit(FILE *fd,
ret = ctf_struct_declaration_list_visit(fd, depth + 1, iter,
struct_declaration, trace);
if (ret)
ret = ctf_struct_declaration_list_visit(fd, depth + 1, iter,
struct_declaration, trace);
if (ret)
- goto error;
+ goto error
_free_declaration
;
}
if (name) {
ret = register_struct_declaration(g_quark_from_string(name),
}
if (name) {
ret = register_struct_declaration(g_quark_from_string(name),
@@
-727,8
+736,9
@@
struct declaration *ctf_declaration_struct_visit(FILE *fd,
}
return &struct_declaration->p;
}
}
return &struct_declaration->p;
}
-error:
+error
_free_declaration
:
struct_declaration->p.declaration_free(&struct_declaration->p);
struct_declaration->p.declaration_free(&struct_declaration->p);
+error:
return NULL;
}
return NULL;
}
@@
-1083,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, size;
+ uint64_t alignment
= 1
, size;
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;
@@
-1238,7
+1248,8
@@
struct declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth,
struct ctf_trace *trace)
{
struct ctf_node *expression;
struct ctf_trace *trace)
{
struct ctf_node *expression;
- uint64_t alignment, exp_dig, mant_dig, byte_order = trace->byte_order;
+ uint64_t alignment = 1, exp_dig = 0, mant_dig = 0,
+ byte_order = trace->byte_order;
int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0;
struct declaration_float *float_declaration;
int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0;
struct declaration_float *float_declaration;
This page took
0.023538 seconds
and
4
git commands to generate.