From 3e9291503aea2e05b7f8547a228a460879193e66 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 7 Nov 2014 23:01:24 -0500 Subject: [PATCH] Fix: actually write inner struct offsets --- barectf/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/barectf/cli.py b/barectf/cli.py index 3a1c637..39f6626 100644 --- a/barectf/cli.py +++ b/barectf/cli.py @@ -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 -- 2.34.1