- if (bt_ctf_field_type(field) == CTF_TYPE_INTEGER)
- ret = get_int_encoding(field);
- else if (bt_ctf_field_type(field) == CTF_TYPE_STRING)
- ret = get_string_encoding(field);
- else
+ if (bt_ctf_field_type(decl) == CTF_TYPE_INTEGER) {
+ integer = get_declaration_integer(decl);
+ if (integer) {
+ ret = integer->encoding;
+ } else {
+ goto error;
+ }
+ } else if (bt_ctf_field_type(decl) == CTF_TYPE_STRING) {
+ string = get_declaration_string(decl);
+ if (string) {
+ ret = string->encoding;
+ } else {
+ goto error;
+ }
+ } else {