barectf.c.j2: only declare `ts` variable when needed
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 24 Sep 2020 21:28:15 +0000 (17:28 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 24 Sep 2020 21:46:31 +0000 (17:46 -0400)
commitf5c70e1ee7f6116e26bc908903edd080cb826c07
treefc09edc672aa68628a0b73e5dab895c7c217831f
parent101c7c7d65692eba9408207b02c5acd488dde77b
barectf.c.j2: only declare `ts` variable when needed

This patch changes the `barectf.c.j2` template so that, for the
packet opening, packet closing, and event record header serialization
functions, the `ts` variable is only declared when it's used.

Without this patch, the C compiler can report such a warning:

    warning: unused variable ‘ts’ [-Wunused-variable]

In `barectf.c-macros.j2`, the open_close_func_preamble() macro is
changed to accept the timestamp packet feature in order to check either
the packet beginning or end timestamp field type feature.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/templates/c/barectf.c-macros.j2
barectf/templates/c/barectf.c.j2
This page took 0.024183 seconds and 4 git commands to generate.