- for (i = 0; i < tag_mappings_count; ++i) {
- const char *label;
- struct bt_ctf_field_type *ft;
-
- ret = bt_ctf_field_type_enumeration_get_mapping_name(
- (struct bt_ctf_field_type *) variant->tag,
- i, &label);
- assert(ret == 0);
- assert(label);
- ft = bt_ctf_field_type_variant_get_field_type_by_name(
- type, label);
- if (!ft) {
- BT_LOGW("Invalid variant field type: "
- "enumeration tag field type contains a mapping which does not name a variant field type field: "
- "variant-ft-addr=%p, tag-field-name=\"%s\", "
- "enum-ft-addr=%p, mapping-name=\"%s\"",
- type, variant->tag_name->str, variant->tag,
- label);
- ret = -1;
- goto end;
- }
-
- BT_PUT(ft);
- }
-