lib: split real FC/field into single and double prec FC/field
[babeltrace.git] / src / plugins / ctf / fs-sink / fs-sink-stream.c
index 717571e0d2f3b903d0692ef295136680529cc21e..ca61d10ff1c9bbee4cc450bf64178438c06af54a 100644 (file)
@@ -250,12 +250,14 @@ int write_float_field(struct fs_sink_stream *stream,
                struct fs_sink_ctf_field_class_float *fc, const bt_field *field)
 {
        int ret;
-       double val = bt_field_real_get_value(field);
+       double val;
 
        if (fc->base.size == 32) {
+               val = (double) bt_field_real_single_precision_get_value(field);
                ret = bt_ctfser_write_float32(&stream->ctfser, val,
                        fc->base.base.alignment, BYTE_ORDER);
        } else {
+               val = bt_field_real_double_precision_get_value(field);
                ret = bt_ctfser_write_float64(&stream->ctfser, val,
                        fc->base.base.alignment, BYTE_ORDER);
        }
This page took 0.023123 seconds and 4 git commands to generate.