Fix: bt_ctfser_write_float64(): use `double` in union, not `float`
[babeltrace.git] / src / ctfser / ctfser.h
index c59af924152bd5e704c66b9ebe6cc80f09ce773d..cf9941bc225ee843e95c0f7f76f556091f3969b5 100644 (file)
@@ -72,6 +72,9 @@ struct bt_ctfser {
 
        /* Stream file's path (for debugging) */
        GString *path;
+
+       /* Serializer's log level */
+       int log_level;
 };
 
 /*
@@ -80,7 +83,8 @@ struct bt_ctfser {
  * This function opens the file `path` for writing.
  */
 BT_HIDDEN
-int bt_ctfser_init(struct bt_ctfser *ctfser, const char *path);
+int bt_ctfser_init(struct bt_ctfser *ctfser, const char *path,
+               int log_level);
 
 /*
  * Finalizes a CTF serializer.
@@ -503,10 +507,10 @@ int bt_ctfser_write_float64(struct bt_ctfser *ctfser, double value,
 {
        union u64f {
                uint64_t u;
-               float f;
+               double d;
        } u64f;
 
-       u64f.f = value;
+       u64f.d = value;
        return bt_ctfser_write_unsigned_int(ctfser, u64f.u, alignment_bits,
                64, byte_order);
 }
This page took 0.023476 seconds and 4 git commands to generate.