From 004090977e6698a39035bb20b5ba4d5da23a6718 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 10 Jul 2019 01:28:13 -0400 Subject: [PATCH] Fix: CTF writer: make library have its own public `types.h` This was overlooked when segregating the CTF writer library from the Babeltrace library: CTF writer needs its own `bt_ctf_bool` type with its own `BT_CTF_TRUE` and `BT_CTF_FALSE` definitions. Signed-off-by: Philippe Proulx Change-Id: I4e6d0b2d0956479a554cc8358d646fc1676873f6 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1667 Tested-by: jenkins --- include/Makefile.am | 1 + include/babeltrace2/ctf-writer/clock-class.h | 4 +- include/babeltrace2/ctf-writer/clock.h | 2 +- include/babeltrace2/ctf-writer/field-types.h | 9 +- include/babeltrace2/ctf-writer/types.h | 47 +++++++++++ include/babeltrace2/ctf-writer/utils.h | 6 +- src/ctf-writer/clock-class.c | 6 +- src/ctf-writer/clock-class.h | 8 +- src/ctf-writer/field-types.c | 14 ++-- src/ctf-writer/field-types.h | 10 +-- src/ctf-writer/fields.c | 32 ++++---- src/ctf-writer/fields.h | 20 ++--- src/ctf-writer/resolve.c | 10 +-- src/ctf-writer/stream.c | 4 +- src/ctf-writer/trace.c | 4 +- src/ctf-writer/trace.h | 4 +- src/ctf-writer/utils.c | 12 +-- src/ctf-writer/values.c | 82 +++++++++---------- src/ctf-writer/values.h | 40 ++++----- src/ctf-writer/writer.c | 4 +- .../src.ctf.fs/succeed/gen-trace-simple.c | 2 +- 21 files changed, 184 insertions(+), 137 deletions(-) create mode 100644 include/babeltrace2/ctf-writer/types.h diff --git a/include/Makefile.am b/include/Makefile.am index 325f96d8..95a3327e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -34,6 +34,7 @@ babeltrace2ctfwriterinclude_HEADERS = \ babeltrace2/ctf-writer/stream-class.h \ babeltrace2/ctf-writer/stream.h \ babeltrace2/ctf-writer/trace.h \ + babeltrace2/ctf-writer/types.h \ babeltrace2/ctf-writer/utils.h \ babeltrace2/ctf-writer/visitor.h \ babeltrace2/ctf-writer/writer.h diff --git a/include/babeltrace2/ctf-writer/clock-class.h b/include/babeltrace2/ctf-writer/clock-class.h index d8b7b4e7..081ffe81 100644 --- a/include/babeltrace2/ctf-writer/clock-class.h +++ b/include/babeltrace2/ctf-writer/clock-class.h @@ -78,11 +78,11 @@ extern int bt_ctf_clock_class_get_offset_cycles( extern int bt_ctf_clock_class_set_offset_cycles( struct bt_ctf_clock_class *clock_class, int64_t cycles); -extern bt_bool bt_ctf_clock_class_is_absolute( +extern bt_ctf_bool bt_ctf_clock_class_is_absolute( struct bt_ctf_clock_class *clock_class); extern int bt_ctf_clock_class_set_is_absolute( - struct bt_ctf_clock_class *clock_class, bt_bool is_absolute); + struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute); extern const uint8_t *bt_ctf_clock_class_get_uuid( struct bt_ctf_clock_class *clock_class); diff --git a/include/babeltrace2/ctf-writer/clock.h b/include/babeltrace2/ctf-writer/clock.h index ccb1f26b..fa467755 100644 --- a/include/babeltrace2/ctf-writer/clock.h +++ b/include/babeltrace2/ctf-writer/clock.h @@ -30,7 +30,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/babeltrace2/ctf-writer/field-types.h b/include/babeltrace2/ctf-writer/field-types.h index bd0549e1..6ca5d4e4 100644 --- a/include/babeltrace2/ctf-writer/field-types.h +++ b/include/babeltrace2/ctf-writer/field-types.h @@ -30,8 +30,7 @@ #include #include - -#include +#include #ifdef __cplusplus extern "C" { @@ -145,7 +144,7 @@ extern int bt_ctf_field_type_integer_get_size( extern int bt_ctf_field_type_integer_set_size( struct bt_ctf_field_type *int_field_type, unsigned int size); -extern bt_bool bt_ctf_field_type_integer_is_signed( +extern bt_ctf_bool bt_ctf_field_type_integer_is_signed( struct bt_ctf_field_type *int_field_type); /* Pre-2.0 CTF writer compatibility */ @@ -157,7 +156,7 @@ int bt_ctf_field_type_integer_get_signed( } extern int bt_ctf_field_type_integer_set_is_signed( - struct bt_ctf_field_type *int_field_type, bt_bool is_signed); + struct bt_ctf_field_type *int_field_type, bt_ctf_bool is_signed); /* Pre-2.0 CTF writer compatibility */ static inline @@ -165,7 +164,7 @@ int bt_ctf_field_type_integer_set_signed( struct bt_ctf_field_type *int_field_type, int is_signed) { return bt_ctf_field_type_integer_set_is_signed(int_field_type, - is_signed ? BT_TRUE : BT_FALSE); + is_signed ? BT_CTF_TRUE : BT_CTF_FALSE); } extern enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base( diff --git a/include/babeltrace2/ctf-writer/types.h b/include/babeltrace2/ctf-writer/types.h new file mode 100644 index 00000000..f0e04f9e --- /dev/null +++ b/include/babeltrace2/ctf-writer/types.h @@ -0,0 +1,47 @@ +#ifndef BABELTRACE2_CTF_WRITER_TYPES_H +#define BABELTRACE2_CTF_WRITER_TYPES_H + +/* + * Copyright 2013, 2014 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * The Common Trace Format (CTF) Specification is available at + * http://www.efficios.com/ctf + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/// False boolean value for the #bt_ctf_bool type. +#define BT_CTF_FALSE 0 + +/// True boolean value for the #bt_ctf_bool type. +#define BT_CTF_TRUE 1 + +typedef int bt_ctf_bool; + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE2_CTF_WRITER_TYPES_H */ diff --git a/include/babeltrace2/ctf-writer/utils.h b/include/babeltrace2/ctf-writer/utils.h index 416fb3b7..417e9d5b 100644 --- a/include/babeltrace2/ctf-writer/utils.h +++ b/include/babeltrace2/ctf-writer/utils.h @@ -28,14 +28,14 @@ * http://www.efficios.com/ctf */ -/* For bt_bool */ -#include +/* For bt_ctf_bool */ +#include #ifdef __cplusplus extern "C" { #endif -extern bt_bool bt_ctf_identifier_is_valid(const char *identifier); +extern bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier); static inline int bt_ctf_validate_identifier(const char *identifier) diff --git a/src/ctf-writer/clock-class.c b/src/ctf-writer/clock-class.c index d186f89a..47c49bac 100644 --- a/src/ctf-writer/clock-class.c +++ b/src/ctf-writer/clock-class.c @@ -46,7 +46,7 @@ static void bt_ctf_clock_class_destroy(struct bt_ctf_object *obj); BT_HIDDEN -bt_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class) +bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class) { return clock_class && clock_class->name; } @@ -412,7 +412,7 @@ end: } BT_HIDDEN -bt_bool bt_ctf_clock_class_is_absolute(struct bt_ctf_clock_class *clock_class) +bt_ctf_bool bt_ctf_clock_class_is_absolute(struct bt_ctf_clock_class *clock_class) { int ret = -1; @@ -428,7 +428,7 @@ end: BT_HIDDEN int bt_ctf_clock_class_set_is_absolute(struct bt_ctf_clock_class *clock_class, - bt_bool is_absolute) + bt_ctf_bool is_absolute) { int ret = 0; diff --git a/src/ctf-writer/clock-class.h b/src/ctf-writer/clock-class.h index ec78f66b..14e0bd47 100644 --- a/src/ctf-writer/clock-class.h +++ b/src/ctf-writer/clock-class.h @@ -28,7 +28,7 @@ #include "common/macros.h" #include "object-pool.h" #include "common/uuid.h" -#include +#include #include #include #include @@ -58,7 +58,7 @@ BT_HIDDEN void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class); BT_HIDDEN -bt_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class); +bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class); BT_HIDDEN int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a, @@ -105,11 +105,11 @@ BT_HIDDEN int bt_ctf_clock_class_set_offset_cycles( struct bt_ctf_clock_class *clock_class, int64_t cycles); BT_HIDDEN -bt_bool bt_ctf_clock_class_is_absolute( +bt_ctf_bool bt_ctf_clock_class_is_absolute( struct bt_ctf_clock_class *clock_class); BT_HIDDEN int bt_ctf_clock_class_set_is_absolute( - struct bt_ctf_clock_class *clock_class, bt_bool is_absolute); + struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute); BT_HIDDEN const uint8_t *bt_ctf_clock_class_get_uuid( struct bt_ctf_clock_class *clock_class); diff --git a/src/ctf-writer/field-types.c b/src/ctf-writer/field-types.c index 535267d4..c427ee4f 100644 --- a/src/ctf-writer/field-types.c +++ b/src/ctf-writer/field-types.c @@ -871,7 +871,7 @@ void bt_ctf_field_type_common_enumeration_set_range_overlap( <= mapping[1]->range_end._signed && mapping[0]->range_end._signed >= mapping[1]->range_start._signed) { - ft->has_overlapping_ranges = BT_TRUE; + ft->has_overlapping_ranges = BT_CTF_TRUE; goto end; } } else { @@ -879,7 +879,7 @@ void bt_ctf_field_type_common_enumeration_set_range_overlap( <= mapping[1]->range_end._unsigned && mapping[0]->range_end._unsigned >= mapping[1]->range_start._unsigned) { - ft->has_overlapping_ranges = BT_TRUE; + ft->has_overlapping_ranges = BT_CTF_TRUE; goto end; } } @@ -999,7 +999,7 @@ end: } static -bt_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges( +bt_ctf_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges( struct bt_ctf_field_type_common_enumeration *enum_ft) { if (!enum_ft->common.frozen) { @@ -1133,7 +1133,7 @@ int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *f } BT_HIDDEN -bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft) +bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft) { struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft); @@ -1145,7 +1145,7 @@ bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_comm BT_HIDDEN int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft, - bt_bool is_signed) + bt_ctf_bool is_signed) { int ret = 0; struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft); @@ -4597,13 +4597,13 @@ int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *ft) return bt_ctf_field_type_common_integer_get_size((void *) ft); } -bt_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft) +bt_ctf_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_integer_is_signed((void *) ft); } int bt_ctf_field_type_integer_set_is_signed(struct bt_ctf_field_type *ft, - bt_bool is_signed) + bt_ctf_bool is_signed) { return bt_ctf_field_type_common_integer_set_is_signed((void *) ft, is_signed); diff --git a/src/ctf-writer/field-types.h b/src/ctf-writer/field-types.h index 89fbf97e..52118235 100644 --- a/src/ctf-writer/field-types.h +++ b/src/ctf-writer/field-types.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include "common/macros.h" @@ -135,7 +135,7 @@ struct bt_ctf_field_type_common_integer { struct bt_ctf_clock_class *mapped_clock_class; enum bt_ctf_byte_order user_byte_order; - bt_bool is_signed; + bt_ctf_bool is_signed; unsigned int size; enum bt_ctf_integer_base base; enum bt_ctf_string_encoding encoding; @@ -163,7 +163,7 @@ struct bt_ctf_field_type_common_enumeration { GPtrArray *entries; /* Only set during validation */ - bt_bool has_overlapping_ranges; + bt_ctf_bool has_overlapping_ranges; }; enum bt_ctf_field_type_enumeration_mapping_iterator_type { @@ -394,11 +394,11 @@ BT_HIDDEN int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft); BT_HIDDEN -bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft); +bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft); BT_HIDDEN int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft, - bt_bool is_signed); + bt_ctf_bool is_signed); BT_HIDDEN int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft, diff --git a/src/ctf-writer/fields.c b/src/ctf-writer/fields.c index 48c48a9b..3909deb6 100644 --- a/src/ctf-writer/fields.c +++ b/src/ctf-writer/fields.c @@ -564,16 +564,16 @@ end: } BT_HIDDEN -bt_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field) { return field && field->payload_set; } BT_HIDDEN -bt_bool bt_ctf_field_common_structure_is_set_recursive( +bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive( struct bt_ctf_field_common *field) { - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; size_t i; struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field); @@ -592,10 +592,10 @@ end: } BT_HIDDEN -bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field) { struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field); - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; BT_ASSERT(field); @@ -608,10 +608,10 @@ bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common } BT_HIDDEN -bt_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field) { size_t i; - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field); BT_ASSERT(field); @@ -628,10 +628,10 @@ end: } BT_HIDDEN -bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field) { size_t i; - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field); BT_ASSERT(field); @@ -676,7 +676,7 @@ static int bt_ctf_field_enumeration_validate_recursive(struct bt_ctf_field_common *field); static -bt_bool bt_ctf_field_enumeration_is_set_recursive( +bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive( struct bt_ctf_field_common *field); static @@ -730,7 +730,7 @@ static int bt_ctf_field_variant_validate_recursive(struct bt_ctf_field_common *field); static -bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field); +bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field); static void bt_ctf_field_variant_reset_recursive(struct bt_ctf_field_common *field); @@ -1235,7 +1235,7 @@ struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field, struct bt_ctf_field_type_common_variant *variant_ft; struct bt_ctf_field_type_common_enumeration *tag_ft; struct bt_ctf_field *current_field = NULL; - bt_bool is_signed; + bt_ctf_bool is_signed; uint64_t tag_uval; int ret; @@ -1701,9 +1701,9 @@ int bt_ctf_field_enumeration_validate_recursive(struct bt_ctf_field_common *fiel } static -bt_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field) { - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; struct bt_ctf_field_enumeration *enumeration = (void *) field; if (enumeration->container) { @@ -1763,9 +1763,9 @@ end: } static -bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field) { - bt_bool is_set; + bt_ctf_bool is_set; struct bt_ctf_field_variant *variant = (void *) field; if (variant->tag) { diff --git a/src/ctf-writer/fields.h b/src/ctf-writer/fields.h index 3c3cff66..b2284996 100644 --- a/src/ctf-writer/fields.h +++ b/src/ctf-writer/fields.h @@ -67,7 +67,7 @@ typedef void (*bt_ctf_field_common_method_set_is_frozen)(struct bt_ctf_field_com typedef int (*bt_ctf_field_common_method_validate)(struct bt_ctf_field_common *); typedef struct bt_ctf_field_common *(*bt_ctf_field_common_method_copy)( struct bt_ctf_field_common *); -typedef bt_bool (*bt_ctf_field_common_method_is_set)(struct bt_ctf_field_common *); +typedef bt_ctf_bool (*bt_ctf_field_common_method_is_set)(struct bt_ctf_field_common *); typedef void (*bt_ctf_field_common_method_reset)(struct bt_ctf_field_common *); struct bt_ctf_field_common_methods { @@ -255,20 +255,20 @@ void _bt_ctf_field_common_set_is_frozen_recursive(struct bt_ctf_field_common *fi bool is_frozen); BT_HIDDEN -bt_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field); +bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field); BT_HIDDEN -bt_bool bt_ctf_field_common_structure_is_set_recursive( +bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive( struct bt_ctf_field_common *field); BT_HIDDEN -bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field); +bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field); BT_HIDDEN -bt_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field); +bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field); BT_HIDDEN -bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field); +bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field); #ifdef BT_DEV_MODE # define bt_ctf_field_common_validate_recursive _bt_ctf_field_common_validate_recursive @@ -279,7 +279,7 @@ bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common #else # define bt_ctf_field_common_validate_recursive(_field) (-1) # define bt_ctf_field_common_set_is_frozen_recursive(_field, _is_frozen) -# define bt_ctf_field_common_is_set_recursive(_field) (BT_FALSE) +# define bt_ctf_field_common_is_set_recursive(_field) (BT_CTF_FALSE) # define bt_ctf_field_common_reset_recursive(_field) # define bt_ctf_field_common_set(_field, _val) #endif @@ -329,9 +329,9 @@ void _bt_ctf_field_common_set(struct bt_ctf_field_common *field, bool value) } static inline -bt_bool _bt_ctf_field_common_is_set_recursive(struct bt_ctf_field_common *field) +bt_ctf_bool _bt_ctf_field_common_is_set_recursive(struct bt_ctf_field_common *field) { - bt_bool is_set = BT_FALSE; + bt_ctf_bool is_set = BT_CTF_FALSE; if (!field) { goto end; @@ -844,7 +844,7 @@ struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container( struct bt_ctf_field *field); static inline -bt_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field) +bt_ctf_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field) { return bt_ctf_field_common_is_set_recursive((void *) field); } diff --git a/src/ctf-writer/resolve.c b/src/ctf-writer/resolve.c index 0d5e1c5f..bc6ede5f 100644 --- a/src/ctf-writer/resolve.c +++ b/src/ctf-writer/resolve.c @@ -179,7 +179,7 @@ end: * Checks whether or not `stack` is empty. */ static -bt_bool type_stack_empty(type_stack *stack) +bt_ctf_bool type_stack_empty(type_stack *stack) { return stack->len == 0; } @@ -402,7 +402,7 @@ int ptokens_to_field_path(GList *ptokens, struct bt_ctf_field_path *field_path, { int ret = 0; GList *cur_ptoken = ptokens; - bt_bool first_level_done = BT_FALSE; + bt_ctf_bool first_level_done = BT_CTF_FALSE; /* Get our own reference */ bt_ctf_object_get_ref(type); @@ -445,7 +445,7 @@ int ptokens_to_field_path(GList *ptokens, struct bt_ctf_field_path *field_path, /* Next path token */ cur_ptoken = g_list_next(cur_ptoken); - first_level_done = BT_TRUE; + first_level_done = BT_CTF_TRUE; } /* Create new field path entry */ @@ -558,7 +558,7 @@ int relative_ptokens_to_field_path(GList *ptokens, int tail_field_path_len = tail_field_path->indexes->len; - while (BT_TRUE) { + while (BT_CTF_TRUE) { struct bt_ctf_field_type_common *cur_type = type_stack_at(ctx->type_stack, i)->type; int index = type_stack_at( @@ -842,7 +842,7 @@ int get_field_paths_lca_index(struct bt_ctf_field_path *field_path1, field_path1_len = field_path1->indexes->len; field_path2_len = field_path2->indexes->len; - while (BT_TRUE) { + while (BT_CTF_TRUE) { int target_index, ctx_index; if (lca_index == field_path2_len || diff --git a/src/ctf-writer/stream.c b/src/ctf-writer/stream.c index da1228d6..7d371ffd 100644 --- a/src/ctf-writer/stream.c +++ b/src/ctf-writer/stream.c @@ -1872,7 +1872,7 @@ void bt_ctf_stream_destroy(struct bt_ctf_object *obj) static int _set_structure_field_integer(struct bt_ctf_field *structure, char *name, - uint64_t value, bt_bool force) + uint64_t value, bt_ctf_bool force) { int ret = 0; struct bt_ctf_field_type *field_type = NULL; @@ -1937,7 +1937,7 @@ static int try_set_structure_field_integer(struct bt_ctf_field *structure, char *name, uint64_t value) { - return _set_structure_field_integer(structure, name, value, BT_FALSE); + return _set_structure_field_integer(structure, name, value, BT_CTF_FALSE); } struct bt_ctf_stream_class *bt_ctf_stream_get_class( diff --git a/src/ctf-writer/trace.c b/src/ctf-writer/trace.c index f7ef692d..3e29ce7b 100644 --- a/src/ctf-writer/trace.c +++ b/src/ctf-writer/trace.c @@ -205,7 +205,7 @@ int bt_ctf_trace_common_set_uuid(struct bt_ctf_trace_common *trace, } bt_uuid_copy(trace->uuid, uuid); - trace->uuid_set = BT_TRUE; + trace->uuid_set = BT_CTF_TRUE; BT_LOGT("Set trace's UUID: addr=%p, name=\"%s\", " "uuid=\"" BT_UUID_FMT "\"", trace, bt_ctf_trace_common_get_name(trace), @@ -1256,7 +1256,7 @@ end: } BT_HIDDEN -bt_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, +bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class) { struct bt_ctf_search_query query = { .value = clock_class, .found = 0 }; diff --git a/src/ctf-writer/trace.h b/src/ctf-writer/trace.h index 231e97b0..cd724c6a 100644 --- a/src/ctf-writer/trace.h +++ b/src/ctf-writer/trace.h @@ -50,7 +50,7 @@ struct bt_ctf_trace_common { GString *name; int frozen; bt_uuid_t uuid; - bt_bool uuid_set; + bt_ctf_bool uuid_set; enum bt_ctf_byte_order native_byte_order; struct bt_ctf_private_value *environment; GPtrArray *clock_classes; /* Array of pointers to bt_ctf_clock_class */ @@ -67,7 +67,7 @@ struct bt_ctf_trace_common { }; BT_HIDDEN -bt_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, +bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class); BT_HIDDEN diff --git a/src/ctf-writer/utils.c b/src/ctf-writer/utils.c index 5ac82475..935bfa84 100644 --- a/src/ctf-writer/utils.c +++ b/src/ctf-writer/utils.c @@ -82,29 +82,29 @@ void trace_finalize(void) } } -bt_bool bt_ctf_identifier_is_valid(const char *identifier) +bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier) { - bt_bool is_valid = BT_TRUE; + bt_ctf_bool is_valid = BT_CTF_TRUE; char *string = NULL; char *save_ptr, *token; if (!identifier) { BT_LOGT_STR("Invalid parameter: input string is NULL."); - is_valid = BT_FALSE; + is_valid = BT_CTF_FALSE; goto end; } try_init_reserved_keywords(); if (identifier[0] == '\0') { - is_valid = BT_FALSE; + is_valid = BT_CTF_FALSE; goto end; } string = strdup(identifier); if (!string) { BT_LOGE("strdup() failed."); - is_valid = BT_FALSE; + is_valid = BT_CTF_FALSE; goto end; } @@ -113,7 +113,7 @@ bt_bool bt_ctf_identifier_is_valid(const char *identifier) if (g_hash_table_lookup_extended(reserved_keywords_set, GINT_TO_POINTER(g_quark_from_string(token)), NULL, NULL)) { - is_valid = BT_FALSE; + is_valid = BT_CTF_FALSE; goto end; } diff --git a/src/ctf-writer/values.c b/src/ctf-writer/values.c index 643ba0bb..89a808d4 100644 --- a/src/ctf-writer/values.c +++ b/src/ctf-writer/values.c @@ -63,7 +63,7 @@ struct bt_ctf_value { struct bt_ctf_object base; enum bt_ctf_value_type type; - bt_bool frozen; + bt_ctf_bool frozen; }; static @@ -83,7 +83,7 @@ struct bt_ctf_value bt_ctf_value_null_instance = { .parent = NULL, }, .type = BT_CTF_VALUE_TYPE_NULL, - .frozen = BT_TRUE, + .frozen = BT_CTF_TRUE, }; struct bt_ctf_value *const bt_ctf_value_null = &bt_ctf_value_null_instance; @@ -92,7 +92,7 @@ struct bt_ctf_private_value *const bt_ctf_private_value_null = struct bt_ctf_value_bool { struct bt_ctf_value base; - bt_bool value; + bt_ctf_bool value; }; struct bt_ctf_value_integer { @@ -316,19 +316,19 @@ struct bt_ctf_private_value *(* const copy_funcs[])(const struct bt_ctf_value *) }; static -bt_bool bt_ctf_value_null_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_null_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { /* - * Always BT_TRUE since bt_ctf_value_compare() already checks if both + * Always BT_CTF_TRUE since bt_ctf_value_compare() already checks if both * object_a and object_b have the same type, and in the case of * null value objects, they're always the same if it is so. */ - return BT_TRUE; + return BT_CTF_TRUE; } static -bt_bool bt_ctf_value_bool_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_bool_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { if (BT_CTF_VALUE_TO_BOOL(object_a)->value != @@ -337,14 +337,14 @@ bt_bool bt_ctf_value_bool_compare(const struct bt_ctf_value *object_a, "bool-a-val=%d, bool-b-val=%d", BT_CTF_VALUE_TO_BOOL(object_a)->value, BT_CTF_VALUE_TO_BOOL(object_b)->value); - return BT_FALSE; + return BT_CTF_FALSE; } - return BT_TRUE; + return BT_CTF_TRUE; } static -bt_bool bt_ctf_value_integer_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_integer_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { if (BT_CTF_VALUE_TO_INTEGER(object_a)->value != @@ -353,14 +353,14 @@ bt_bool bt_ctf_value_integer_compare(const struct bt_ctf_value *object_a, "int-a-val=%" PRId64 ", int-b-val=%" PRId64, BT_CTF_VALUE_TO_INTEGER(object_a)->value, BT_CTF_VALUE_TO_INTEGER(object_b)->value); - return BT_FALSE; + return BT_CTF_FALSE; } - return BT_TRUE; + return BT_CTF_TRUE; } static -bt_bool bt_ctf_value_real_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_real_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { if (BT_CTF_VALUE_TO_REAL(object_a)->value != @@ -369,14 +369,14 @@ bt_bool bt_ctf_value_real_compare(const struct bt_ctf_value *object_a, "real-a-val=%f, real-b-val=%f", BT_CTF_VALUE_TO_REAL(object_a)->value, BT_CTF_VALUE_TO_REAL(object_b)->value); - return BT_FALSE; + return BT_CTF_FALSE; } - return BT_TRUE; + return BT_CTF_TRUE; } static -bt_bool bt_ctf_value_string_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_string_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { if (strcmp(BT_CTF_VALUE_TO_STRING(object_a)->gstr->str, @@ -385,18 +385,18 @@ bt_bool bt_ctf_value_string_compare(const struct bt_ctf_value *object_a, "string-a-val=\"%s\", string-b-val=\"%s\"", BT_CTF_VALUE_TO_STRING(object_a)->gstr->str, BT_CTF_VALUE_TO_STRING(object_b)->gstr->str); - return BT_FALSE; + return BT_CTF_FALSE; } - return BT_TRUE; + return BT_CTF_TRUE; } static -bt_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { int i; - bt_bool ret = BT_TRUE; + bt_ctf_bool ret = BT_CTF_TRUE; const struct bt_ctf_value_array *array_obj_a = BT_CTF_VALUE_TO_ARRAY(object_a); @@ -408,7 +408,7 @@ bt_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a, object_a, object_b, bt_ctf_value_array_get_size(object_a), bt_ctf_value_array_get_size(object_b)); - ret = BT_FALSE; + ret = BT_CTF_FALSE; goto end; } @@ -425,7 +425,7 @@ bt_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a, BT_LOGT("Array values's elements are different: " "value-a-addr=%p, value-b-addr=%p, index=%d", element_obj_a, element_obj_b, i); - ret = BT_FALSE; + ret = BT_CTF_FALSE; goto end; } } @@ -435,10 +435,10 @@ end: } static -bt_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { - bt_bool ret = BT_TRUE; + bt_ctf_bool ret = BT_CTF_TRUE; GHashTableIter iter; gpointer key, element_obj_a; const struct bt_ctf_value_map *map_obj_a = BT_CTF_VALUE_TO_MAP(object_a); @@ -451,7 +451,7 @@ bt_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a, object_a, object_b, bt_ctf_value_map_get_size(object_a), bt_ctf_value_map_get_size(object_b)); - ret = BT_FALSE; + ret = BT_CTF_FALSE; goto end; } @@ -468,7 +468,7 @@ bt_bool bt_ctf_value_map_compare(const struct bt_ctf_value *object_a, BT_LOGT("Map values's elements are different: " "value-a-addr=%p, value-b-addr=%p, key=\"%s\"", element_obj_a, element_obj_b, key_str); - ret = BT_FALSE; + ret = BT_CTF_FALSE; goto end; } } @@ -478,7 +478,7 @@ end: } static -bt_bool (* const compare_funcs[])(const struct bt_ctf_value *, +bt_ctf_bool (* const compare_funcs[])(const struct bt_ctf_value *, const struct bt_ctf_value *) = { [BT_CTF_VALUE_TYPE_NULL] = bt_ctf_value_null_compare, [BT_CTF_VALUE_TYPE_BOOL] = bt_ctf_value_bool_compare, @@ -497,7 +497,7 @@ void bt_ctf_value_null_freeze(struct bt_ctf_value *object) static void bt_ctf_value_generic_freeze(struct bt_ctf_value *object) { - object->frozen = BT_TRUE; + object->frozen = BT_CTF_TRUE; } static @@ -592,13 +592,13 @@ struct bt_ctf_value bt_ctf_value_create_base(enum bt_ctf_value_type type) struct bt_ctf_value value; value.type = type; - value.frozen = BT_FALSE; + value.frozen = BT_CTF_FALSE; bt_ctf_object_init_shared(&value.base, bt_ctf_value_destroy); return value; } BT_HIDDEN -struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_bool val) +struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val) { struct bt_ctf_value_bool *bool_obj; @@ -620,7 +620,7 @@ end: BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void) { - return bt_ctf_private_value_bool_create_init(BT_FALSE); + return bt_ctf_private_value_bool_create_init(BT_CTF_FALSE); } BT_HIDDEN @@ -775,7 +775,7 @@ end: } BT_HIDDEN -bt_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj) +bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj) { BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object"); BT_CTF_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_CTF_VALUE_TYPE_BOOL); @@ -783,7 +783,7 @@ bt_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj) } BT_HIDDEN -void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_bool val) +void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_ctf_bool val) { BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object"); BT_CTF_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_CTF_VALUE_TYPE_BOOL); @@ -907,7 +907,7 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_element( BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element( - struct bt_ctf_private_value *array_obj, bt_bool val) + struct bt_ctf_private_value *array_obj, bt_ctf_bool val) { enum bt_ctf_value_status ret; struct bt_ctf_private_value *bool_obj = NULL; @@ -1039,7 +1039,7 @@ struct bt_ctf_private_value *bt_ctf_private_value_map_borrow_entry_value( } BT_HIDDEN -bt_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key) +bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key) { BT_CTF_ASSERT_PRE_NON_NULL(map_obj, "Value object"); BT_CTF_ASSERT_PRE_NON_NULL(key, "Key"); @@ -1069,7 +1069,7 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_entry( BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry( - struct bt_ctf_private_value *map_obj, const char *key, bt_bool val) + struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val) { enum bt_ctf_value_status ret; struct bt_ctf_private_value *bool_obj = NULL; @@ -1196,10 +1196,10 @@ struct extend_map_element_data { }; static -bt_bool extend_map_element(const char *key, +bt_ctf_bool extend_map_element(const char *key, struct bt_ctf_value *extension_obj_elem, void *data) { - bt_bool ret = BT_TRUE; + bt_ctf_bool ret = BT_CTF_TRUE; struct extend_map_element_data *extend_data = data; struct bt_ctf_private_value *extension_obj_elem_copy = NULL; @@ -1230,7 +1230,7 @@ bt_bool extend_map_element(const char *key, error: BT_ASSERT(extend_data->status != BT_CTF_VALUE_STATUS_OK); - ret = BT_FALSE; + ret = BT_CTF_FALSE; end: BT_CTF_OBJECT_PUT_REF_AND_RESET(extension_obj_elem_copy); @@ -1322,10 +1322,10 @@ enum bt_ctf_value_status bt_ctf_value_copy(struct bt_ctf_private_value **copy_ob } BT_HIDDEN -bt_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { - bt_bool ret = BT_FALSE; + bt_ctf_bool ret = BT_CTF_FALSE; BT_CTF_ASSERT_PRE_NON_NULL(object_a, "Value object A"); BT_CTF_ASSERT_PRE_NON_NULL(object_b, "Value object B"); diff --git a/src/ctf-writer/values.h b/src/ctf-writer/values.h index 08b0fbcf..99037666 100644 --- a/src/ctf-writer/values.h +++ b/src/ctf-writer/values.h @@ -24,7 +24,7 @@ * SOFTWARE. */ -#include +#include #include "common/macros.h" @@ -60,7 +60,7 @@ enum bt_ctf_value_type { /// Null value object. BT_CTF_VALUE_TYPE_NULL = 0, - /// Boolean value object (holds #BT_TRUE or #BT_FALSE). + /// Boolean value object (holds #BT_CTF_TRUE or #BT_CTF_FALSE). BT_CTF_VALUE_TYPE_BOOL = 1, /// Integer value object (holds a signed 64-bit integer raw value). @@ -83,43 +83,43 @@ BT_HIDDEN enum bt_ctf_value_type bt_ctf_value_get_type(const struct bt_ctf_value *object); static inline -bt_bool bt_ctf_value_is_null(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_null(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_NULL; } static inline -bt_bool bt_ctf_value_is_bool(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_bool(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_BOOL; } static inline -bt_bool bt_ctf_value_is_integer(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_integer(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_INTEGER; } static inline -bt_bool bt_ctf_value_is_real(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_real(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_REAL; } static inline -bt_bool bt_ctf_value_is_string(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_string(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_STRING; } static inline -bt_bool bt_ctf_value_is_array(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_array(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_ARRAY; } static inline -bt_bool bt_ctf_value_is_map(const struct bt_ctf_value *object) +bt_ctf_bool bt_ctf_value_is_map(const struct bt_ctf_value *object) { return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_MAP; } @@ -129,11 +129,11 @@ enum bt_ctf_value_status bt_ctf_value_copy(struct bt_ctf_private_value **copy, const struct bt_ctf_value *object); BT_HIDDEN -bt_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, +bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b); BT_HIDDEN -bt_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj); +bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj); BT_HIDDEN int64_t bt_ctf_value_integer_get(const struct bt_ctf_value *integer_obj); @@ -148,7 +148,7 @@ BT_HIDDEN uint64_t bt_ctf_value_array_get_size(const struct bt_ctf_value *array_obj); static inline -bt_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj) +bt_ctf_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj) { return bt_ctf_value_array_get_size(array_obj) == 0; } @@ -161,7 +161,7 @@ BT_HIDDEN uint64_t bt_ctf_value_map_get_size(const struct bt_ctf_value *map_obj); static inline -bt_bool bt_ctf_value_map_is_empty(const struct bt_ctf_value *map_obj) +bt_ctf_bool bt_ctf_value_map_is_empty(const struct bt_ctf_value *map_obj) { return bt_ctf_value_map_get_size(map_obj) == 0; } @@ -170,7 +170,7 @@ BT_HIDDEN struct bt_ctf_value *bt_ctf_value_map_borrow_entry_value( const struct bt_ctf_value *map_obj, const char *key); -typedef bt_bool (* bt_ctf_value_map_foreach_entry_cb)(const char *key, +typedef bt_ctf_bool (* bt_ctf_value_map_foreach_entry_cb)(const char *key, struct bt_ctf_value *object, void *data); BT_HIDDEN @@ -179,7 +179,7 @@ enum bt_ctf_value_status bt_ctf_value_map_foreach_entry( bt_ctf_value_map_foreach_entry_cb cb, void *data); BT_HIDDEN -bt_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, +bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key); BT_HIDDEN @@ -205,11 +205,11 @@ BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void); BT_HIDDEN -struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_bool val); +struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val); BT_HIDDEN void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, - bt_bool val); + bt_ctf_bool val); BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_integer_create(void); @@ -259,7 +259,7 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_element( BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element( struct bt_ctf_private_value *array_obj, - bt_bool val); + bt_ctf_bool val); BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_integer_element( @@ -295,7 +295,7 @@ BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_map_borrow_entry_value( const struct bt_ctf_private_value *map_obj, const char *key); -typedef bt_bool (* bt_ctf_private_value_map_foreach_entry_cb)(const char *key, +typedef bt_ctf_bool (* bt_ctf_private_value_map_foreach_entry_cb)(const char *key, struct bt_ctf_private_value *object, void *data); BT_HIDDEN @@ -310,7 +310,7 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_entry( BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry( - struct bt_ctf_private_value *map_obj, const char *key, bt_bool val); + struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val); BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_integer_entry( diff --git a/src/ctf-writer/writer.c b/src/ctf-writer/writer.c index 650d68f3..a3d6f8b4 100644 --- a/src/ctf-writer/writer.c +++ b/src/ctf-writer/writer.c @@ -217,7 +217,7 @@ struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer, { struct bt_ctf_stream *stream = NULL; int stream_class_count; - bt_bool stream_class_found = BT_FALSE; + bt_ctf_bool stream_class_found = BT_CTF_FALSE; int i; if (!writer || !stream_class) { @@ -236,7 +236,7 @@ struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer, writer->trace, i); if (existing_stream_class == stream_class) { - stream_class_found = BT_TRUE; + stream_class_found = BT_CTF_TRUE; } BT_CTF_OBJECT_PUT_REF_AND_RESET(existing_stream_class); diff --git a/tests/plugins/src.ctf.fs/succeed/gen-trace-simple.c b/tests/plugins/src.ctf.fs/succeed/gen-trace-simple.c index bcfddae4..a7b9e9b6 100644 --- a/tests/plugins/src.ctf.fs/succeed/gen-trace-simple.c +++ b/tests/plugins/src.ctf.fs/succeed/gen-trace-simple.c @@ -78,7 +78,7 @@ void configure_writer(struct config *cfg, const char *path) BT_ASSERT(cfg->ec); ft = bt_ctf_field_type_integer_create(8); BT_ASSERT(ft); - ret = bt_ctf_field_type_integer_set_is_signed(ft, BT_TRUE); + ret = bt_ctf_field_type_integer_set_is_signed(ft, BT_CTF_TRUE); BT_ASSERT(ret == 0); ret = bt_ctf_event_class_add_field(cfg->ec, ft, "first"); BT_ASSERT(ret == 0); -- 2.34.1