}
int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *type,
- size_t size)
+ unsigned int size)
{
int ret = 0;
struct bt_ctf_field_type_integer *integer;
}
switch (base) {
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
case BT_CTF_INTEGER_BASE_BINARY:
case BT_CTF_INTEGER_BASE_OCTAL:
case BT_CTF_INTEGER_BASE_DECIMAL:
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)
{
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;
}
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)
{
byte_order != BT_CTF_BYTE_ORDER_LITTLE_ENDIAN &&
byte_order != BT_CTF_BYTE_ORDER_BIG_ENDIAN &&
byte_order != BT_CTF_BYTE_ORDER_NETWORK) {
- BT_LOGW("Invalid parameter: unknown byte order: "
+ BT_LOGW("Invalid parameter: invalid byte order: "
"addr=%p, bo=%s", type,
bt_ctf_byte_order_string(byte_order));
ret = -1;
switch (base) {
case BT_CTF_INTEGER_BASE_DECIMAL:
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
base_string = "decimal";
break;
case BT_CTF_INTEGER_BASE_HEXADECIMAL:
{
size_t i;
unsigned int indent;
- int64_t ret = 0;
+ int ret = 0;
struct bt_ctf_field_type_structure *structure = container_of(type,
struct bt_ctf_field_type_structure, parent);
GString *structure_field_name = context->field_name;
struct bt_ctf_field_type *type)
{
struct bt_ctf_field_type *copy;
- struct bt_ctf_field_type_string *string;
BT_LOGD("Copying string field type's: addr=%p", type);
copy = bt_ctf_field_type_string_create();
goto end;
}
- string = container_of(type, struct bt_ctf_field_type_string,
- parent);
BT_LOGD("Copied string field type: original-ft-addr=%p, copy-ft-addr=%p",
type, copy);
end:
if (int_type_a->mapped_clock != int_type_b->mapped_clock) {
BT_LOGV("Integer field types differ: different mapped clock classes: "
"ft-a-mapped-clock-class-addr=%p, "
- "ft-b-mapped-clock-class-addr=%p, ",
- "ft-a-mapped-clock-class-name=\"%s\", ",
+ "ft-b-mapped-clock-class-addr=%p, "
+ "ft-a-mapped-clock-class-name=\"%s\", "
"ft-b-mapped-clock-class-name=\"%s\"",
int_type_a->mapped_clock, int_type_b->mapped_clock,
int_type_a->mapped_clock ? bt_ctf_clock_class_get_name(int_type_a->mapped_clock) : "",
/* Exponent length */
if (float_a->exp_dig != float_b->exp_dig) {
BT_LOGV("Floating point number field types differ: different exponent sizes: "
- "ft-a-exp-size=%s, ft-b-exp-size=%s",
+ "ft-a-exp-size=%u, ft-b-exp-size=%u",
float_a->exp_dig, float_b->exp_dig);
goto end;
}
/* Mantissa length */
if (float_a->mant_dig != float_b->mant_dig) {
BT_LOGV("Floating point number field types differ: different mantissa sizes: "
- "ft-a-mant-size=%s, ft-b-mant-size=%s",
+ "ft-a-mant-size=%u, ft-b-mant-size=%u",
float_a->mant_dig, float_b->mant_dig);
goto end;
}
ret = bt_ctf_field_type_compare(field_a->type, field_b->type);
if (ret == 1) {
BT_LOGV("Structure/variant field type fields differ: different field types: "
- "field-name=\"%s\", field-a-ft-addr=%s, field-b-ft-addr=%s",
+ "field-name=\"%s\", field-a-ft-addr=%p, field-b-ft-addr=%p",
g_quark_to_string(field_a->name),
field_a->type, field_b->type);
}
/* Tag name */
if (strcmp(variant_a->tag_name->str, variant_b->tag_name->str)) {
BT_LOGV("Variant field types differ: different tag field names: "
- "ft-a-tag-field-name=%u, ft-b-tag-field-name=%u",
+ "ft-a-tag-field-name=\"%s\", ft-b-tag-field-name=\"%s\"",
variant_a->tag_name->str, variant_b->tag_name->str);
goto end;
}
if (strcmp(sequence_a->length_field_name->str,
sequence_b->length_field_name->str)) {
BT_LOGV("Sequence field types differ: different length field names: "
- "ft-a-length-field-name=%u, ft-b-length-field-name=%u",
+ "ft-a-length-field-name=\"%s\", "
+ "ft-b-length-field-name=\"%s\"",
sequence_a->length_field_name->str,
sequence_b->length_field_name->str);
goto end;