X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fctf-ir%2Ffield-types.c;h=0cf5d1ef4293c7a0f3732f4be49ee59346abfec8;hb=e011d2c1930972adc9b85f2c4067c62c207fc4ff;hp=92211a49f750409619560ba9be3b0206c9f99ef5;hpb=a68c0f97106c1b5ef70ec92a3e88e5e830a8b31f;p=babeltrace.git diff --git a/lib/ctf-ir/field-types.c b/lib/ctf-ir/field-types.c index 92211a49..0cf5d1ef 100644 --- a/lib/ctf-ir/field-types.c +++ b/lib/ctf-ir/field-types.c @@ -1181,7 +1181,8 @@ end: return clock_class; } -int bt_ctf_field_type_integer_set_mapped_clock_class( +BT_HIDDEN +int bt_ctf_field_type_integer_set_mapped_clock_class_no_check( struct bt_ctf_field_type *type, struct bt_ctf_clock_class *clock_class) { @@ -1200,10 +1201,10 @@ int bt_ctf_field_type_integer_set_mapped_clock_class( goto end; } - if (type->frozen) { - BT_LOGW("Invalid parameter: field type is frozen: addr=%p", - type); - ret = -1; + if (type->id != BT_CTF_FIELD_TYPE_ID_INTEGER) { + BT_LOGW("Invalid parameter: field type is not an integer field type: " + "addr=%p, ft-id=%s", type, + bt_ctf_field_type_id_string(type->id)); goto end; } @@ -1226,6 +1227,32 @@ end: return ret; } +int bt_ctf_field_type_integer_set_mapped_clock_class( + struct bt_ctf_field_type *type, + struct bt_ctf_clock_class *clock_class) +{ + int ret = 0; + + if (!type) { + BT_LOGW_STR("Invalid parameter: field type is NULL."); + ret = -1; + goto end; + } + + if (type->frozen) { + BT_LOGW("Invalid parameter: field type is frozen: addr=%p", + type); + ret = -1; + goto end; + } + + ret = bt_ctf_field_type_integer_set_mapped_clock_class_no_check( + type, clock_class); + +end: + return ret; +} + static void bt_ctf_field_type_enum_iter_destroy(struct bt_object *obj) {