int ret = 0;
struct bt_ctf_field_type_structure *structure;
+ /*
+ * TODO: check that `field_type` does not contain `type`,
+ * recursively.
+ */
if (!type || !field_type || type->frozen ||
bt_ctf_validate_identifier(field_name) ||
- (type->declaration->id != BT_CTF_TYPE_ID_STRUCT)) {
+ (type->declaration->id != BT_CTF_TYPE_ID_STRUCT) ||
+ type == field_type) {
ret = -1;
goto end;
}
struct bt_ctf_field_type_variant *variant;
GQuark field_name_quark = g_quark_from_string(field_name);
+ /*
+ * TODO: check that `field_type` does not contain `type`,
+ * recursively.
+ */
if (!type || !field_type || type->frozen ||
bt_ctf_validate_identifier(field_name) ||
- (type->declaration->id != BT_CTF_TYPE_ID_VARIANT)) {
+ (type->declaration->id != BT_CTF_TYPE_ID_VARIANT) ||
+ type == field_type) {
ret = -1;
goto end;
}
ret = integer->user_byte_order;
break;
}
+ case BT_CTF_TYPE_ID_ENUM:
+ {
+ struct bt_ctf_field_type_enumeration *enum_ft = container_of(
+ type, struct bt_ctf_field_type_enumeration, parent);
+ ret = bt_ctf_field_type_get_byte_order(enum_ft->container);
+ break;
+ }
case BT_CTF_TYPE_ID_FLOAT:
{
struct bt_ctf_field_type_floating_point *floating_point =
}
}
-BT_HIDDEN
struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *type)
{
struct bt_ctf_field_type *copy = NULL;