projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modify bt_ctf_field_enumeration_get_single_mapping to return iterator
[babeltrace.git]
/
formats
/
ctf
/
ir
/
field-types.c
diff --git
a/formats/ctf/ir/field-types.c
b/formats/ctf/ir/field-types.c
index 49144162d49c9c25372a8e0963279453319cd61a..043df078464f5eb41d3bcec5b4f367c42b4546d7 100644
(file)
--- a/
formats/ctf/ir/field-types.c
+++ b/
formats/ctf/ir/field-types.c
@@
-1879,22
+1879,30
@@
struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
struct bt_ctf_field_type *type,
struct bt_ctf_field *tag)
{
struct bt_ctf_field_type *type,
struct bt_ctf_field *tag)
{
+ int ret;
const char *enum_value;
struct bt_ctf_field_type *field_type = NULL;
const char *enum_value;
struct bt_ctf_field_type *field_type = NULL;
+ struct bt_ctf_field_type_enumeration_mapping_iterator *iter = NULL;
if (!type || !tag || type->declaration->id != BT_CTF_TYPE_ID_VARIANT) {
goto end;
}
if (!type || !tag || type->declaration->id != BT_CTF_TYPE_ID_VARIANT) {
goto end;
}
- enum_value = bt_ctf_field_enumeration_get_single_mapping_name(tag);
- if (!enum_value) {
+ iter = bt_ctf_field_enumeration_get_mappings(tag);
+ if (!iter) {
+ goto end;
+ }
+
+ ret = bt_ctf_field_type_enumeration_mapping_iterator_get_name(iter,
+ &enum_value);
+ if (ret) {
goto end;
}
goto end;
}
- /* Already increments field_type's reference count */
field_type = bt_ctf_field_type_variant_get_field_type_by_name(
type, enum_value);
end:
field_type = bt_ctf_field_type_variant_get_field_type_by_name(
type, enum_value);
end:
+ bt_put(iter);
return field_type;
}
return field_type;
}
This page took
0.024291 seconds
and
4
git commands to generate.