Fix: write float/double floating point numbers
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 25 Nov 2014 23:22:28 +0000 (18:22 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 25 Nov 2014 23:22:39 +0000 (18:22 -0500)
Casting them to unsigned integers does not keep the
IEEE 754 format.

barectf/cli.py

index c0945da70d2fe6c5bf3736100ce4003f45c0461d..3dd87fa0a8f4fcb40f0a7d144e278b37e7505955 100644 (file)
@@ -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,
This page took 0.025882 seconds and 4 git commands to generate.