Fix: CTF writer: use appropriate enumerators
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 5 Jun 2018 21:56:05 +0000 (17:56 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:05:45 +0000 (00:05 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/ctf-writer/fields.c
lib/ctf-writer/serialize.c
lib/ctf-writer/stream-class.c

index 11baf31b76c4c7bf1ee3fc6cf90bec5947813c61..8d92cb6ab7e17d1eaafc009241fdc9e0ee470448 100644 (file)
@@ -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;
 
index e2f3bb6a77a7e1e7e697e998c6c28b407c96b32c..4d2abecbddbcdcd8718e1fb0ca603aff61db1813 100644 (file)
@@ -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;
        }
 
index 715b4e90d24c6e268a5e244e57a386adee137a17..a371f400d09f002688476079e62e7c4dc1c47bcc 100644 (file)
@@ -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) {
This page took 0.027171 seconds and 4 git commands to generate.