Fix integer/float/string read: keep value in definition structure
[babeltrace.git] / types / float.c
index 576f8622567c75af82bf3acfd91d8c9f321fe438..9113bb8c1cfc3927ad0d845f9f5a174cfc359f28 100644 (file)
@@ -35,15 +35,12 @@ void float_copy(struct stream_pos *destp,
        struct definition_float *_float =
                container_of(definition, struct definition_float, p);
        struct declaration_float *float_declaration = _float->declaration;
+       long double v;
 
-       if (fsrc->float_copy == fdest->float_copy) {
-               fsrc->float_copy(destp, srcp, float_declaration);
-       } else {
-               double v;
-
-               v = fsrc->double_read(srcp, float_declaration);
-               fdest->double_write(destp, float_declaration, v);
-       }
+       v = fsrc->ldouble_read(srcp, float_declaration);
+       _float->value = v;
+       if (fdest)
+               fdest->ldouble_write(destp, float_declaration, v);
 }
 
 static
This page took 0.022331 seconds and 4 git commands to generate.