ir: add user byte order to integer/float types
[babeltrace.git] / formats / ctf / ir / event.c
index a36779de1e3576a6682c4084cdae646c21728ba5..14e605f0e64e78c8d3ffaea374e79547cf0fa79e 100644 (file)
@@ -860,10 +860,6 @@ void bt_ctf_event_class_destroy(struct bt_object *obj)
 {
        struct bt_ctf_event_class *event_class;
 
-       /*
-        * Don't call put() on the stream class. See comment in
-        * bt_ctf_event_class_set_stream_class for explanation.
-        */
        event_class = container_of(obj, struct bt_ctf_event_class, base);
        bt_ctf_attributes_destroy(event_class->attributes);
        bt_put(event_class->context);
@@ -1053,6 +1049,9 @@ void bt_ctf_event_class_set_native_byte_order(
                return;
        }
 
+       assert(byte_order == 0 || byte_order == LITTLE_ENDIAN ||
+               byte_order == BIG_ENDIAN);
+
        bt_ctf_field_type_set_native_byte_order(event_class->context,
                byte_order);
        bt_ctf_field_type_set_native_byte_order(event_class->fields,
@@ -1141,11 +1140,11 @@ int bt_ctf_event_populate_event_header(struct bt_ctf_event *event)
                        timestamp_field_type);
                bt_put(timestamp_field_type);
                if (mapped_clock) {
-                       uint64_t timestamp = bt_ctf_clock_get_time(
-                               mapped_clock);
+                       int64_t timestamp;
 
+                       ret = bt_ctf_clock_get_time(mapped_clock, &timestamp);
                        bt_put(mapped_clock);
-                       if (timestamp == (uint64_t) -1ULL) {
+                       if (ret) {
                                goto end;
                        }
 
This page took 0.027471 seconds and 4 git commands to generate.