From 5a547eb3b9071014445ad910e4715effd61a9973 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 5 Jun 2018 17:56:05 -0400 Subject: [PATCH] Fix: CTF writer: use appropriate enumerators Signed-off-by: Philippe Proulx --- lib/ctf-writer/fields.c | 6 +++--- lib/ctf-writer/serialize.c | 6 +++--- lib/ctf-writer/stream-class.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ctf-writer/fields.c b/lib/ctf-writer/fields.c index 11baf31b..8d92cb6a 100644 --- a/lib/ctf-writer/fields.c +++ b/lib/ctf-writer/fields.c @@ -623,12 +623,12 @@ int bt_ctf_field_sequence_set_length(struct bt_ctf_field *field, BT_ASSERT_PRE_NON_NULL(length_field, "Length field"); BT_ASSERT_PRE_FIELD_COMMON_IS_SET((void *) length_field, "Length field"); - BT_ASSERT_PRE(common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_INTEGER || - common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_ENUM, + BT_ASSERT_PRE(common_length_field->type->id == BT_FIELD_TYPE_ID_INTEGER || + common_length_field->type->id == BT_FIELD_TYPE_ID_ENUM, "Length field must be an integer or enumeration field: %!+wf", length_field); - if (common_length_field->type->id == BT_CTF_FIELD_TYPE_ID_ENUM) { + if (common_length_field->type->id == BT_FIELD_TYPE_ID_ENUM) { struct bt_ctf_field_enumeration *enumeration = (void *) length_field; diff --git a/lib/ctf-writer/serialize.c b/lib/ctf-writer/serialize.c index e2f3bb6a..4d2abecb 100644 --- a/lib/ctf-writer/serialize.c +++ b/lib/ctf-writer/serialize.c @@ -68,7 +68,7 @@ int aligned_integer_write(struct bt_ctf_stream_pos *pos, union intval value, unsigned int alignment, unsigned int size, bt_bool is_signed, enum bt_ctf_byte_order byte_order) { - bt_bool rbo = (byte_order != BT_MY_BYTE_ORDER); /* reverse byte order */ + bt_bool rbo = ((int) byte_order != BT_MY_BYTE_ORDER); /* reverse byte order */ if (!bt_ctf_stream_pos_align(pos, alignment)) return -EFAULT; @@ -216,7 +216,7 @@ int bt_ctf_field_integer_write(struct bt_field_common *field, union intval value; byte_order = (int) int_type->user_byte_order; - if (byte_order == BT_BYTE_ORDER_NATIVE) { + if ((int) byte_order == BT_BYTE_ORDER_NATIVE) { byte_order = native_byte_order; } @@ -241,7 +241,7 @@ int bt_ctf_field_floating_point_write( unsigned int size; byte_order = (int) flt_type->user_byte_order; - if (byte_order == BT_BYTE_ORDER_NATIVE) { + if ((int) byte_order == BT_BYTE_ORDER_NATIVE) { byte_order = native_byte_order; } diff --git a/lib/ctf-writer/stream-class.c b/lib/ctf-writer/stream-class.c index 715b4e90..a371f400 100644 --- a/lib/ctf-writer/stream-class.c +++ b/lib/ctf-writer/stream-class.c @@ -232,7 +232,7 @@ int try_map_clock_class(struct bt_ctf_stream_class *stream_class, } BT_ASSERT(((struct bt_field_type_common *) ft)->id == - BT_CTF_FIELD_TYPE_ID_INTEGER); + BT_FIELD_TYPE_ID_INTEGER); mapped_clock_class = bt_ctf_field_type_integer_get_mapped_clock_class(ft); if (!mapped_clock_class) { -- 2.34.1