From 9c08c816a55bbc538957648b49d41354e43c7cdf Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sat, 20 Jul 2019 12:38:21 -0400 Subject: [PATCH] lib: rename functions to clearly indicate API inheritance This patch renames some functions of the library's API to show how an API inherits another one, for example (before): bt_field_signed_integer_get_value() bt_field_unsigned_integer_get_value() vs. (after): bt_field_integer_signed_get_value bt_field_integer_unsigned_get_value The second version clearly shows that both are part of the `bt_field_integer` API. This patch aligns the names of those functions with other parts of the API which already have the correct order of prefixes, for example: bt_component_class_source_create() bt_component_class_filter_create() bt_component_class_sink_create() bt_component_class_get_name() bt_message_event_create() bt_message_get_type() Signed-off-by: Philippe Proulx Change-Id: I5f7b637d1d72d610f88f3f7d0122c8975f26481b Reviewed-on: https://review.lttng.org/c/babeltrace/+/1728 Tested-by: jenkins --- .../babeltrace2/trace-ir/field-class-const.h | 72 +++++++-------- include/babeltrace2/trace-ir/field-class.h | 20 ++--- include/babeltrace2/trace-ir/field-const.h | 12 +-- include/babeltrace2/trace-ir/field.h | 12 +-- include/babeltrace2/types.h | 8 +- include/babeltrace2/value-const.h | 4 +- include/babeltrace2/value.h | 12 +-- src/bindings/python/bt2/bt2/field.py | 14 +-- src/bindings/python/bt2/bt2/field_class.py | 48 +++++----- src/bindings/python/bt2/bt2/trace_class.py | 12 +-- src/bindings/python/bt2/bt2/value.py | 16 ++-- src/cli/babeltrace2-cfg-cli-params-arg.c | 6 +- src/cli/babeltrace2.c | 14 +-- src/lib/lib-logging.c | 8 +- src/lib/trace-ir/field-class.c | 90 +++++++++---------- src/lib/trace-ir/field-class.h | 16 ++-- src/lib/trace-ir/field.c | 24 ++--- src/lib/trace-ir/resolve-field-path.c | 2 +- src/lib/trace-ir/trace.c | 2 +- src/lib/value.c | 28 +++--- .../ctf/common/metadata/ctf-meta-translate.c | 36 ++++---- src/plugins/ctf/common/msg-iter/msg-iter.c | 6 +- src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h | 4 +- src/plugins/ctf/fs-sink/fs-sink-stream.c | 4 +- src/plugins/ctf/fs-sink/fs-sink-trace.c | 10 +-- .../ctf/fs-sink/translate-ctf-ir-to-tsdl.c | 18 ++-- .../fs-sink/translate-trace-ir-to-ctf-ir.c | 54 +++++------ src/plugins/ctf/fs-src/fs.c | 4 +- .../ctf/lttng-live/viewer-connection.c | 8 +- .../lttng-utils/debug-info/debug-info.c | 10 +-- .../debug-info/trace-ir-data-copy.c | 14 +-- .../trace-ir-metadata-field-class-copy.c | 52 +++++------ src/plugins/text/details/write.c | 32 +++---- src/plugins/text/pretty/print.c | 10 +-- src/plugins/utils/counter/counter.c | 2 +- src/plugins/utils/trimmer/trimmer.c | 2 +- tests/lib/plugin.c | 2 +- tests/lib/test_bt_values.c | 86 +++++++++--------- tests/lib/test_trace_ir_ref.c | 6 +- 39 files changed, 390 insertions(+), 390 deletions(-) diff --git a/include/babeltrace2/trace-ir/field-class-const.h b/include/babeltrace2/trace-ir/field-class-const.h index 844c9e32..7511d0d4 100644 --- a/include/babeltrace2/trace-ir/field-class-const.h +++ b/include/babeltrace2/trace-ir/field-class-const.h @@ -74,34 +74,34 @@ extern bt_bool bt_field_class_real_is_single_precision( extern uint64_t bt_field_class_enumeration_get_mapping_count( const bt_field_class *field_class); -extern const bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( +extern const bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_label_const( +extern const bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( const bt_field_class *field_class, const char *label); -extern const bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_index_const( +extern const bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_label_const( +extern const bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_label_const( const bt_field_class *field_class, const char *label); static inline const bt_field_class_enumeration_mapping * -bt_field_class_unsigned_enumeration_mapping_as_mapping_const( - const bt_field_class_unsigned_enumeration_mapping *mapping) +bt_field_class_enumeration_unsigned_mapping_as_mapping_const( + const bt_field_class_enumeration_unsigned_mapping *mapping) { return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping); } static inline const bt_field_class_enumeration_mapping * -bt_field_class_signed_enumeration_mapping_as_mapping_const( - const bt_field_class_signed_enumeration_mapping *mapping) +bt_field_class_enumeration_signed_mapping_as_mapping_const( + const bt_field_class_enumeration_signed_mapping *mapping) { return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping); } @@ -110,12 +110,12 @@ extern const char *bt_field_class_enumeration_mapping_get_label( const bt_field_class_enumeration_mapping *mapping); extern const bt_integer_range_set_unsigned * -bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( - const bt_field_class_unsigned_enumeration_mapping *mapping); +bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( + const bt_field_class_enumeration_unsigned_mapping *mapping); extern const bt_integer_range_set_signed * -bt_field_class_signed_enumeration_mapping_borrow_ranges_const( - const bt_field_class_signed_enumeration_mapping *mapping); +bt_field_class_enumeration_signed_mapping_borrow_ranges_const( + const bt_field_class_enumeration_signed_mapping *mapping); typedef enum bt_field_class_enumeration_get_mapping_labels_for_value_status { BT_FIELD_CLASS_ENUMERATION_GET_MAPPING_LABELS_BY_VALUE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, @@ -123,13 +123,13 @@ typedef enum bt_field_class_enumeration_get_mapping_labels_for_value_status { } bt_field_class_enumeration_get_mapping_labels_for_value_status; extern bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( const bt_field_class *field_class, uint64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); extern bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_signed_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_signed_get_mapping_labels_for_value( const bt_field_class *field_class, int64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); @@ -156,11 +156,11 @@ extern const bt_field_class * bt_field_class_array_borrow_element_field_class_const( const bt_field_class *field_class); -extern uint64_t bt_field_class_static_array_get_length( +extern uint64_t bt_field_class_array_static_get_length( const bt_field_class *field_class); extern const bt_field_path * -bt_field_class_dynamic_array_borrow_length_field_path_const( +bt_field_class_array_dynamic_borrow_length_field_path_const( const bt_field_class *field_class); extern uint64_t bt_field_class_variant_get_option_count( @@ -174,20 +174,20 @@ extern const bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); -extern const bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( +extern const bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const( +extern const bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); -extern const bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( +extern const bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_name_const( +extern const bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); extern const char *bt_field_class_variant_option_get_name( @@ -202,25 +202,25 @@ bt_field_class_variant_with_selector_borrow_selector_field_path_const( const bt_field_class *field_class); extern const bt_integer_range_set_unsigned * -bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( - const bt_field_class_variant_with_unsigned_selector_option *option); +bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_unsigned_option *option); static inline const bt_field_class_variant_option * -bt_field_class_variant_with_unsigned_selector_option_as_option_const( - const bt_field_class_variant_with_unsigned_selector_option *option) +bt_field_class_variant_with_selector_unsigned_option_as_option_const( + const bt_field_class_variant_with_selector_unsigned_option *option) { return __BT_UPCAST_CONST(bt_field_class_variant_option, option); } extern const bt_integer_range_set_signed * -bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( - const bt_field_class_variant_with_signed_selector_option *option); +bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_signed_option *option); static inline const bt_field_class_variant_option * -bt_field_class_variant_with_signed_selector_option_as_option_const( - const bt_field_class_variant_with_signed_selector_option *option) +bt_field_class_variant_with_selector_signed_option_as_option_const( + const bt_field_class_variant_with_selector_signed_option *option) { return __BT_UPCAST_CONST(bt_field_class_variant_option, option); } diff --git a/include/babeltrace2/trace-ir/field-class.h b/include/babeltrace2/trace-ir/field-class.h index ec4456f6..9d2cf064 100644 --- a/include/babeltrace2/trace-ir/field-class.h +++ b/include/babeltrace2/trace-ir/field-class.h @@ -37,10 +37,10 @@ extern "C" { #endif -extern bt_field_class *bt_field_class_unsigned_integer_create( +extern bt_field_class *bt_field_class_integer_unsigned_create( bt_trace_class *trace_class); -extern bt_field_class *bt_field_class_signed_integer_create( +extern bt_field_class *bt_field_class_integer_signed_create( bt_trace_class *trace_class); extern void bt_field_class_integer_set_field_value_range( @@ -56,10 +56,10 @@ extern void bt_field_class_real_set_is_single_precision( bt_field_class *field_class, bt_bool is_single_precision); -extern bt_field_class *bt_field_class_unsigned_enumeration_create( +extern bt_field_class *bt_field_class_enumeration_unsigned_create( bt_trace_class *trace_class); -extern bt_field_class *bt_field_class_signed_enumeration_create( +extern bt_field_class *bt_field_class_enumeration_signed_create( bt_trace_class *trace_class); typedef enum bt_field_class_enumeration_add_mapping_status { @@ -68,12 +68,12 @@ typedef enum bt_field_class_enumeration_add_mapping_status { } bt_field_class_enumeration_add_mapping_status; extern bt_field_class_enumeration_add_mapping_status -bt_field_class_unsigned_enumeration_add_mapping( +bt_field_class_enumeration_unsigned_add_mapping( bt_field_class *field_class, const char *label, const bt_integer_range_set_unsigned *range_set); extern bt_field_class_enumeration_add_mapping_status -bt_field_class_signed_enumeration_add_mapping( +bt_field_class_enumeration_signed_add_mapping( bt_field_class *field_class, const char *label, const bt_integer_range_set_signed *range_set); @@ -101,11 +101,11 @@ extern bt_field_class_structure_member * bt_field_class_structure_borrow_member_by_name( bt_field_class *field_class, const char *name); -extern bt_field_class *bt_field_class_static_array_create( +extern bt_field_class *bt_field_class_array_static_create( bt_trace_class *trace_class, bt_field_class *elem_field_class, uint64_t length); -extern bt_field_class *bt_field_class_dynamic_array_create( +extern bt_field_class *bt_field_class_array_dynamic_create( bt_trace_class *trace_class, bt_field_class *elem_field_class, bt_field_class *length_field_class); @@ -133,13 +133,13 @@ typedef enum bt_field_class_variant_with_selector_append_option_status { } bt_field_class_variant_with_selector_append_option_status; extern bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_unsigned_selector_append_option( +bt_field_class_variant_with_selector_unsigned_append_option( bt_field_class *var_field_class, const char *name, bt_field_class *field_class, const bt_integer_range_set_unsigned *range_set); extern bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_signed_selector_append_option( +bt_field_class_variant_with_selector_signed_append_option( bt_field_class *var_field_class, const char *name, bt_field_class *field_class, const bt_integer_range_set_signed *range_set); diff --git a/include/babeltrace2/trace-ir/field-const.h b/include/babeltrace2/trace-ir/field-const.h index e9190f47..7ba63ee0 100644 --- a/include/babeltrace2/trace-ir/field-const.h +++ b/include/babeltrace2/trace-ir/field-const.h @@ -42,9 +42,9 @@ extern const bt_field_class *bt_field_borrow_class_const( extern bt_field_class_type bt_field_get_class_type( const bt_field *field); -extern int64_t bt_field_signed_integer_get_value(const bt_field *field); +extern int64_t bt_field_integer_signed_get_value(const bt_field *field); -extern uint64_t bt_field_unsigned_integer_get_value( +extern uint64_t bt_field_integer_unsigned_get_value( const bt_field *field); extern double bt_field_real_get_value(const bt_field *field); @@ -55,12 +55,12 @@ typedef enum bt_field_enumeration_get_mapping_labels_status { } bt_field_enumeration_get_mapping_labels_status; extern bt_field_enumeration_get_mapping_labels_status -bt_field_unsigned_enumeration_get_mapping_labels(const bt_field *field, +bt_field_enumeration_unsigned_get_mapping_labels(const bt_field *field, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); extern bt_field_enumeration_get_mapping_labels_status -bt_field_signed_enumeration_get_mapping_labels(const bt_field *field, +bt_field_enumeration_signed_get_mapping_labels(const bt_field *field, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); @@ -93,11 +93,11 @@ extern const bt_field_class_variant_option * bt_field_variant_borrow_selected_class_option_const( const bt_field *field); -extern const bt_field_class_variant_with_unsigned_selector_option * +extern const bt_field_class_variant_with_selector_unsigned_option * bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( const bt_field *field); -extern const bt_field_class_variant_with_signed_selector_option * +extern const bt_field_class_variant_with_selector_signed_option * bt_field_variant_with_signed_selector_borrow_selected_class_option_const( const bt_field *field); diff --git a/include/babeltrace2/trace-ir/field.h b/include/babeltrace2/trace-ir/field.h index c3b92151..75d3ca45 100644 --- a/include/babeltrace2/trace-ir/field.h +++ b/include/babeltrace2/trace-ir/field.h @@ -35,10 +35,10 @@ extern "C" { #endif -extern void bt_field_signed_integer_set_value(bt_field *field, +extern void bt_field_integer_signed_set_value(bt_field *field, int64_t value); -extern void bt_field_unsigned_integer_set_value(bt_field *field, +extern void bt_field_integer_unsigned_set_value(bt_field *field, uint64_t value); extern void bt_field_real_set_value(bt_field *field, double value); @@ -73,13 +73,13 @@ extern bt_field *bt_field_structure_borrow_member_field_by_name( extern bt_field *bt_field_array_borrow_element_field_by_index( bt_field *field, uint64_t index); -typedef enum bt_field_dynamic_array_set_length_status { +typedef enum bt_field_array_dynamic_set_length_status { BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_OK = __BT_FUNC_STATUS_OK, -} bt_field_dynamic_array_set_length_status; +} bt_field_array_dynamic_set_length_status; -extern bt_field_dynamic_array_set_length_status -bt_field_dynamic_array_set_length( +extern bt_field_array_dynamic_set_length_status +bt_field_array_dynamic_set_length( bt_field *field, uint64_t length); typedef enum bt_field_variant_select_option_field_by_index_status { diff --git a/include/babeltrace2/types.h b/include/babeltrace2/types.h index 43357d8f..afdbd454 100644 --- a/include/babeltrace2/types.h +++ b/include/babeltrace2/types.h @@ -99,12 +99,12 @@ typedef struct bt_event_header_field bt_event_header_field; typedef struct bt_field bt_field; typedef struct bt_field_class bt_field_class; typedef struct bt_field_class_enumeration_mapping bt_field_class_enumeration_mapping; -typedef struct bt_field_class_signed_enumeration_mapping bt_field_class_signed_enumeration_mapping; +typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumeration_signed_mapping; typedef struct bt_field_class_structure_member bt_field_class_structure_member; -typedef struct bt_field_class_unsigned_enumeration_mapping bt_field_class_unsigned_enumeration_mapping; +typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping; typedef struct bt_field_class_variant_option bt_field_class_variant_option; -typedef struct bt_field_class_variant_with_signed_selector_option bt_field_class_variant_with_signed_selector_option; -typedef struct bt_field_class_variant_with_unsigned_selector_option bt_field_class_variant_with_unsigned_selector_option; +typedef struct bt_field_class_variant_with_selector_signed_option bt_field_class_variant_with_selector_signed_option; +typedef struct bt_field_class_variant_with_selector_unsigned_option bt_field_class_variant_with_selector_unsigned_option; typedef struct bt_field_path bt_field_path; typedef struct bt_field_path_item bt_field_path_item; typedef struct bt_graph bt_graph; diff --git a/include/babeltrace2/value-const.h b/include/babeltrace2/value-const.h index de89d259..3ac4783d 100644 --- a/include/babeltrace2/value-const.h +++ b/include/babeltrace2/value-const.h @@ -125,9 +125,9 @@ extern bt_bool bt_value_compare(const bt_value *object_a, extern bt_bool bt_value_bool_get(const bt_value *bool_obj); -extern uint64_t bt_value_unsigned_integer_get(const bt_value *integer_obj); +extern uint64_t bt_value_integer_unsigned_get(const bt_value *integer_obj); -extern int64_t bt_value_signed_integer_get(const bt_value *integer_obj); +extern int64_t bt_value_integer_signed_get(const bt_value *integer_obj); extern double bt_value_real_get(const bt_value *real_obj); diff --git a/include/babeltrace2/value.h b/include/babeltrace2/value.h index 33cc92b3..c5e8d701 100644 --- a/include/babeltrace2/value.h +++ b/include/babeltrace2/value.h @@ -45,17 +45,17 @@ extern bt_value *bt_value_bool_create_init(bt_bool val); extern void bt_value_bool_set(bt_value *bool_obj, bt_bool val); -extern bt_value *bt_value_unsigned_integer_create(void); +extern bt_value *bt_value_integer_unsigned_create(void); -extern bt_value *bt_value_unsigned_integer_create_init(uint64_t val); +extern bt_value *bt_value_integer_unsigned_create_init(uint64_t val); -extern void bt_value_unsigned_integer_set(bt_value *integer_obj, uint64_t val); +extern void bt_value_integer_unsigned_set(bt_value *integer_obj, uint64_t val); -extern bt_value *bt_value_signed_integer_create(void); +extern bt_value *bt_value_integer_signed_create(void); -extern bt_value *bt_value_signed_integer_create_init(int64_t val); +extern bt_value *bt_value_integer_signed_create_init(int64_t val); -extern void bt_value_signed_integer_set(bt_value *integer_obj, int64_t val); +extern void bt_value_integer_signed_set(bt_value *integer_obj, int64_t val); extern bt_value *bt_value_real_create(void); diff --git a/src/bindings/python/bt2/bt2/field.py b/src/bindings/python/bt2/bt2/field.py index bb35300c..a98357f1 100644 --- a/src/bindings/python/bt2/bt2/field.py +++ b/src/bindings/python/bt2/bt2/field.py @@ -228,11 +228,11 @@ class _UnsignedIntegerField(_IntegerField, _Field): @property def _value(self): - return native_bt.field_unsigned_integer_get_value(self._ptr) + return native_bt.field_integer_unsigned_get_value(self._ptr) def _set_value(self, value): value = self._value_to_int(value) - native_bt.field_unsigned_integer_set_value(self._ptr, value) + native_bt.field_integer_unsigned_set_value(self._ptr, value) value = property(fset=_set_value) @@ -251,11 +251,11 @@ class _SignedIntegerField(_IntegerField, _Field): @property def _value(self): - return native_bt.field_signed_integer_get_value(self._ptr) + return native_bt.field_integer_signed_get_value(self._ptr) def _set_value(self, value): value = self._value_to_int(value) - native_bt.field_signed_integer_set_value(self._ptr, value) + native_bt.field_integer_signed_set_value(self._ptr, value) value = property(fset=_set_value) @@ -296,14 +296,14 @@ class _EnumerationField(_IntegerField): class _UnsignedEnumerationField(_EnumerationField, _UnsignedIntegerField): _NAME = 'Unsigned Enumeration' _get_mapping_labels = staticmethod( - native_bt.field_unsigned_enumeration_get_mapping_labels + native_bt.field_enumeration_unsigned_get_mapping_labels ) class _SignedEnumerationField(_EnumerationField, _SignedIntegerField): _NAME = 'Signed Enumeration' _get_mapping_labels = staticmethod( - native_bt.field_signed_enumeration_get_mapping_labels + native_bt.field_enumeration_signed_get_mapping_labels ) @@ -574,7 +574,7 @@ class _DynamicArrayField(_ArrayField, _Field): def _set_length(self, length): utils._check_uint64(length) - status = native_bt.field_dynamic_array_set_length(self._ptr, length) + status = native_bt.field_array_dynamic_set_length(self._ptr, length) utils._handle_func_status(status, "cannot set dynamic array length") length = property(fget=_ArrayField._get_length, fset=_set_length) diff --git a/src/bindings/python/bt2/bt2/field_class.py b/src/bindings/python/bt2/bt2/field_class.py index 1128e4df..17a150fa 100644 --- a/src/bindings/python/bt2/bt2/field_class.py +++ b/src/bindings/python/bt2/bt2/field_class.py @@ -136,20 +136,20 @@ class _EnumerationFieldClassMapping: class _UnsignedEnumerationFieldClassMapping(_EnumerationFieldClassMapping): _ranges_type = bt2.integer_range_set.UnsignedIntegerRangeSet _as_enumeration_field_class_mapping_ptr = staticmethod( - native_bt.field_class_unsigned_enumeration_mapping_as_mapping_const + native_bt.field_class_enumeration_unsigned_mapping_as_mapping_const ) _mapping_borrow_ranges_ptr = staticmethod( - native_bt.field_class_unsigned_enumeration_mapping_borrow_ranges_const + native_bt.field_class_enumeration_unsigned_mapping_borrow_ranges_const ) class _SignedEnumerationFieldClassMapping(_EnumerationFieldClassMapping): _ranges_type = bt2.integer_range_set.SignedIntegerRangeSet _as_enumeration_field_class_mapping_ptr = staticmethod( - native_bt.field_class_signed_enumeration_mapping_as_mapping_const + native_bt.field_class_enumeration_signed_mapping_as_mapping_const ) _mapping_borrow_ranges_ptr = staticmethod( - native_bt.field_class_signed_enumeration_mapping_borrow_ranges_const + native_bt.field_class_enumeration_signed_mapping_borrow_ranges_const ) @@ -204,11 +204,11 @@ class _UnsignedEnumerationFieldClass( ): _NAME = 'Unsigned enumeration' _range_set_type = bt2.integer_range_set.UnsignedIntegerRangeSet - _add_mapping = staticmethod(native_bt.field_class_unsigned_enumeration_add_mapping) + _add_mapping = staticmethod(native_bt.field_class_enumeration_unsigned_add_mapping) @staticmethod def _get_mapping_by_index(enum_ptr, index): - mapping_ptr = native_bt.field_class_unsigned_enumeration_borrow_mapping_by_index_const( + mapping_ptr = native_bt.field_class_enumeration_unsigned_borrow_mapping_by_index_const( enum_ptr, index ) assert mapping_ptr is not None @@ -216,7 +216,7 @@ class _UnsignedEnumerationFieldClass( @staticmethod def _get_mapping_by_label(enum_ptr, label): - mapping_ptr = native_bt.field_class_unsigned_enumeration_borrow_mapping_by_label_const( + mapping_ptr = native_bt.field_class_enumeration_unsigned_borrow_mapping_by_label_const( enum_ptr, label ) @@ -228,7 +228,7 @@ class _UnsignedEnumerationFieldClass( @staticmethod def _get_mapping_labels_for_value(enum_ptr, value): utils._check_uint64(value) - return native_bt.field_class_unsigned_enumeration_get_mapping_labels_for_value( + return native_bt.field_class_enumeration_unsigned_get_mapping_labels_for_value( enum_ptr, value ) @@ -236,11 +236,11 @@ class _UnsignedEnumerationFieldClass( class _SignedEnumerationFieldClass(_EnumerationFieldClass, _SignedIntegerFieldClass): _NAME = 'Signed enumeration' _range_set_type = bt2.integer_range_set.SignedIntegerRangeSet - _add_mapping = staticmethod(native_bt.field_class_signed_enumeration_add_mapping) + _add_mapping = staticmethod(native_bt.field_class_enumeration_signed_add_mapping) @staticmethod def _get_mapping_by_index(enum_ptr, index): - mapping_ptr = native_bt.field_class_signed_enumeration_borrow_mapping_by_index_const( + mapping_ptr = native_bt.field_class_enumeration_signed_borrow_mapping_by_index_const( enum_ptr, index ) assert mapping_ptr is not None @@ -248,7 +248,7 @@ class _SignedEnumerationFieldClass(_EnumerationFieldClass, _SignedIntegerFieldCl @staticmethod def _get_mapping_by_label(enum_ptr, label): - mapping_ptr = native_bt.field_class_signed_enumeration_borrow_mapping_by_label_const( + mapping_ptr = native_bt.field_class_enumeration_signed_borrow_mapping_by_label_const( enum_ptr, label ) @@ -260,7 +260,7 @@ class _SignedEnumerationFieldClass(_EnumerationFieldClass, _SignedIntegerFieldCl @staticmethod def _get_mapping_labels_for_value(enum_ptr, value): utils._check_int64(value) - return native_bt.field_class_signed_enumeration_get_mapping_labels_for_value( + return native_bt.field_class_enumeration_signed_get_mapping_labels_for_value( enum_ptr, value ) @@ -519,19 +519,19 @@ class _VariantFieldClassWithSelector(_VariantFieldClass): class _VariantFieldClassWithUnsignedSelector(_VariantFieldClassWithSelector): _NAME = 'Variant (with unsigned selector)' _borrow_option_by_name_ptr = staticmethod( - native_bt.field_class_variant_with_unsigned_selector_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_unsigned_borrow_option_by_name_const ) _borrow_member_by_index_ptr = staticmethod( - native_bt.field_class_variant_with_unsigned_selector_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_unsigned_borrow_option_by_index_const ) _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_unsigned_selector_option_as_option_const + native_bt.field_class_variant_with_selector_unsigned_option_as_option_const ) _append_option = staticmethod( - native_bt.field_class_variant_with_unsigned_selector_append_option + native_bt.field_class_variant_with_selector_unsigned_append_option ) _option_borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_unsigned_selector_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_unsigned_option_borrow_ranges_const ) _range_set_type = bt2.integer_range_set.UnsignedIntegerRangeSet @@ -539,19 +539,19 @@ class _VariantFieldClassWithUnsignedSelector(_VariantFieldClassWithSelector): class _VariantFieldClassWithSignedSelector(_VariantFieldClassWithSelector): _NAME = 'Variant (with signed selector)' _borrow_option_by_name_ptr = staticmethod( - native_bt.field_class_variant_with_signed_selector_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_signed_borrow_option_by_name_const ) _borrow_member_by_index_ptr = staticmethod( - native_bt.field_class_variant_with_signed_selector_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_signed_borrow_option_by_index_const ) _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_signed_selector_option_as_option_const + native_bt.field_class_variant_with_selector_signed_option_as_option_const ) _append_option = staticmethod( - native_bt.field_class_variant_with_signed_selector_append_option + native_bt.field_class_variant_with_selector_signed_append_option ) _option_borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_signed_selector_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_signed_option_borrow_ranges_const ) _range_set_type = bt2.integer_range_set.SignedIntegerRangeSet @@ -568,13 +568,13 @@ class _ArrayFieldClass(_FieldClass): class _StaticArrayFieldClass(_ArrayFieldClass): @property def length(self): - return native_bt.field_class_static_array_get_length(self._ptr) + return native_bt.field_class_array_static_get_length(self._ptr) class _DynamicArrayFieldClass(_ArrayFieldClass): @property def length_field_path(self): - ptr = native_bt.field_class_dynamic_array_borrow_length_field_path_const( + ptr = native_bt.field_class_array_dynamic_borrow_length_field_path_const( self._ptr ) if ptr is None: diff --git a/src/bindings/python/bt2/bt2/trace_class.py b/src/bindings/python/bt2/bt2/trace_class.py index d480b819..7e7c1797 100644 --- a/src/bindings/python/bt2/bt2/trace_class.py +++ b/src/bindings/python/bt2/bt2/trace_class.py @@ -226,7 +226,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): self, field_value_range=None, preferred_display_base=None ): return self._create_integer_field_class( - native_bt.field_class_signed_integer_create, + native_bt.field_class_integer_signed_create, bt2.field_class._SignedIntegerFieldClass, 'signed integer', field_value_range, @@ -237,7 +237,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): self, field_value_range=None, preferred_display_base=None ): return self._create_integer_field_class( - native_bt.field_class_unsigned_integer_create, + native_bt.field_class_integer_unsigned_create, bt2.field_class._UnsignedIntegerFieldClass, 'unsigned integer', field_value_range, @@ -248,7 +248,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): self, field_value_range=None, preferred_display_base=None ): return self._create_integer_field_class( - native_bt.field_class_signed_enumeration_create, + native_bt.field_class_enumeration_signed_create, bt2.field_class._SignedEnumerationFieldClass, 'signed enumeration', field_value_range, @@ -259,7 +259,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): self, field_value_range=None, preferred_display_base=None ): return self._create_integer_field_class( - native_bt.field_class_unsigned_enumeration_create, + native_bt.field_class_enumeration_unsigned_create, bt2.field_class._UnsignedEnumerationFieldClass, 'unsigned enumeration', field_value_range, @@ -291,7 +291,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): def create_static_array_field_class(self, elem_fc, length): utils._check_type(elem_fc, bt2.field_class._FieldClass) utils._check_uint64(length) - ptr = native_bt.field_class_static_array_create(self._ptr, elem_fc._ptr, length) + ptr = native_bt.field_class_array_static_create(self._ptr, elem_fc._ptr, length) self._check_create_status(ptr, 'static array') return bt2.field_class._StaticArrayFieldClass._create_from_ptr_and_get_ref(ptr) @@ -304,7 +304,7 @@ class _TraceClass(object._SharedObject, collections.abc.Mapping): utils._check_type(length_fc, bt2.field_class._UnsignedIntegerFieldClass) length_fc_ptr = length_fc._ptr - ptr = native_bt.field_class_dynamic_array_create( + ptr = native_bt.field_class_array_dynamic_create( self._ptr, elem_fc._ptr, length_fc_ptr ) self._check_create_status(ptr, 'dynamic array') diff --git a/src/bindings/python/bt2/bt2/value.py b/src/bindings/python/bt2/bt2/value.py index 3c883f76..9ba01086 100644 --- a/src/bindings/python/bt2/bt2/value.py +++ b/src/bindings/python/bt2/bt2/value.py @@ -307,18 +307,18 @@ class _IntegerValue(_IntegralValue): class UnsignedIntegerValue(_IntegerValue): _check_int_range = staticmethod(utils._check_uint64) - _create_default_value = staticmethod(native_bt.value_unsigned_integer_create) - _create_value = staticmethod(native_bt.value_unsigned_integer_create_init) - _set_value = staticmethod(native_bt.value_unsigned_integer_set) - _get_value = staticmethod(native_bt.value_unsigned_integer_get) + _create_default_value = staticmethod(native_bt.value_integer_unsigned_create) + _create_value = staticmethod(native_bt.value_integer_unsigned_create_init) + _set_value = staticmethod(native_bt.value_integer_unsigned_set) + _get_value = staticmethod(native_bt.value_integer_unsigned_get) class SignedIntegerValue(_IntegerValue): _check_int_range = staticmethod(utils._check_int64) - _create_default_value = staticmethod(native_bt.value_signed_integer_create) - _create_value = staticmethod(native_bt.value_signed_integer_create_init) - _set_value = staticmethod(native_bt.value_signed_integer_set) - _get_value = staticmethod(native_bt.value_signed_integer_get) + _create_default_value = staticmethod(native_bt.value_integer_signed_create) + _create_value = staticmethod(native_bt.value_integer_signed_create_init) + _set_value = staticmethod(native_bt.value_integer_signed_set) + _get_value = staticmethod(native_bt.value_integer_signed_get) class RealValue(_RealValue): diff --git a/src/cli/babeltrace2-cfg-cli-params-arg.c b/src/cli/babeltrace2-cfg-cli-params-arg.c index 622080a9..d69ee822 100644 --- a/src/cli/babeltrace2-cfg-cli-params-arg.c +++ b/src/cli/babeltrace2-cfg-cli-params-arg.c @@ -127,7 +127,7 @@ bt_value *ini_parse_uint(struct ini_parsing_state *state) goto end; } - value = bt_value_unsigned_integer_create_init( + value = bt_value_integer_unsigned_create_init( state->scanner->value.v_int64); end: @@ -154,7 +154,7 @@ bt_value *ini_parse_neg_number(struct ini_parsing_state *state) "Integer value -%" PRIu64 " is outside the range of a 64-bit signed integer\n", int_val); } else { - value = bt_value_signed_integer_create_init( + value = bt_value_integer_signed_create_init( -((int64_t) int_val)); } @@ -292,7 +292,7 @@ bt_value *ini_parse_value(struct ini_parsing_state *state) int_val); goto end; } else { - value = bt_value_signed_integer_create_init( + value = bt_value_integer_signed_create_init( (int64_t) int_val); } diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index eec3486a..6bdad883 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -470,13 +470,13 @@ void print_value_rec(FILE *fp, const bt_value *value, size_t indent) bt_common_color_reset()); break; case BT_VALUE_TYPE_UNSIGNED_INTEGER: - uint_val = bt_value_unsigned_integer_get(value); + uint_val = bt_value_integer_unsigned_get(value); fprintf(fp, "%s%s%" PRIu64 "%s\n", bt_common_color_bold(), bt_common_color_fg_red(), uint_val, bt_common_color_reset()); break; case BT_VALUE_TYPE_SIGNED_INTEGER: - int_val = bt_value_signed_integer_get(value); + int_val = bt_value_integer_signed_get(value); fprintf(fp, "%s%s%" PRId64 "%s\n", bt_common_color_bold(), bt_common_color_fg_red(), int_val, bt_common_color_reset()); @@ -1112,7 +1112,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg) BT_CLI_LOGE_APPEND_CAUSE("Missing `timer-us` entry."); goto error; } - timer_us = bt_value_signed_integer_get(v); + timer_us = bt_value_integer_signed_get(v); fprintf(out_stream, " (timer = %" PRIu64 ", ", timer_us); v = bt_value_map_borrow_entry_value_const(map, "stream-count"); if (!v) { @@ -1120,7 +1120,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg) "Missing `stream-count` entry."); goto error; } - streams = bt_value_signed_integer_get(v); + streams = bt_value_integer_signed_get(v); fprintf(out_stream, "%" PRIu64 " stream(s), ", streams); v = bt_value_map_borrow_entry_value_const(map, "client-count"); if (!v) { @@ -1128,7 +1128,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg) "Missing `client-count` entry."); goto error; } - clients = bt_value_signed_integer_get(v); + clients = bt_value_integer_signed_get(v); fprintf(out_stream, "%" PRIu64 " client(s) connected)\n", clients); } @@ -1988,8 +1988,8 @@ int set_stream_intersections(struct cmd_run_ctx *ctx, goto error; } - begin = bt_value_signed_integer_get(intersection_begin); - end = bt_value_signed_integer_get(intersection_end); + begin = bt_value_integer_signed_get(intersection_begin); + end = bt_value_integer_signed_get(intersection_end); if (begin < 0 || end < 0 || end < begin) { BT_CLI_LOGE_APPEND_CAUSE( diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index fe72253d..f36e3390 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -231,7 +231,7 @@ static inline void format_field_class(char **buf_ch, bool extended, } case BT_FIELD_CLASS_TYPE_STATIC_ARRAY: { - const struct bt_field_class_static_array *array_fc = + const struct bt_field_class_array_static *array_fc = (const void *) field_class; format_array_field_class(buf_ch, extended, prefix, field_class); @@ -240,7 +240,7 @@ static inline void format_field_class(char **buf_ch, bool extended, } case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY: { - const struct bt_field_class_dynamic_array *array_fc = + const struct bt_field_class_array_dynamic *array_fc = (const void *) field_class; format_array_field_class(buf_ch, extended, prefix, field_class); @@ -827,13 +827,13 @@ static inline void format_value(char **buf_ch, bool extended, case BT_VALUE_TYPE_UNSIGNED_INTEGER: { BUF_APPEND(", %svalue=%" PRIu64, - PRFIELD(bt_value_unsigned_integer_get(value))); + PRFIELD(bt_value_integer_unsigned_get(value))); break; } case BT_VALUE_TYPE_SIGNED_INTEGER: { BUF_APPEND(", %svalue=%" PRId64, - PRFIELD(bt_value_signed_integer_get(value))); + PRFIELD(bt_value_integer_signed_get(value))); break; } case BT_VALUE_TYPE_REAL: diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 4ea1d456..f1dd2395 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -109,14 +109,14 @@ end: return (void *) int_fc; } -struct bt_field_class *bt_field_class_unsigned_integer_create( +struct bt_field_class *bt_field_class_integer_unsigned_create( bt_trace_class *trace_class) { return create_integer_field_class(trace_class, BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER); } -struct bt_field_class *bt_field_class_signed_integer_create( +struct bt_field_class *bt_field_class_integer_signed_create( bt_trace_class *trace_class) { return create_integer_field_class(trace_class, @@ -269,14 +269,14 @@ end: return (void *) enum_fc; } -struct bt_field_class *bt_field_class_unsigned_enumeration_create( +struct bt_field_class *bt_field_class_enumeration_unsigned_create( bt_trace_class *trace_class) { return create_enumeration_field_class(trace_class, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION); } -struct bt_field_class *bt_field_class_signed_enumeration_create( +struct bt_field_class *bt_field_class_enumeration_signed_create( bt_trace_class *trace_class) { return create_enumeration_field_class(trace_class, @@ -293,8 +293,8 @@ uint64_t bt_field_class_enumeration_get_mapping_count( return (uint64_t) enum_fc->mappings->len; } -const struct bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( +const struct bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) { const struct bt_field_class_enumeration *enum_fc = (const void *) fc; @@ -306,8 +306,8 @@ bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index); } -const struct bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_index_const( +const struct bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) { const struct bt_field_class_enumeration *enum_fc = (const void *) fc; @@ -344,8 +344,8 @@ end: return mapping; } -const struct bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_label_const( +const struct bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -355,8 +355,8 @@ bt_field_class_signed_enumeration_borrow_mapping_by_label_const( (const void *) fc, label); } -const struct bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_label_const( +const struct bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -374,8 +374,8 @@ const char *bt_field_class_enumeration_mapping_get_label( } const struct bt_integer_range_set_unsigned * -bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( - const struct bt_field_class_unsigned_enumeration_mapping *u_mapping) +bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( + const struct bt_field_class_enumeration_unsigned_mapping *u_mapping) { const struct bt_field_class_enumeration_mapping *mapping = (const void *) u_mapping; @@ -385,8 +385,8 @@ bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( } const struct bt_integer_range_set_signed * -bt_field_class_signed_enumeration_mapping_borrow_ranges_const( - const struct bt_field_class_signed_enumeration_mapping *s_mapping) +bt_field_class_enumeration_signed_mapping_borrow_ranges_const( + const struct bt_field_class_enumeration_signed_mapping *s_mapping) { const struct bt_field_class_enumeration_mapping *mapping = (const void *) s_mapping; @@ -396,7 +396,7 @@ bt_field_class_signed_enumeration_mapping_borrow_ranges_const( } enum bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( const struct bt_field_class *fc, uint64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -436,7 +436,7 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( } enum bt_field_class_enumeration_get_mapping_labels_for_value_status -bt_field_class_signed_enumeration_get_mapping_labels_for_value( +bt_field_class_enumeration_signed_get_mapping_labels_for_value( const struct bt_field_class *fc, int64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -535,7 +535,7 @@ end: } enum bt_field_class_enumeration_add_mapping_status -bt_field_class_unsigned_enumeration_add_mapping( +bt_field_class_enumeration_unsigned_add_mapping( struct bt_field_class *fc, const char *label, const struct bt_integer_range_set_unsigned *range_set) { @@ -547,7 +547,7 @@ bt_field_class_unsigned_enumeration_add_mapping( } enum bt_field_class_enumeration_add_mapping_status -bt_field_class_signed_enumeration_add_mapping( +bt_field_class_enumeration_signed_add_mapping( struct bt_field_class *fc, const char *label, const struct bt_integer_range_set_signed *range_set) { @@ -1264,7 +1264,7 @@ end: } enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_unsigned_selector_append_option( +bt_field_class_variant_with_selector_unsigned_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_unsigned *range_set) @@ -1275,7 +1275,7 @@ bt_field_class_variant_with_unsigned_selector_append_option( } enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_signed_selector_append_option( +bt_field_class_variant_with_selector_signed_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_signed *range_set) @@ -1316,8 +1316,8 @@ bt_field_class_variant_borrow_option_by_index_const( (void *) fc, index); } -const struct bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const( +const struct bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1329,8 +1329,8 @@ bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const( (void *) fc, name); } -const struct bt_field_class_variant_with_unsigned_selector_option * -bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1342,8 +1342,8 @@ bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( (void *) fc, index); } -const struct bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_name_const( +const struct bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1355,8 +1355,8 @@ bt_field_class_variant_with_signed_selector_borrow_option_by_name_const( (void *) fc, name); } -const struct bt_field_class_variant_with_signed_selector_option * -bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); @@ -1388,8 +1388,8 @@ bt_field_class_variant_option_borrow_field_class_const( } const struct bt_integer_range_set_unsigned * -bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( - const struct bt_field_class_variant_with_unsigned_selector_option *option) +bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_unsigned_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -1399,8 +1399,8 @@ bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( } const struct bt_integer_range_set_signed * -bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( - const struct bt_field_class_variant_with_signed_selector_option *option) +bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_signed_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -1451,15 +1451,15 @@ void destroy_static_array_field_class(struct bt_object *obj) } struct bt_field_class * -bt_field_class_static_array_create(bt_trace_class *trace_class, +bt_field_class_array_static_create(bt_trace_class *trace_class, struct bt_field_class *element_fc, uint64_t length) { - struct bt_field_class_static_array *array_fc = NULL; + struct bt_field_class_array_static *array_fc = NULL; BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class"); BT_LOGD_STR("Creating default static array field class object."); - array_fc = g_new0(struct bt_field_class_static_array, 1); + array_fc = g_new0(struct bt_field_class_array_static, 1); if (!array_fc) { BT_LIB_LOGE_APPEND_CAUSE( "Failed to allocate one static array field class."); @@ -1500,9 +1500,9 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc) return array_fc->element_fc; } -uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc) +uint64_t bt_field_class_array_static_get_length(const struct bt_field_class *fc) { - const struct bt_field_class_static_array *array_fc = (const void *) fc; + const struct bt_field_class_array_static *array_fc = (const void *) fc; BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY, @@ -1513,7 +1513,7 @@ uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc) static void destroy_dynamic_array_field_class(struct bt_object *obj) { - struct bt_field_class_dynamic_array *fc = (void *) obj; + struct bt_field_class_array_dynamic *fc = (void *) obj; BT_ASSERT(fc); BT_LIB_LOGD("Destroying dynamic array field class object: %!+F", fc); @@ -1525,17 +1525,17 @@ void destroy_dynamic_array_field_class(struct bt_object *obj) g_free(fc); } -struct bt_field_class *bt_field_class_dynamic_array_create( +struct bt_field_class *bt_field_class_array_dynamic_create( struct bt_trace_class *trace_class, struct bt_field_class *element_fc, struct bt_field_class *length_fc) { - struct bt_field_class_dynamic_array *array_fc = NULL; + struct bt_field_class_array_dynamic *array_fc = NULL; BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class"); BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class"); BT_LOGD_STR("Creating default dynamic array field class object."); - array_fc = g_new0(struct bt_field_class_dynamic_array, 1); + array_fc = g_new0(struct bt_field_class_array_dynamic, 1); if (!array_fc) { BT_LIB_LOGE_APPEND_CAUSE( "Failed to allocate one dynamic array field class."); @@ -1565,10 +1565,10 @@ end: } const struct bt_field_path * -bt_field_class_dynamic_array_borrow_length_field_path_const( +bt_field_class_array_dynamic_borrow_length_field_path_const( const struct bt_field_class *fc) { - const struct bt_field_class_dynamic_array *seq_fc = (const void *) fc; + const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc; BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, diff --git a/src/lib/trace-ir/field-class.h b/src/lib/trace-ir/field-class.h index 476b86dc..e35b3965 100644 --- a/src/lib/trace-ir/field-class.h +++ b/src/lib/trace-ir/field-class.h @@ -209,8 +209,8 @@ struct bt_field_class_enumeration_mapping { const struct bt_integer_range_set *range_set; }; -struct bt_field_class_unsigned_enumeration_mapping; -struct bt_field_class_signed_enumeration_mapping; +struct bt_field_class_enumeration_unsigned_mapping; +struct bt_field_class_enumeration_signed_mapping; struct bt_field_class_enumeration { struct bt_field_class_integer common; @@ -221,9 +221,9 @@ struct bt_field_class_enumeration { /* * This is an array of `const char *` which acts as a temporary * (potentially growing) buffer for - * bt_field_class_unsigned_enumeration_get_mapping_labels_for_value() + * bt_field_class_enumeration_unsigned_get_mapping_labels_for_value() * and - * bt_field_class_signed_enumeration_get_mapping_labels_for_value(). + * bt_field_class_enumeration_signed_get_mapping_labels_for_value(). * * The actual strings are owned by the mappings above. */ @@ -251,8 +251,8 @@ struct bt_named_field_class { struct bt_field_class_structure_member; struct bt_field_class_variant_option; -struct bt_field_class_variant_with_unsigned_selector_option; -struct bt_field_class_variant_with_signed_selector_option; +struct bt_field_class_variant_with_selector_unsigned_option; +struct bt_field_class_variant_with_selector_signed_option; struct bt_field_class_named_field_class_container { struct bt_field_class common; @@ -278,12 +278,12 @@ struct bt_field_class_array { struct bt_field_class *element_fc; }; -struct bt_field_class_static_array { +struct bt_field_class_array_static { struct bt_field_class_array common; uint64_t length; }; -struct bt_field_class_dynamic_array { +struct bt_field_class_array_dynamic { struct bt_field_class_array common; /* Weak: never dereferenced, only use to find it elsewhere */ diff --git a/src/lib/trace-ir/field.c b/src/lib/trace-ir/field.c index b0a5b532..e200c153 100644 --- a/src/lib/trace-ir/field.c +++ b/src/lib/trace-ir/field.c @@ -439,7 +439,7 @@ end: static struct bt_field *create_static_array_field(struct bt_field_class *fc) { - struct bt_field_class_static_array *array_fc = (void *) fc; + struct bt_field_class_array_static *array_fc = (void *) fc; struct bt_field_array *array_field; BT_LIB_LOGD("Creating static array field object: %![fc-]+F", fc); @@ -494,7 +494,7 @@ end: return (void *) array_field; } -int64_t bt_field_signed_integer_get_value(const struct bt_field *field) +int64_t bt_field_integer_signed_get_value(const struct bt_field *field) { const struct bt_field_integer *int_field = (const void *) field; @@ -504,7 +504,7 @@ int64_t bt_field_signed_integer_get_value(const struct bt_field *field) return int_field->value.i; } -void bt_field_signed_integer_set_value(struct bt_field *field, int64_t value) +void bt_field_integer_signed_set_value(struct bt_field *field, int64_t value) { struct bt_field_integer *int_field = (void *) field; @@ -519,7 +519,7 @@ void bt_field_signed_integer_set_value(struct bt_field *field, int64_t value) bt_field_set_single(field, true); } -uint64_t bt_field_unsigned_integer_get_value(const struct bt_field *field) +uint64_t bt_field_integer_unsigned_get_value(const struct bt_field *field) { const struct bt_field_integer *int_field = (const void *) field; @@ -529,7 +529,7 @@ uint64_t bt_field_unsigned_integer_get_value(const struct bt_field *field) return int_field->value.u; } -void bt_field_unsigned_integer_set_value(struct bt_field *field, uint64_t value) +void bt_field_integer_unsigned_set_value(struct bt_field *field, uint64_t value) { struct bt_field_integer *int_field = (void *) field; @@ -571,7 +571,7 @@ void bt_field_real_set_value(struct bt_field *field, double value) } enum bt_field_enumeration_get_mapping_labels_status -bt_field_unsigned_enumeration_get_mapping_labels( +bt_field_enumeration_unsigned_get_mapping_labels( const struct bt_field *field, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -585,12 +585,12 @@ bt_field_unsigned_enumeration_get_mapping_labels( BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field"); return (int) - bt_field_class_unsigned_enumeration_get_mapping_labels_for_value( + bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( field->class, int_field->value.u, label_array, count); } enum bt_field_enumeration_get_mapping_labels_status -bt_field_signed_enumeration_get_mapping_labels( +bt_field_enumeration_signed_get_mapping_labels( const struct bt_field *field, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count) @@ -604,7 +604,7 @@ bt_field_signed_enumeration_get_mapping_labels( BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field"); return (int) - bt_field_class_signed_enumeration_get_mapping_labels_for_value( + bt_field_class_enumeration_signed_get_mapping_labels_for_value( field->class, int_field->value.i, label_array, count); } @@ -710,7 +710,7 @@ uint64_t bt_field_array_get_length(const struct bt_field *field) return array_field->length; } -enum bt_field_dynamic_array_set_length_status bt_field_dynamic_array_set_length( +enum bt_field_array_dynamic_set_length_status bt_field_array_dynamic_set_length( struct bt_field *field, uint64_t length) { int ret = BT_FUNC_STATUS_OK; @@ -897,7 +897,7 @@ bt_field_variant_borrow_selected_class_option_const( return borrow_variant_field_selected_class_option(field); } -const struct bt_field_class_variant_with_unsigned_selector_option * +const struct bt_field_class_variant_with_selector_unsigned_option * bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( const struct bt_field *field) { @@ -907,7 +907,7 @@ bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( return (const void *) borrow_variant_field_selected_class_option(field); } -const struct bt_field_class_variant_with_signed_selector_option * +const struct bt_field_class_variant_with_selector_signed_option * bt_field_variant_with_signed_selector_borrow_selected_class_option_const( const struct bt_field *field) { diff --git a/src/lib/trace-ir/resolve-field-path.c b/src/lib/trace-ir/resolve-field-path.c index 610e9cc0..59910bdc 100644 --- a/src/lib/trace-ir/resolve-field-path.c +++ b/src/lib/trace-ir/resolve-field-path.c @@ -529,7 +529,7 @@ int bt_resolve_field_paths(struct bt_field_class *fc, switch (fc->type) { case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY: { - struct bt_field_class_dynamic_array *dyn_array_fc = (void *) fc; + struct bt_field_class_array_dynamic *dyn_array_fc = (void *) fc; if (dyn_array_fc->length_fc) { BT_ASSERT(!dyn_array_fc->length_field_path); diff --git a/src/lib/trace-ir/trace.c b/src/lib/trace-ir/trace.c index 1085d890..e884c72a 100644 --- a/src/lib/trace-ir/trace.c +++ b/src/lib/trace-ir/trace.c @@ -305,7 +305,7 @@ bt_trace_set_environment_entry_integer( struct bt_value *value_obj; BT_ASSERT_PRE_NON_NULL(trace, "Trace"); BT_ASSERT_PRE_NON_NULL(name, "Name"); - value_obj = bt_value_signed_integer_create_init(value); + value_obj = bt_value_integer_signed_create_init(value); if (!value_obj) { BT_LIB_LOGE_APPEND_CAUSE( "Cannot create an integer value object."); diff --git a/src/lib/value.c b/src/lib/value.c index 0fdb060d..183d2081 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -643,26 +643,26 @@ end: return (void *) integer_obj; } -struct bt_value *bt_value_unsigned_integer_create_init(uint64_t val) +struct bt_value *bt_value_integer_unsigned_create_init(uint64_t val) { return bt_value_integer_create_init(BT_VALUE_TYPE_UNSIGNED_INTEGER, val); } -struct bt_value *bt_value_unsigned_integer_create(void) +struct bt_value *bt_value_integer_unsigned_create(void) { - return bt_value_unsigned_integer_create_init(0); + return bt_value_integer_unsigned_create_init(0); } -struct bt_value *bt_value_signed_integer_create_init(int64_t val) +struct bt_value *bt_value_integer_signed_create_init(int64_t val) { return bt_value_integer_create_init(BT_VALUE_TYPE_SIGNED_INTEGER, (uint64_t) val); } -struct bt_value *bt_value_signed_integer_create(void) +struct bt_value *bt_value_integer_signed_create(void) { - return bt_value_signed_integer_create_init(0); + return bt_value_integer_signed_create_init(0); } struct bt_value *bt_value_real_create_init(double val) @@ -800,7 +800,7 @@ void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val) bool_obj, val); } -uint64_t bt_value_unsigned_integer_get(const struct bt_value *integer_obj) +uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj) { BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object"); BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(integer_obj, @@ -808,7 +808,7 @@ uint64_t bt_value_unsigned_integer_get(const struct bt_value *integer_obj) return BT_VALUE_TO_INTEGER(integer_obj)->value.u; } -int64_t bt_value_signed_integer_get(const struct bt_value *integer_obj) +int64_t bt_value_integer_signed_get(const struct bt_value *integer_obj) { BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object"); BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(integer_obj, @@ -826,7 +826,7 @@ void bt_value_integer_set(struct bt_value *integer_obj, BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval; } -void bt_value_unsigned_integer_set(struct bt_value *integer_obj, +void bt_value_integer_unsigned_set(struct bt_value *integer_obj, uint64_t val) { bt_value_integer_set(integer_obj, BT_VALUE_TYPE_UNSIGNED_INTEGER, val); @@ -834,7 +834,7 @@ void bt_value_unsigned_integer_set(struct bt_value *integer_obj, "value-addr=%p, value=%" PRIu64, integer_obj, val); } -void bt_value_signed_integer_set(struct bt_value *integer_obj, +void bt_value_integer_signed_set(struct bt_value *integer_obj, int64_t val) { bt_value_integer_set(integer_obj, BT_VALUE_TYPE_SIGNED_INTEGER, @@ -945,7 +945,7 @@ bt_value_array_append_unsigned_integer_element(struct bt_value *array_obj, enum bt_value_array_append_element_status ret; struct bt_value *integer_obj = NULL; - integer_obj = bt_value_unsigned_integer_create_init(val); + integer_obj = bt_value_integer_unsigned_create_init(val); ret = bt_value_array_append_element(array_obj, (void *) integer_obj); bt_object_put_ref(integer_obj); @@ -959,7 +959,7 @@ bt_value_array_append_signed_integer_element(struct bt_value *array_obj, enum bt_value_array_append_element_status ret; struct bt_value *integer_obj = NULL; - integer_obj = bt_value_signed_integer_create_init(val); + integer_obj = bt_value_integer_signed_create_init(val); ret = bt_value_array_append_element(array_obj, (void *) integer_obj); bt_object_put_ref(integer_obj); @@ -1110,7 +1110,7 @@ bt_value_map_insert_unsigned_integer_entry(struct bt_value *map_obj, enum bt_value_map_insert_entry_status ret; struct bt_value *integer_obj = NULL; - integer_obj = bt_value_unsigned_integer_create_init(val); + integer_obj = bt_value_integer_unsigned_create_init(val); ret = bt_value_map_insert_entry(map_obj, key, (void *) integer_obj); bt_object_put_ref(integer_obj); @@ -1124,7 +1124,7 @@ bt_value_map_insert_signed_integer_entry(struct bt_value *map_obj, enum bt_value_map_insert_entry_status ret; struct bt_value *integer_obj = NULL; - integer_obj = bt_value_signed_integer_create_init(val); + integer_obj = bt_value_integer_signed_create_init(val); ret = bt_value_map_insert_entry(map_obj, key, (void *) integer_obj); bt_object_put_ref(integer_obj); diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.c b/src/plugins/ctf/common/metadata/ctf-meta-translate.c index c53fc17a..c79e0d94 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.c +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.c @@ -53,9 +53,9 @@ bt_field_class *ctf_field_class_int_to_ir(struct ctx *ctx, bt_field_class *ir_fc; if (fc->is_signed) { - ir_fc = bt_field_class_signed_integer_create(ctx->ir_tc); + ir_fc = bt_field_class_integer_signed_create(ctx->ir_tc); } else { - ir_fc = bt_field_class_unsigned_integer_create(ctx->ir_tc); + ir_fc = bt_field_class_integer_unsigned_create(ctx->ir_tc); } BT_ASSERT(ir_fc); @@ -72,9 +72,9 @@ bt_field_class *ctf_field_class_enum_to_ir(struct ctx *ctx, uint64_t i; if (fc->base.is_signed) { - ir_fc = bt_field_class_signed_enumeration_create(ctx->ir_tc); + ir_fc = bt_field_class_enumeration_signed_create(ctx->ir_tc); } else { - ir_fc = bt_field_class_unsigned_enumeration_create(ctx->ir_tc); + ir_fc = bt_field_class_enumeration_unsigned_create(ctx->ir_tc); } BT_ASSERT(ir_fc); @@ -113,11 +113,11 @@ bt_field_class *ctf_field_class_enum_to_ir(struct ctx *ctx, } if (fc->base.is_signed) { - ret = bt_field_class_signed_enumeration_add_mapping( + ret = bt_field_class_enumeration_signed_add_mapping( ir_fc, mapping->label->str, range_set); BT_RANGE_SET_SIGNED_PUT_REF_AND_RESET(range_set); } else { - ret = bt_field_class_unsigned_enumeration_add_mapping( + ret = bt_field_class_enumeration_unsigned_add_mapping( ir_fc, mapping->label->str, range_set); BT_RANGE_SET_UNSIGNED_PUT_REF_AND_RESET(range_set); } @@ -224,17 +224,17 @@ const void *find_ir_enum_field_class_mapping_by_label(const bt_field_class *fc, if (is_signed) { spec_this_mapping = - bt_field_class_signed_enumeration_borrow_mapping_by_index_const( + bt_field_class_enumeration_signed_borrow_mapping_by_index_const( fc, i); this_mapping = - bt_field_class_signed_enumeration_mapping_as_mapping_const( + bt_field_class_enumeration_signed_mapping_as_mapping_const( spec_this_mapping); } else { spec_this_mapping = - bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( + bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( fc, i); this_mapping = - bt_field_class_unsigned_enumeration_mapping_as_mapping_const( + bt_field_class_enumeration_unsigned_mapping_as_mapping_const( spec_this_mapping); } @@ -292,7 +292,7 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, * mapping name. */ if (fc->tag_fc->base.is_signed) { - const bt_field_class_signed_enumeration_mapping *mapping = + const bt_field_class_enumeration_signed_mapping *mapping = find_ir_enum_field_class_mapping_by_label( ir_tag_fc, named_fc->orig_name->str, true); @@ -300,14 +300,14 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, BT_ASSERT(mapping); range_set = - bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + bt_field_class_enumeration_signed_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_signed_selector_append_option( + ret = bt_field_class_variant_with_selector_signed_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } else { - const bt_field_class_unsigned_enumeration_mapping *mapping = + const bt_field_class_enumeration_unsigned_mapping *mapping = find_ir_enum_field_class_mapping_by_label( ir_tag_fc, named_fc->orig_name->str, @@ -316,10 +316,10 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, BT_ASSERT(mapping); range_set = - bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_unsigned_selector_append_option( + ret = bt_field_class_variant_with_selector_unsigned_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } @@ -350,7 +350,7 @@ bt_field_class *ctf_field_class_array_to_ir(struct ctx *ctx, elem_ir_fc = ctf_field_class_to_ir(ctx, fc->base.elem_fc); BT_ASSERT(elem_ir_fc); - ir_fc = bt_field_class_static_array_create(ctx->ir_tc, elem_ir_fc, + ir_fc = bt_field_class_array_static_create(ctx->ir_tc, elem_ir_fc, fc->length); BT_ASSERT(ir_fc); bt_field_class_put_ref(elem_ir_fc); @@ -382,7 +382,7 @@ bt_field_class *ctf_field_class_sequence_to_ir(struct ctx *ctx, BT_ASSERT(length_fc); } - ir_fc = bt_field_class_dynamic_array_create(ctx->ir_tc, elem_ir_fc, + ir_fc = bt_field_class_array_dynamic_create(ctx->ir_tc, elem_ir_fc, length_fc); BT_ASSERT(ir_fc); bt_field_class_put_ref(elem_ir_fc); diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.c b/src/plugins/ctf/common/msg-iter/msg-iter.c index 12fc7885..5c681aac 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.c +++ b/src/plugins/ctf/common/msg-iter/msg-iter.c @@ -1972,7 +1972,7 @@ update_def_clock: BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION); - bt_field_unsigned_integer_set_value(field, value); + bt_field_integer_unsigned_set_value(field, value); stack_top(notit->stack)->index++; end: @@ -2061,7 +2061,7 @@ enum bt_bfcr_status bfcr_signed_int_cb(int64_t value, BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION); - bt_field_signed_integer_set_value(field, value); + bt_field_integer_signed_set_value(field, value); stack_top(notit->stack)->index++; end: @@ -2313,7 +2313,7 @@ int64_t bfcr_get_sequence_length_cb(struct ctf_field_class *fc, void *data) if (!seq_fc->base.is_text) { BT_ASSERT(bt_field_get_class_type(seq_field) == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY); - ret = bt_field_dynamic_array_set_length(seq_field, + ret = bt_field_array_dynamic_set_length(seq_field, (uint64_t) length); if (ret) { BT_COMP_LOGE("Cannot set dynamic array field's length field: " diff --git a/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h b/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h index 19912afb..ff73eb5e 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h +++ b/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h @@ -327,7 +327,7 @@ struct fs_sink_ctf_field_class_array *fs_sink_ctf_field_class_array_create_empty _fs_sink_ctf_field_class_init((void *) fc, FS_SINK_CTF_FIELD_CLASS_TYPE_ARRAY, ir_fc, 1, index_in_parent); - fc->length = bt_field_class_static_array_get_length(ir_fc); + fc->length = bt_field_class_array_static_get_length(ir_fc); return fc; } @@ -345,7 +345,7 @@ struct fs_sink_ctf_field_class_sequence *fs_sink_ctf_field_class_sequence_create fc->length_ref = g_string_new(NULL); BT_ASSERT(fc->length_ref); fc->length_is_before = - bt_field_class_dynamic_array_borrow_length_field_path_const(ir_fc) == + bt_field_class_array_dynamic_borrow_length_field_path_const(ir_fc) == NULL; return fc; } diff --git a/src/plugins/ctf/fs-sink/fs-sink-stream.c b/src/plugins/ctf/fs-sink/fs-sink-stream.c index 4ca9ce10..a8628998 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-stream.c +++ b/src/plugins/ctf/fs-sink/fs-sink-stream.c @@ -206,11 +206,11 @@ int write_int_field(struct fs_sink_stream *stream, if (fc->is_signed) { ret = bt_ctfser_write_signed_int(&stream->ctfser, - bt_field_signed_integer_get_value(field), + bt_field_integer_signed_get_value(field), fc->base.base.alignment, fc->base.size, BYTE_ORDER); } else { ret = bt_ctfser_write_unsigned_int(&stream->ctfser, - bt_field_unsigned_integer_get_value(field), + bt_field_integer_unsigned_get_value(field), fc->base.base.alignment, fc->base.size, BYTE_ORDER); } diff --git a/src/plugins/ctf/fs-sink/fs-sink-trace.c b/src/plugins/ctf/fs-sink/fs-sink-trace.c index d97816df..e2be329b 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-trace.c +++ b/src/plugins/ctf/fs-sink/fs-sink-trace.c @@ -176,7 +176,7 @@ int append_lttng_trace_path_ust_uid(const struct fs_sink_trace *trace, } g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRId64, - bt_value_signed_integer_get(v)); + bt_value_integer_signed_get(v)); v = bt_trace_borrow_environment_entry_value_by_name_const(tc, "isa_length"); if (!v || !bt_value_is_signed_integer(v)) { @@ -185,7 +185,7 @@ int append_lttng_trace_path_ust_uid(const struct fs_sink_trace *trace, } g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRIu64 "-bit", - bt_value_signed_integer_get(v)); + bt_value_integer_signed_get(v)); ret = 0; goto end; @@ -219,7 +219,7 @@ int append_lttng_trace_path_ust_pid(const struct fs_sink_trace *trace, goto error; } - g_string_append_printf(path, "-%" PRId64, bt_value_signed_integer_get(v)); + g_string_append_printf(path, "-%" PRId64, bt_value_integer_signed_get(v)); v = bt_trace_borrow_environment_entry_value_by_name_const(tc, "vpid_datetime"); if (!v || !bt_value_is_string(v)) { @@ -284,7 +284,7 @@ GString *make_lttng_trace_path_rel(const struct fs_sink_trace *trace) goto error; } - tracer_major = bt_value_signed_integer_get(v); + tracer_major = bt_value_integer_signed_get(v); v = bt_trace_borrow_environment_entry_value_by_name_const( trace->ir_trace, "tracer_minor"); @@ -293,7 +293,7 @@ GString *make_lttng_trace_path_rel(const struct fs_sink_trace *trace) goto error; } - tracer_minor = bt_value_signed_integer_get(v); + tracer_minor = bt_value_integer_signed_get(v); if (!(tracer_major >= 3 || (tracer_major == 2 && tracer_minor >= 11))) { BT_COMP_LOGI("Unsupported LTTng version for automatic trace path: major=%" PRId64 ", minor=%" PRId64, diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c index f867edbf..fd0d10f2 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c @@ -210,8 +210,8 @@ void append_integer_field_class(struct ctx *ctx, for (i = 0; i < bt_field_class_enumeration_get_mapping_count(ir_fc); i++) { const char *label; const bt_field_class_enumeration_mapping *mapping; - const bt_field_class_unsigned_enumeration_mapping *u_mapping; - const bt_field_class_signed_enumeration_mapping *s_mapping; + const bt_field_class_enumeration_unsigned_mapping *u_mapping; + const bt_field_class_enumeration_signed_mapping *s_mapping; const bt_integer_range_set *ranges; const bt_integer_range_set_unsigned *u_ranges; const bt_integer_range_set_signed *s_ranges; @@ -219,20 +219,20 @@ void append_integer_field_class(struct ctx *ctx, uint64_t range_i; if (is_signed) { - s_mapping = bt_field_class_signed_enumeration_borrow_mapping_by_index_const( + s_mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const( ir_fc, i); - mapping = bt_field_class_signed_enumeration_mapping_as_mapping_const( + mapping = bt_field_class_enumeration_signed_mapping_as_mapping_const( s_mapping); - s_ranges = bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + s_ranges = bt_field_class_enumeration_signed_mapping_borrow_ranges_const( s_mapping); ranges = bt_integer_range_set_signed_as_range_set_const( s_ranges); } else { - u_mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( + u_mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( ir_fc, i); - mapping = bt_field_class_unsigned_enumeration_mapping_as_mapping_const( + mapping = bt_field_class_enumeration_unsigned_mapping_as_mapping_const( u_mapping); - u_ranges = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + u_ranges = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( u_mapping); ranges = bt_integer_range_set_unsigned_as_range_set_const( u_ranges); @@ -862,7 +862,7 @@ void translate_trace_ctf_ir_to_tsdl(struct fs_sink_ctf_trace *trace, switch (bt_value_get_type(val)) { case BT_VALUE_TYPE_SIGNED_INTEGER: g_string_append_printf(tsdl, "%" PRId64, - bt_value_signed_integer_get(val)); + bt_value_integer_signed_get(val)); break; case BT_VALUE_TYPE_STRING: append_quoted_string(&ctx, bt_value_string_get(val)); diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index c7be897e..4b20ddea 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -762,23 +762,23 @@ bool _is_variant_field_class_tag_valid( g_string_append(escaped_opt_name, opt_name); if (ir_tag_fc_type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) { - const bt_field_class_variant_with_unsigned_selector_option *var_opt = - bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_unsigned_option *var_opt = + bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( fc->base.ir_fc, i); - const bt_field_class_unsigned_enumeration_mapping *mapping; + const bt_field_class_enumeration_unsigned_mapping *mapping; const bt_integer_range_set_unsigned *opt_ranges; const bt_integer_range_set_unsigned *mapping_ranges; - mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_label_const( + mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( tag_fc->ir_fc, escaped_opt_name->str); if (!mapping) { is_valid = false; goto end; } - opt_ranges = bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( + opt_ranges = bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( var_opt); - mapping_ranges = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + mapping_ranges = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( mapping); if (!bt_integer_range_set_unsigned_compare(opt_ranges, mapping_ranges)) { @@ -786,23 +786,23 @@ bool _is_variant_field_class_tag_valid( goto end; } } else { - const bt_field_class_variant_with_signed_selector_option *var_opt = - bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_signed_option *var_opt = + bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( fc->base.ir_fc, i); - const bt_field_class_signed_enumeration_mapping *mapping; + const bt_field_class_enumeration_signed_mapping *mapping; const bt_integer_range_set_signed *opt_ranges; const bt_integer_range_set_signed *mapping_ranges; - mapping = bt_field_class_signed_enumeration_borrow_mapping_by_label_const( + mapping = bt_field_class_enumeration_signed_borrow_mapping_by_label_const( tag_fc->ir_fc, escaped_opt_name->str); if (!mapping) { is_valid = false; goto end; } - opt_ranges = bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( + opt_ranges = bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( var_opt); - mapping_ranges = bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + mapping_ranges = bt_field_class_enumeration_signed_mapping_borrow_ranges_const( mapping); if (!bt_integer_range_set_signed_compare(opt_ranges, mapping_ranges)) { @@ -925,18 +925,18 @@ int must_protect_variant_option_name(const bt_field_class *ir_var_fc, /* No ranges: we're done */ goto end; } if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_unsigned_selector_option *var_opt = - bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_unsigned_option *var_opt = + bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( ir_var_fc, opt_i); opt_ranges = - bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( var_opt); } else { - const bt_field_class_variant_with_signed_selector_option *var_opt = - bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_signed_option *var_opt = + bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( ir_var_fc, opt_i); opt_ranges = - bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( var_opt); } @@ -945,19 +945,19 @@ int must_protect_variant_option_name(const bt_field_class *ir_var_fc, i++) { if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { const bt_field_class_enumeration_mapping *mapping_base; - const bt_field_class_unsigned_enumeration_mapping *mapping; + const bt_field_class_enumeration_unsigned_mapping *mapping; const bt_integer_range_set_unsigned *mapping_ranges; - mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( + mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( ir_tag_fc, i); - mapping_ranges = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + mapping_ranges = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( mapping); if (bt_integer_range_set_unsigned_compare(opt_ranges, mapping_ranges)) { /* We have a winner */ mapping_base = - bt_field_class_unsigned_enumeration_mapping_as_mapping_const( + bt_field_class_enumeration_unsigned_mapping_as_mapping_const( mapping); mapping_label = bt_field_class_enumeration_mapping_get_label( @@ -966,19 +966,19 @@ int must_protect_variant_option_name(const bt_field_class *ir_var_fc, } } else { const bt_field_class_enumeration_mapping *mapping_base; - const bt_field_class_signed_enumeration_mapping *mapping; + const bt_field_class_enumeration_signed_mapping *mapping; const bt_integer_range_set_signed *mapping_ranges; - mapping = bt_field_class_signed_enumeration_borrow_mapping_by_index_const( + mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const( ir_tag_fc, i); - mapping_ranges = bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + mapping_ranges = bt_field_class_enumeration_signed_mapping_borrow_ranges_const( mapping); if (bt_integer_range_set_signed_compare(opt_ranges, mapping_ranges)) { /* We have a winner */ mapping_base = - bt_field_class_signed_enumeration_mapping_as_mapping_const( + bt_field_class_enumeration_signed_mapping_as_mapping_const( mapping); mapping_label = bt_field_class_enumeration_mapping_get_label( @@ -1254,7 +1254,7 @@ int translate_dynamic_array_field_class(struct ctx *ctx) /* Resolve length field class before appending to parent */ resolve_field_class(ctx, - bt_field_class_dynamic_array_borrow_length_field_path_const( + bt_field_class_array_dynamic_borrow_length_field_path_const( fc->base.base.ir_fc), fc->length_ref, &fc->length_is_before, NULL); diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index d9493e66..57384014 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -1891,7 +1891,7 @@ bool read_src_fs_parameters(const bt_value *params, goto error; } ctf_fs->metadata_config.clock_class_offset_s = - bt_value_signed_integer_get(value); + bt_value_integer_signed_get(value); } /* clock-class-offset-ns parameter */ @@ -1903,7 +1903,7 @@ bool read_src_fs_parameters(const bt_value *params, goto error; } ctf_fs->metadata_config.clock_class_offset_ns = - bt_value_signed_integer_get(value); + bt_value_integer_signed_get(value); } diff --git a/src/plugins/ctf/lttng-live/viewer-connection.c b/src/plugins/ctf/lttng-live/viewer-connection.c index 65433896..44e80cc0 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.c +++ b/src/plugins/ctf/lttng-live/viewer-connection.c @@ -361,10 +361,10 @@ int list_update_session(bt_value *results, ret = -1; goto end; } - val = bt_value_signed_integer_get(btval); + val = bt_value_integer_signed_get(btval); /* sum */ val += streams; - bt_value_signed_integer_set(btval, val); + bt_value_integer_signed_set(btval, val); btval = bt_value_map_borrow_entry_value(map, "client-count"); if (!btval) { @@ -372,10 +372,10 @@ int list_update_session(bt_value *results, ret = -1; goto end; } - val = bt_value_signed_integer_get(btval); + val = bt_value_integer_signed_get(btval); /* max */ val = bt_max_t(int64_t, clients, val); - bt_value_signed_integer_set(btval, val); + bt_value_integer_signed_set(btval, val); } if (found) { diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index 75eb0175..f330f1be 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -363,7 +363,7 @@ static inline void event_get_common_context_signed_integer_field_value( const bt_event *event, const char *field_name, int64_t *value) { - *value = bt_field_signed_integer_get_value( + *value = bt_field_integer_signed_get_value( event_borrow_common_context_field(event, field_name)); } @@ -417,7 +417,7 @@ int event_get_payload_build_id_value(const bt_event *event, bt_field_array_borrow_element_field_by_index_const( build_id_field, i); - build_id[i] = bt_field_unsigned_integer_get_value(curr_field); + build_id[i] = bt_field_integer_unsigned_get_value(curr_field); } return ret; @@ -427,7 +427,7 @@ static void event_get_payload_unsigned_integer_field_value(const bt_event *event, const char *field_name, uint64_t *value) { - *value = bt_field_unsigned_integer_get_value( + *value = bt_field_integer_unsigned_get_value( event_borrow_payload_field(event, field_name)); } @@ -1195,8 +1195,8 @@ void fill_debug_info_event_if_needed(struct debug_info_msg_iter *debug_it, ip_field = bt_field_structure_borrow_member_field_by_name_const( out_common_ctx_field, IP_FIELD_NAME); - vpid = bt_field_signed_integer_get_value(vpid_field); - ip = bt_field_unsigned_integer_get_value(ip_field); + vpid = bt_field_integer_signed_get_value(vpid_field); + ip = bt_field_integer_unsigned_get_value(ip_field); /* * Borrow the debug_info structure needed for the source diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c index 5acad418..274c3170 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c @@ -86,7 +86,7 @@ void copy_trace_content(const bt_trace *in_trace, bt_trace *out_trace, set_env_status = bt_trace_set_environment_entry_integer( out_trace, value_name, - bt_value_signed_integer_get( + bt_value_integer_signed_get( value)); } else if (bt_value_is_string(value)) { set_env_status = @@ -221,13 +221,13 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field, switch (in_fc_type) { case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: - bt_field_unsigned_integer_set_value(out_field, - bt_field_unsigned_integer_get_value(in_field)); + bt_field_integer_unsigned_set_value(out_field, + bt_field_integer_unsigned_get_value(in_field)); break; case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: - bt_field_signed_integer_set_value(out_field, - bt_field_signed_integer_get_value(in_field)); + bt_field_integer_signed_set_value(out_field, + bt_field_integer_signed_get_value(in_field)); break; case BT_FIELD_CLASS_TYPE_REAL: bt_field_real_set_value(out_field, @@ -291,12 +291,12 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field, const bt_field *in_element_field; bt_field *out_element_field; uint64_t i, array_len; - bt_field_dynamic_array_set_length_status set_len_status; + bt_field_array_dynamic_set_length_status set_len_status; array_len = bt_field_array_get_length(in_field); if (in_fc_type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY) { - set_len_status = bt_field_dynamic_array_set_length( + set_len_status = bt_field_array_dynamic_set_length( out_field, array_len); if (set_len_status != BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_OK) { diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c index 0cba13cb..4d31bec8 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c @@ -210,17 +210,17 @@ int field_class_unsigned_enumeration_copy( for (i = 0; i < enum_mapping_count; i++) { const char *label; const bt_integer_range_set_unsigned *range_set; - const bt_field_class_unsigned_enumeration_mapping *u_mapping; + const bt_field_class_enumeration_unsigned_mapping *u_mapping; const bt_field_class_enumeration_mapping *mapping; - u_mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( + u_mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( in_field_class, i); - mapping = bt_field_class_unsigned_enumeration_mapping_as_mapping_const( + mapping = bt_field_class_enumeration_unsigned_mapping_as_mapping_const( u_mapping); label = bt_field_class_enumeration_mapping_get_label(mapping); - range_set = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + range_set = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( u_mapping); - ret = bt_field_class_unsigned_enumeration_add_mapping( + ret = bt_field_class_enumeration_unsigned_add_mapping( out_field_class, label, range_set); if (ret) { goto error; @@ -257,17 +257,17 @@ int field_class_signed_enumeration_copy( for (i = 0; i < enum_mapping_count; i++) { const char *label; const bt_integer_range_set_signed *range_set; - const bt_field_class_signed_enumeration_mapping *s_mapping; + const bt_field_class_enumeration_signed_mapping *s_mapping; const bt_field_class_enumeration_mapping *mapping; - s_mapping = bt_field_class_signed_enumeration_borrow_mapping_by_index_const( + s_mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const( in_field_class, i); - mapping = bt_field_class_signed_enumeration_mapping_as_mapping_const( + mapping = bt_field_class_enumeration_signed_mapping_as_mapping_const( s_mapping); label = bt_field_class_enumeration_mapping_get_label(mapping); - range_set = bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + range_set = bt_field_class_enumeration_signed_mapping_borrow_ranges_const( s_mapping); - ret = bt_field_class_signed_enumeration_add_mapping( + ret = bt_field_class_enumeration_signed_add_mapping( out_field_class, label, range_set); if (ret) { goto error; @@ -413,14 +413,14 @@ int field_class_variant_copy( } if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_unsigned_selector_option *spec_opt = - bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_unsigned_option *spec_opt = + bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( in_field_class, i); const bt_integer_range_set_unsigned *ranges = - bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( spec_opt); - if (bt_field_class_variant_with_unsigned_selector_append_option( + if (bt_field_class_variant_with_selector_unsigned_append_option( out_field_class, option_name, out_option_field_class, ranges) != BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK) { @@ -430,14 +430,14 @@ int field_class_variant_copy( goto error; } } else if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { - const bt_field_class_variant_with_signed_selector_option *spec_opt = - bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_signed_option *spec_opt = + bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( in_field_class, i); const bt_integer_range_set_signed *ranges = - bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( spec_opt); - if (bt_field_class_variant_with_signed_selector_append_option( + if (bt_field_class_variant_with_selector_signed_append_option( out_field_class, option_name, out_option_field_class, ranges) != BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK) { @@ -562,19 +562,19 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * switch (fc_type) { case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: - out_field_class = bt_field_class_unsigned_integer_create( + out_field_class = bt_field_class_integer_unsigned_create( md_maps->output_trace_class); break; case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: - out_field_class = bt_field_class_signed_integer_create( + out_field_class = bt_field_class_integer_signed_create( md_maps->output_trace_class); break; case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: - out_field_class = bt_field_class_unsigned_enumeration_create( + out_field_class = bt_field_class_enumeration_unsigned_create( md_maps->output_trace_class); break; case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: - out_field_class = bt_field_class_signed_enumeration_create( + out_field_class = bt_field_class_enumeration_signed_create( md_maps->output_trace_class); break; case BT_FIELD_CLASS_TYPE_REAL: @@ -595,7 +595,7 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * bt_field_class_array_borrow_element_field_class_const( in_field_class); uint64_t array_len = - bt_field_class_static_array_get_length(in_field_class); + bt_field_class_array_static_get_length(in_field_class); bt_field_class *out_elem_fc = copy_field_class_array_element( md_maps, in_elem_fc); @@ -604,7 +604,7 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * goto error; } - out_field_class = bt_field_class_static_array_create( + out_field_class = bt_field_class_array_static_create( md_maps->output_trace_class, out_elem_fc, array_len); break; @@ -615,7 +615,7 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * bt_field_class_array_borrow_element_field_class_const( in_field_class); const bt_field_path *length_fp = - bt_field_class_dynamic_array_borrow_length_field_path_const( + bt_field_class_array_dynamic_borrow_length_field_path_const( in_field_class); bt_field_class *out_length_fc = NULL; @@ -637,7 +637,7 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * BT_ASSERT(out_length_fc); } - out_field_class = bt_field_class_dynamic_array_create( + out_field_class = bt_field_class_array_dynamic_create( md_maps->output_trace_class, out_elem_fc, out_length_fc); break; diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index a0728b1c..746a69ca 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -552,19 +552,19 @@ void write_enum_field_class_mappings(struct details_write_ctx *ctx, BT_ASSERT(mapping); if (is_signed) { - fc_mapping = bt_field_class_signed_enumeration_borrow_mapping_by_index_const( + fc_mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const( fc, i); - fc_range_set = bt_field_class_signed_enumeration_mapping_borrow_ranges_const( + fc_range_set = bt_field_class_enumeration_signed_mapping_borrow_ranges_const( fc_mapping); } else { - fc_mapping = bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( + fc_mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( fc, i); - fc_range_set = bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const( + fc_range_set = bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( fc_mapping); } mapping->label = bt_field_class_enumeration_mapping_get_label( - bt_field_class_signed_enumeration_mapping_as_mapping_const( + bt_field_class_enumeration_signed_mapping_as_mapping_const( fc_mapping)); mapping->ranges = range_set_to_int_ranges(fc_range_set, is_signed); @@ -665,21 +665,21 @@ void write_variant_field_class_option(struct details_write_ctx *ctx, bt_field_class_variant_option_get_name(option)); if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_unsigned_selector_option *spec_opt = - bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_unsigned_option *spec_opt = + bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( fc, index); orig_ranges = - bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( spec_opt); is_signed = false; } else { - const bt_field_class_variant_with_signed_selector_option *spec_opt = - bt_field_class_variant_with_signed_selector_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_signed_option *spec_opt = + bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( fc, index); orig_ranges = - bt_field_class_variant_with_signed_selector_option_borrow_ranges_const( + bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( spec_opt); is_signed = true; } @@ -878,11 +878,11 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc) if (fc_type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY) { g_string_append(ctx->str, " (Length "); write_uint_prop_value(ctx, - bt_field_class_static_array_get_length(fc)); + bt_field_class_array_static_get_length(fc)); g_string_append_c(ctx->str, ')'); } else { const bt_field_path *length_field_path = - bt_field_class_dynamic_array_borrow_length_field_path_const( + bt_field_class_array_dynamic_borrow_length_field_path_const( fc); if (length_field_path) { @@ -1504,13 +1504,13 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field, if (fc_type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || fc_type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) { format_uint(buf, - bt_field_unsigned_integer_get_value(field), + bt_field_integer_unsigned_get_value(field), fmt_base); write_sp(ctx); write_uint_str_prop_value(ctx, buf); } else { format_int(buf, - bt_field_signed_integer_get_value(field), + bt_field_integer_signed_get_value(field), fmt_base); write_sp(ctx); write_int_str_prop_value(ctx, buf); @@ -1794,7 +1794,7 @@ void write_trace(struct details_write_ctx *ctx, const bt_trace *trace) if (bt_value_get_type(value) == BT_VALUE_TYPE_SIGNED_INTEGER) { write_int_prop_value(ctx, - bt_value_signed_integer_get(value)); + bt_value_integer_signed_get(value)); } else if (bt_value_get_type(value) == BT_VALUE_TYPE_STRING) { write_str_prop_value(ctx, diff --git a/src/plugins/text/pretty/print.c b/src/plugins/text/pretty/print.c index b83febb4..2c9ae83d 100644 --- a/src/plugins/text/pretty/print.c +++ b/src/plugins/text/pretty/print.c @@ -406,7 +406,7 @@ int print_event_header(struct pretty_component *pretty, } else if (dom_print) { g_string_append(pretty->string, ":"); } - value = bt_value_signed_integer_get(vpid_value); + value = bt_value_integer_signed_get(vpid_value); g_string_append_printf(pretty->string, "(%" PRId64 ")", value); dom_print = 1; @@ -527,9 +527,9 @@ int print_integer(struct pretty_component *pretty, ft_type = bt_field_get_class_type(field); if (ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || ft_type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) { - v.u = bt_field_unsigned_integer_get_value(field); + v.u = bt_field_integer_unsigned_get_value(field); } else { - v.s = bt_field_signed_integer_get_value(field); + v.s = bt_field_integer_signed_get_value(field); } if (pretty->use_colors) { @@ -693,11 +693,11 @@ int print_enum(struct pretty_component *pretty, switch (bt_field_get_class_type(field)) { case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: - ret = bt_field_unsigned_enumeration_get_mapping_labels(field, + ret = bt_field_enumeration_unsigned_get_mapping_labels(field, &label_array, &label_count); break; case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: - ret = bt_field_signed_enumeration_get_mapping_labels(field, + ret = bt_field_enumeration_signed_get_mapping_labels(field, &label_array, &label_count); break; default: diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index 97f35365..0bbecd0e 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -178,7 +178,7 @@ bt_component_class_init_method_status counter_init( goto error; } - counter->step = bt_value_unsigned_integer_get(step); + counter->step = bt_value_integer_unsigned_get(step); } hide_zero = bt_value_map_borrow_entry_value_const(params, "hide-zero"); diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index a6889adf..7cf741cf 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -445,7 +445,7 @@ int set_bound_from_param(struct trimmer_comp *trimmer_comp, char tmp_arg[64]; if (bt_value_is_signed_integer(param)) { - int64_t value = bt_value_signed_integer_get(param); + int64_t value = bt_value_integer_signed_get(param); /* * Just convert it to a temporary string to handle diff --git a/tests/lib/plugin.c b/tests/lib/plugin.c index 9c58fd99..b6cad1e2 100644 --- a/tests/lib/plugin.c +++ b/tests/lib/plugin.c @@ -179,7 +179,7 @@ static void test_sfs(const char *plugin_dir) plugin, "filter"); ok(filter_comp_class, "bt_plugin_borrow_filter_component_class_by_name_const() finds a filter component class"); - params = bt_value_signed_integer_create_init(23); + params = bt_value_integer_signed_create_init(23); BT_ASSERT(params); ret = bt_query_executor_query(query_exec, bt_component_class_filter_as_component_class_const(filter_comp_class), diff --git a/tests/lib/test_bt_values.c b/tests/lib/test_bt_values.c index b0cd8593..e170a5f3 100644 --- a/tests/lib/test_bt_values.c +++ b/tests/lib/test_bt_values.c @@ -78,27 +78,27 @@ void test_unsigned_integer(void) uint64_t value; bt_value *obj; - obj = bt_value_unsigned_integer_create(); + obj = bt_value_integer_unsigned_create(); ok(obj && bt_value_is_unsigned_integer(obj), - "bt_value_unsigned_integer_create() returns an unsigned integer value object"); + "bt_value_integer_unsigned_create() returns an unsigned integer value object"); value = 1961; - value = bt_value_unsigned_integer_get(obj); + value = bt_value_integer_unsigned_get(obj); ok(value == 0, "default unsigned integer value object value is 0"); - bt_value_unsigned_integer_set(obj, 98765); - value = bt_value_unsigned_integer_get(obj); - ok(value == 98765, "bt_value_unsigned_integer_bool_set() works"); + bt_value_integer_unsigned_set(obj, 98765); + value = bt_value_integer_unsigned_get(obj); + ok(value == 98765, "bt_value_integer_unsigned_bool_set() works"); BT_VALUE_PUT_REF_AND_RESET(obj); pass("putting an existing unsigned integer value object does not cause a crash") - obj = bt_value_unsigned_integer_create_init(321456987); + obj = bt_value_integer_unsigned_create_init(321456987); ok(obj && bt_value_is_unsigned_integer(obj), - "bt_value_unsigned_integer_create_init() returns an unsigned integer value object"); - value = bt_value_unsigned_integer_get(obj); + "bt_value_integer_unsigned_create_init() returns an unsigned integer value object"); + value = bt_value_integer_unsigned_get(obj); ok(value == 321456987, - "bt_value_unsigned_integer_create_init() sets the appropriate initial value"); + "bt_value_integer_unsigned_create_init() sets the appropriate initial value"); BT_VALUE_PUT_REF_AND_RESET(obj); } @@ -109,27 +109,27 @@ void test_signed_integer(void) int64_t value; bt_value *obj; - obj = bt_value_signed_integer_create(); + obj = bt_value_integer_signed_create(); ok(obj && bt_value_is_signed_integer(obj), - "bt_value_signed_integer_create() returns a signed integer value object"); + "bt_value_integer_signed_create() returns a signed integer value object"); value = 1961; - value = bt_value_signed_integer_get(obj); + value = bt_value_integer_signed_get(obj); ok(value == 0, "default signed integer value object value is 0"); - bt_value_signed_integer_set(obj, 98765); - value = bt_value_signed_integer_get(obj); - ok(value == 98765, "bt_value_signed_integer_bool_set() works"); + bt_value_integer_signed_set(obj, 98765); + value = bt_value_integer_signed_get(obj); + ok(value == 98765, "bt_value_integer_signed_bool_set() works"); BT_VALUE_PUT_REF_AND_RESET(obj); pass("putting an existing signed integer value object does not cause a crash") - obj = bt_value_signed_integer_create_init(-321456987); + obj = bt_value_integer_signed_create_init(-321456987); ok(obj && bt_value_is_signed_integer(obj), - "bt_value_signed_integer_create_init() returns a signed integer value object"); - value = bt_value_signed_integer_get(obj); + "bt_value_integer_signed_create_init() returns a signed integer value object"); + value = bt_value_integer_signed_get(obj); ok(value == -321456987, - "bt_value_signed_integer_create_init() sets the appropriate initial value"); + "bt_value_integer_signed_create_init() sets the appropriate initial value"); BT_VALUE_PUT_REF_AND_RESET(obj); } @@ -215,10 +215,10 @@ void test_array(void) ok(bt_value_array_is_empty(array_obj), "initial array value object size is 0"); - obj = bt_value_unsigned_integer_create_init(345); + obj = bt_value_integer_unsigned_create_init(345); ret = bt_value_array_append_element(array_obj, obj); BT_VALUE_PUT_REF_AND_RESET(obj); - obj = bt_value_signed_integer_create_init(-507); + obj = bt_value_integer_signed_create_init(-507); ret |= bt_value_array_append_element(array_obj, obj); BT_VALUE_PUT_REF_AND_RESET(obj); obj = bt_value_real_create_init(-17.45); @@ -236,13 +236,13 @@ void test_array(void) obj = bt_value_array_borrow_element_by_index(array_obj, 0); ok(obj && bt_value_is_unsigned_integer(obj), "bt_value_array_borrow_element_by_index() returns an value object with the appropriate type (unsigned integer)"); - int_value = bt_value_unsigned_integer_get(obj); + int_value = bt_value_integer_unsigned_get(obj); ok(int_value == 345, "bt_value_array_borrow_element_by_index() returns an value object with the appropriate value (unsigned integer)"); obj = bt_value_array_borrow_element_by_index(array_obj, 1); ok(obj && bt_value_is_signed_integer(obj), "bt_value_array_borrow_element_by_index() returns an value object with the appropriate type (signed integer)"); - int_value = bt_value_signed_integer_get(obj); + int_value = bt_value_integer_signed_get(obj); ok(int_value == -507, "bt_value_array_borrow_element_by_index() returns an value object with the appropriate value (signed integer)"); obj = bt_value_array_borrow_element_by_index(array_obj, 2); @@ -261,7 +261,7 @@ void test_array(void) ok(obj == bt_value_null, "bt_value_array_borrow_element_by_index() returns an value object with the appropriate type (null)"); - obj = bt_value_signed_integer_create_init(1001); + obj = bt_value_integer_signed_create_init(1001); BT_ASSERT(obj); ok(!bt_value_array_set_element_by_index(array_obj, 2, obj), "bt_value_array_set_element_by_index() succeeds"); @@ -269,7 +269,7 @@ void test_array(void) obj = bt_value_array_borrow_element_by_index(array_obj, 2); ok(obj && bt_value_is_signed_integer(obj), "bt_value_array_set_element_by_index() inserts an value object with the appropriate type"); - int_value = bt_value_signed_integer_get(obj); + int_value = bt_value_integer_signed_get(obj); BT_ASSERT(!ret); ok(int_value == 1001, "bt_value_array_set_element_by_index() inserts an value object with the appropriate value"); @@ -308,13 +308,13 @@ void test_array(void) obj = bt_value_array_borrow_element_by_index(array_obj, 6); ok(obj && bt_value_is_unsigned_integer(obj), "bt_value_array_append_unsigned_integer_element() appends an unsigned integer value object"); - int_value = bt_value_unsigned_integer_get(obj); + int_value = bt_value_integer_unsigned_get(obj); ok(int_value == 98765, "bt_value_array_append_unsigned_integer_element() appends the appropriate value"); obj = bt_value_array_borrow_element_by_index(array_obj, 7); ok(obj && bt_value_is_signed_integer(obj), "bt_value_array_append_signed_integer_element() appends a signed integer value object"); - int_value = bt_value_signed_integer_get(obj); + int_value = bt_value_integer_signed_get(obj); ok(int_value == -10101, "bt_value_array_append_signed_integer_element() appends the appropriate value"); obj = bt_value_array_borrow_element_by_index(array_obj, 8); @@ -400,7 +400,7 @@ bt_bool test_map_foreach_cb_check(const char *key, bt_value *object, } else { uint64_t val = 0; - val = bt_value_unsigned_integer_get(object); + val = bt_value_integer_unsigned_get(object); if (val == 19457) { pass("test_map_foreach_cb_check(): \"uint\" value object has the right value"); @@ -415,7 +415,7 @@ bt_bool test_map_foreach_cb_check(const char *key, bt_value *object, } else { int64_t val = 0; - val = bt_value_signed_integer_get(object); + val = bt_value_integer_signed_get(object); if (val == -12345) { pass("test_map_foreach_cb_check(): \"int\" value object has the right value"); @@ -467,7 +467,7 @@ bt_bool test_map_foreach_cb_check(const char *key, bt_value *object, } else { int64_t val = 0; - val = bt_value_signed_integer_get(object); + val = bt_value_integer_signed_get(object); if (val == 98765) { pass("test_map_foreach_cb_check(): \"int2\" value object has the right value"); @@ -550,10 +550,10 @@ void test_map(void) ok(bt_value_map_get_size(map_obj) == 0, "initial map value object size is 0"); - obj = bt_value_unsigned_integer_create_init(19457); + obj = bt_value_integer_unsigned_create_init(19457); ret = bt_value_map_insert_entry(map_obj, "uint", obj); BT_VALUE_PUT_REF_AND_RESET(obj); - obj = bt_value_signed_integer_create_init(-12345); + obj = bt_value_integer_signed_create_init(-12345); ret |= bt_value_map_insert_entry(map_obj, "int", obj); BT_VALUE_PUT_REF_AND_RESET(obj); obj = bt_value_real_create_init(5.444); @@ -584,13 +584,13 @@ void test_map(void) obj = bt_value_map_borrow_entry_value(map_obj, "uint"); ok(obj && bt_value_is_unsigned_integer(obj), "bt_value_map_borrow_entry_value() returns an value object with the appropriate type (unsigned integer)"); - int_value = bt_value_unsigned_integer_get(obj); + int_value = bt_value_integer_unsigned_get(obj); ok(int_value == 19457, "bt_value_map_borrow_entry_value() returns an value object with the appropriate value (unsigned integer)"); obj = bt_value_map_borrow_entry_value(map_obj, "int"); ok(obj && bt_value_is_signed_integer(obj), "bt_value_map_borrow_entry_value() returns an value object with the appropriate type (signed integer)"); - int_value = bt_value_signed_integer_get(obj); + int_value = bt_value_integer_signed_get(obj); ok(int_value == -12345, "bt_value_map_borrow_entry_value() returns an value object with the appropriate value (signed integer)"); obj = bt_value_map_borrow_entry_value(map_obj, "null"); @@ -719,11 +719,11 @@ static void test_compare_unsigned_integer(void) { bt_value *int1 = - bt_value_unsigned_integer_create_init(10); + bt_value_integer_unsigned_create_init(10); bt_value *int2 = - bt_value_unsigned_integer_create_init(23); + bt_value_integer_unsigned_create_init(23); bt_value *int3 = - bt_value_unsigned_integer_create_init(10); + bt_value_integer_unsigned_create_init(10); BT_ASSERT(int1 && int2 && int3); ok(!bt_value_compare(bt_value_null, @@ -742,11 +742,11 @@ void test_compare_unsigned_integer(void) void test_compare_signed_integer(void) { bt_value *int1 = - bt_value_signed_integer_create_init(10); + bt_value_integer_signed_create_init(10); bt_value *int2 = - bt_value_signed_integer_create_init(-23); + bt_value_integer_signed_create_init(-23); bt_value *int3 = - bt_value_signed_integer_create_init(10); + bt_value_integer_signed_create_init(10); BT_ASSERT(int1 && int2 && int3); ok(!bt_value_compare(bt_value_null, @@ -958,8 +958,8 @@ void test_copy(void) bt_value_copy_status copy_status; bool_obj = bt_value_bool_create_init(BT_TRUE); - unsigned_integer_obj = bt_value_unsigned_integer_create_init(23); - signed_integer_obj = bt_value_signed_integer_create_init(-47); + unsigned_integer_obj = bt_value_integer_unsigned_create_init(23); + signed_integer_obj = bt_value_integer_signed_create_init(-47); real_obj = bt_value_real_create_init(-3.1416); string_obj = bt_value_string_create_init("test"); array_obj = bt_value_array_create(); diff --git a/tests/lib/test_trace_ir_ref.c b/tests/lib/test_trace_ir_ref.c index e1b215b8..7eeef185 100644 --- a/tests/lib/test_trace_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -81,19 +81,19 @@ static bt_field_class *create_integer_struct(bt_trace_class *trace_class) structure = bt_field_class_structure_create(trace_class); BT_ASSERT(structure); - ui8 = bt_field_class_unsigned_integer_create(trace_class); + ui8 = bt_field_class_integer_unsigned_create(trace_class); BT_ASSERT(ui8); bt_field_class_integer_set_field_value_range(ui8, 8); ret = bt_field_class_structure_append_member(structure, "payload_8", ui8); BT_ASSERT(ret == 0); - ui16 = bt_field_class_unsigned_integer_create(trace_class); + ui16 = bt_field_class_integer_unsigned_create(trace_class); BT_ASSERT(ui16); bt_field_class_integer_set_field_value_range(ui16, 16); ret = bt_field_class_structure_append_member(structure, "payload_16", ui16); BT_ASSERT(ret == 0); - ui32 = bt_field_class_unsigned_integer_create(trace_class); + ui32 = bt_field_class_integer_unsigned_create(trace_class); BT_ASSERT(ui32); bt_field_class_integer_set_field_value_range(ui32, 32); ret = bt_field_class_structure_append_member(structure, -- 2.34.1