ir: add user byte order to integer/float types
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 30 Jan 2016 06:27:18 +0000 (01:27 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 19 Feb 2016 20:14:50 +0000 (15:14 -0500)
commit445c347168f99d59d70373b79b81618ede74ba94
treece262fafb3d0e980f5c99e406b013a18c43b0b17
parentbb34b5a7d56c93c2e94f79221582fa365d95558b
ir: add user byte order to integer/float types

The `byte_order` field of an integer/float field type gets
replaced by `BIG_ENDIAN` or `LITTLE_ENDIAN` if it's set to
0 (native) once the type becomes the descendant of a
trace. However, once this is set, there is no way to know
that the user intended this field type's byte order to be
native. The metadata string, for example, will never contain
a byte order set to `native` with this behaviour.

This patch adds a `user_byte_order` field to the internal
integer and floating point number field type structures. This
field is the one set by and returned to the user using the
CTF IR API. Internally, the declaration's `byte_order` field
is still used for caching the resolved byte order.

This patch also modifies bt_ctf_stream_class_set_byte_order()
so that it cannot fail. This is an internal, hidden function
which should not be called with invalid parameters. Assertions
are inserted to verify this.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event-types.c
formats/ctf/ir/event.c
formats/ctf/ir/stream-class.c
formats/ctf/ir/trace.c
include/babeltrace/ctf-ir/event-types-internal.h
include/babeltrace/ctf-ir/stream-class-internal.h
This page took 0.025324 seconds and 4 git commands to generate.