From: Philippe Proulx Date: Tue, 25 Nov 2014 23:22:28 +0000 (-0500) Subject: Fix: write float/double floating point numbers X-Git-Tag: v0.2.0~6 X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=7cef9a040c410a18760e5f017c753533b8db0c1b;p=barectf.git Fix: write float/double floating point numbers Casting them to unsigned integers does not keep the IEEE 754 format. --- 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,