integer->parent.declaration->id = CTF_TYPE_INTEGER;
integer->declaration.len = size;
integer->declaration.base = BT_CTF_INTEGER_BASE_DECIMAL;
- integer->declaration.encoding = BT_CTF_STRING_ENCODING_NONE;
+ integer->declaration.encoding =
+ (enum ctf_string_encoding) BT_CTF_STRING_ENCODING_NONE;
bt_ctf_field_type_init(&integer->parent, TRUE);
return &integer->parent;
}
}
integer = container_of(type, struct bt_ctf_field_type_integer, parent);
- ret = integer->declaration.encoding;
+ ret = (enum bt_ctf_string_encoding) integer->declaration.encoding;
end:
return ret;
}
int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *type,
- enum bt_ctf_string_encoding encoding)
+ enum ctf_string_encoding encoding)
{
int ret = 0;
struct bt_ctf_field_type_integer *integer;
if (!type || type->frozen ||
(type->declaration->id != CTF_TYPE_INTEGER) ||
- (encoding < BT_CTF_STRING_ENCODING_NONE) ||
- (encoding >= BT_CTF_STRING_ENCODING_UNKNOWN)) {
+ (encoding < CTF_STRING_NONE) ||
+ (encoding >= CTF_STRING_UNKNOWN)) {
ret = -1;
goto end;
}
string->parent.declaration = &string->declaration.p;
string->parent.declaration->id = CTF_TYPE_STRING;
bt_ctf_field_type_init(&string->parent, TRUE);
- string->declaration.encoding = BT_CTF_STRING_ENCODING_UTF8;
+ string->declaration.encoding =
+ (enum ctf_string_encoding) BT_CTF_STRING_ENCODING_UTF8;
string->parent.declaration->alignment = CHAR_BIT;
return &string->parent;
}
string = container_of(type, struct bt_ctf_field_type_string,
parent);
- ret = string->declaration.encoding;
+ ret = (enum bt_ctf_string_encoding) string->declaration.encoding;
end:
return ret;
}
int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *type,
- enum bt_ctf_string_encoding encoding)
+ enum ctf_string_encoding encoding)
{
int ret = 0;
struct bt_ctf_field_type_string *string;
if (!type || type->declaration->id != CTF_TYPE_STRING ||
- (encoding != BT_CTF_STRING_ENCODING_UTF8 &&
- encoding != BT_CTF_STRING_ENCODING_ASCII)) {
+ (encoding != CTF_STRING_UTF8 &&
+ encoding != CTF_STRING_ASCII)) {
ret = -1;
goto end;
}
"integer { size = %zu; align = %zu; signed = %s; encoding = %s; base = %s; byte_order = %s",
integer->declaration.len, type->declaration->alignment,
(integer->declaration.signedness ? "true" : "false"),
- get_encoding_string(integer->declaration.encoding),
+ get_encoding_string((enum bt_ctf_string_encoding) integer->declaration.encoding),
get_integer_base_string(integer->declaration.base),
get_byte_order_string(integer->declaration.byte_order));
if (integer->mapped_clock) {
g_string_append_printf(context->string,
"string { encoding = %s; }",
- get_encoding_string(string->declaration.encoding));
+ get_encoding_string((enum bt_ctf_string_encoding) string->declaration.encoding));
return 0;
}