From 7cef9a040c410a18760e5f017c753533b8db0c1b Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 25 Nov 2014 18:22:28 -0500 Subject: [PATCH] Fix: write float/double floating point numbers Casting them to unsigned integers does not keep the IEEE 754 format. --- barectf/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barectf/cli.py b/barectf/cli.py index c0945da..3dd87fa 100644 --- a/barectf/cli.py +++ b/barectf/cli.py @@ -895,7 +895,7 @@ class BarectfCodeGenerator: elif t == 'double': t = 'uint64_t' - src_name_casted = '({}) {}'.format(t, src_name) + src_name_casted = '*(({}*) &{})'.format(t, src_name) return self._template_to_clines(barectf.templates.WRITE_INTEGER, sz=length, bo=bo, type=t, -- 2.34.1