Fix: actually write inner struct offsets
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 8 Nov 2014 04:01:24 +0000 (23:01 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 8 Nov 2014 04:01:24 +0000 (23:01 -0500)
barectf/cli.py

index 3a1c6377dd2a3d33fe7273cc1a2ada561c6bb6f7..39f66260877f4bcc0c804877d741874fd43c8a4d 100644 (file)
@@ -697,7 +697,8 @@ def _struct_to_c_lines(doc, struct):
             # as many offset as there are child fields because a future
             # sequence could refer to any of those fields
             for lname, offset in offset_vars.items():
-                line = 'uint32_t off_{}_{}'.format(fname, lname, _CTX_AT);
+                fmt = 'uint32_t off_{}_{} = {} + {};'
+                line = fmt.format(fname, lname, _CTX_AT, offset);
                 lines.append(_CLine(line))
         else:
             # offset of this simple field is the current bit index
This page took 0.023846 seconds and 4 git commands to generate.