From 0a83319b57c7f5d1f37a8c1af9a39daf6d503122 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 21 Apr 2020 10:27:48 -0400 Subject: [PATCH] lib: rename *_IS_TYPE() and *_HAS_ID() macros -> *_HAS_TYPE() This is to normalize this type of macro. Since those macros check that a given object _has_ a given type, I believe "has" makes more sense than "is" (you pass the instance, not the type). Signed-off-by: Philippe Proulx Change-Id: I8b77443c3675d94ffc796b97eca2f773b71832db Reviewed-on: https://review.lttng.org/c/babeltrace/+/3439 --- src/lib/assert-cond.h | 48 ++++++++--------- src/lib/graph/message/discarded-items.c | 24 ++++----- src/lib/graph/message/event.c | 6 +-- .../message/message-iterator-inactivity.c | 2 +- src/lib/graph/message/packet.c | 12 ++--- src/lib/graph/message/stream.c | 16 +++--- src/lib/trace-ir/field-class.c | 52 +++++++++---------- src/lib/value.c | 40 +++++++------- 8 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/lib/assert-cond.h b/src/lib/assert-cond.h index d4e815db..df39e83e 100644 --- a/src/lib/assert-cond.h +++ b/src/lib/assert-cond.h @@ -249,10 +249,10 @@ #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name) \ _name " is not a variant field class with a selector: %![fc-]+F" -#define _BT_ASSERT_PRE_FC_HAS_ID_COND(_fc, _type) \ +#define _BT_ASSERT_PRE_FC_HAS_TYPE_COND(_fc, _type) \ (((const struct bt_field_class *) (_fc))->type == (_type)) -#define _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name) \ +#define _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name) \ _name " has the wrong type: expected-type=%s, %![fc-]+F" #define BT_ASSERT_PRE_FC_IS_INT(_fc, _name) \ @@ -299,9 +299,9 @@ BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc), \ _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name), (_fc)) -#define BT_ASSERT_PRE_FC_HAS_ID(_fc, _type, _name) \ - BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_HAS_ID_COND((_fc), (_type)), \ - _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name), \ +#define BT_ASSERT_PRE_FC_HAS_TYPE(_fc, _type, _name) \ + BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_HAS_TYPE_COND((_fc), (_type)), \ + _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name), \ bt_common_field_class_type_string(_type), (_fc)) #define BT_ASSERT_PRE_DEV_FC_IS_INT(_fc, _name) \ @@ -348,9 +348,9 @@ BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc), \ _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name), (_fc)) -#define BT_ASSERT_PRE_DEV_FC_HAS_ID(_fc, _type, _name) \ - BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_HAS_ID_COND((_fc), (_type)), \ - _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name), \ +#define BT_ASSERT_PRE_DEV_FC_HAS_TYPE(_fc, _type, _name) \ + BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_HAS_TYPE_COND((_fc), (_type)), \ + _BT_ASSERT_PRE_FC_HAS_TYPE_FMT(_name), \ bt_common_field_class_type_string(_type), (_fc)) #define BT_ASSERT_PRE_DEV_FC_HOT(_fc, _name) \ @@ -523,22 +523,22 @@ "Message's stream's class has no default clock class: " \ "%![msg-]+n, %![sc-]+S", (_msg), (_sc)); -#define _BT_ASSERT_PRE_MSG_IS_TYPE_COND(_msg, _type) \ +#define _BT_ASSERT_PRE_MSG_HAS_TYPE_COND(_msg, _type) \ (((struct bt_message *) (_msg))->type == (_type)) -#define _BT_ASSERT_PRE_MSG_IS_TYPE_FMT \ +#define _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT \ "Message has the wrong type: expected-type=%s, %![msg-]+n" -#define BT_ASSERT_PRE_MSG_IS_TYPE(_msg, _type) \ +#define BT_ASSERT_PRE_MSG_HAS_TYPE(_msg, _type) \ BT_ASSERT_PRE( \ - _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)), \ - _BT_ASSERT_PRE_MSG_IS_TYPE_FMT, \ + _BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \ + _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \ bt_message_type_string(_type), (_msg)) -#define BT_ASSERT_PRE_DEV_MSG_IS_TYPE(_msg, _type) \ +#define BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(_msg, _type) \ BT_ASSERT_PRE_DEV( \ - _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)), \ - _BT_ASSERT_PRE_MSG_IS_TYPE_FMT, \ + _BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \ + _BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \ bt_message_type_string(_type), (_msg)) #define _BT_ASSERT_PRE_MSG_NAME "Message" @@ -699,22 +699,22 @@ #define BT_ASSERT_PRE_DEV_INT_RANGE_SET_NON_NULL(_int_range_set) \ BT_ASSERT_PRE_DEV_NON_NULL(_int_range_set, _BT_ASSERT_PRE_INT_RANGE_SET_NAME) -#define _BT_ASSERT_PRE_VALUE_IS_TYPE_COND(_value, _type) \ +#define _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND(_value, _type) \ (((struct bt_value *) (_value))->type == (_type)) -#define _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT \ +#define _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT \ "Value has the wrong type: expected-type=%s, %![value-]+v" -#define BT_ASSERT_PRE_VALUE_IS_TYPE(_value, _type) \ +#define BT_ASSERT_PRE_VALUE_HAS_TYPE(_value, _type) \ BT_ASSERT_PRE( \ - _BT_ASSERT_PRE_VALUE_IS_TYPE_COND((_value), (_type)), \ - _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT, \ + _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND((_value), (_type)), \ + _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT, \ bt_common_value_type_string(_type), (_value)) -#define BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(_value, _type) \ +#define BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(_value, _type) \ BT_ASSERT_PRE_DEV( \ - _BT_ASSERT_PRE_VALUE_IS_TYPE_COND((_value), (_type)), \ - _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT, \ + _BT_ASSERT_PRE_VALUE_HAS_TYPE_COND((_value), (_type)), \ + _BT_ASSERT_PRE_VALUE_HAS_TYPE_FMT, \ bt_common_value_type_string(_type), (_value)) #define _BT_ASSERT_PRE_VALUE_NAME "Value object" diff --git a/src/lib/graph/message/discarded-items.c b/src/lib/graph/message/discarded-items.c index b0b51727..e04654f2 100644 --- a/src/lib/graph/message/discarded-items.c +++ b/src/lib/graph/message/discarded-items.c @@ -229,7 +229,7 @@ struct bt_stream *bt_message_discarded_events_borrow_stream( struct bt_message *message) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS); return borrow_discarded_items_message_stream(message); } @@ -237,7 +237,7 @@ void bt_message_discarded_events_set_count(struct bt_message *message, uint64_t count) { BT_ASSERT_PRE_NON_NULL(message, "Message"); - BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS); + BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS); BT_ASSERT_PRE(count > 0, "Discarded event count is 0."); set_discarded_items_message_count(message, count); } @@ -247,7 +247,7 @@ bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); return borrow_discarded_items_message_beginning_default_clock_snapshot_const( msg); } @@ -257,7 +257,7 @@ bt_message_discarded_events_borrow_end_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); return borrow_discarded_items_message_end_default_clock_snapshot_const( msg); } @@ -273,7 +273,7 @@ enum bt_property_availability bt_message_discarded_events_get_count( const struct bt_message *message, uint64_t *count) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS); return get_discarded_items_message_count(message, count); } @@ -306,7 +306,7 @@ struct bt_stream *bt_message_discarded_packets_borrow_stream( struct bt_message *message) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS); return borrow_discarded_items_message_stream(message); } @@ -315,7 +315,7 @@ void bt_message_discarded_packets_set_count(struct bt_message *message, uint64_t count) { BT_ASSERT_PRE_NON_NULL(message, "Message"); - BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS); + BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS); BT_ASSERT_PRE(count > 0, "Discarded packet count is 0."); set_discarded_items_message_count(message, count); } @@ -325,7 +325,7 @@ bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); return borrow_discarded_items_message_beginning_default_clock_snapshot_const( msg); } @@ -335,7 +335,7 @@ bt_message_discarded_packets_borrow_end_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); return borrow_discarded_items_message_end_default_clock_snapshot_const( msg); } @@ -351,7 +351,7 @@ enum bt_property_availability bt_message_discarded_packets_get_count( const struct bt_message *message, uint64_t *count) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS); return get_discarded_items_message_count(message, count); } @@ -372,7 +372,7 @@ bt_message_discarded_events_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS); return borrow_discarded_items_message_stream_class_default_clock_class( msg); } @@ -382,7 +382,7 @@ bt_message_discarded_packets_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS); return borrow_discarded_items_message_stream_class_default_clock_class( msg); } diff --git a/src/lib/graph/message/event.c b/src/lib/graph/message/event.c index 64b01758..aa0df8b9 100644 --- a/src/lib/graph/message/event.c +++ b/src/lib/graph/message/event.c @@ -305,7 +305,7 @@ struct bt_event *borrow_event(struct bt_message *message) struct bt_message_event *event_message; BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_EVENT); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_EVENT); event_message = container_of(message, struct bt_message_event, parent); return event_message->event; @@ -331,7 +331,7 @@ bt_message_event_borrow_default_clock_snapshot_const( struct bt_stream_class *stream_class; BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_EVENT); stream_class = bt_event_class_borrow_stream_class_inline( event_msg->event->class); BT_ASSERT_DBG(stream_class); @@ -349,7 +349,7 @@ bt_message_event_borrow_stream_class_default_clock_class_const( struct bt_stream_class *stream_class; BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_EVENT); stream_class = bt_event_class_borrow_stream_class_inline( event_msg->event->class); BT_ASSERT_DBG(stream_class); diff --git a/src/lib/graph/message/message-iterator-inactivity.c b/src/lib/graph/message/message-iterator-inactivity.c index 6ead8bd5..4223585d 100644 --- a/src/lib/graph/message/message-iterator-inactivity.c +++ b/src/lib/graph/message/message-iterator-inactivity.c @@ -86,7 +86,7 @@ bt_message_message_iterator_inactivity_borrow_clock_snapshot_const( struct bt_message_message_iterator_inactivity *inactivity = (void *) msg; BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY); return inactivity->cs; } diff --git a/src/lib/graph/message/packet.c b/src/lib/graph/message/packet.c index 84dd8c4c..73a3e39d 100644 --- a/src/lib/graph/message/packet.c +++ b/src/lib/graph/message/packet.c @@ -267,7 +267,7 @@ struct bt_packet *bt_message_packet_beginning_borrow_packet( struct bt_message_packet *packet_msg = (void *) message; BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_PACKET_BEGINNING); return packet_msg->packet; } @@ -285,7 +285,7 @@ struct bt_packet *bt_message_packet_end_borrow_packet( struct bt_message_packet *packet_msg = (void *) message; BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_PACKET_END); return packet_msg->packet; } @@ -318,7 +318,7 @@ bt_message_packet_beginning_borrow_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING); return borrow_packet_message_default_clock_snapshot_const(msg); } @@ -327,7 +327,7 @@ bt_message_packet_end_borrow_default_clock_snapshot_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END); return borrow_packet_message_default_clock_snapshot_const(msg); } @@ -347,7 +347,7 @@ bt_message_packet_beginning_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING); return borrow_packet_message_stream_class_default_clock_class(msg); } @@ -356,6 +356,6 @@ bt_message_packet_end_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END); return borrow_packet_message_stream_class_default_clock_class(msg); } diff --git a/src/lib/graph/message/stream.c b/src/lib/graph/message/stream.c index b4b045cf..ad93031f 100644 --- a/src/lib/graph/message/stream.c +++ b/src/lib/graph/message/stream.c @@ -124,7 +124,7 @@ struct bt_stream *bt_message_stream_beginning_borrow_stream( struct bt_message *message) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING); return borrow_stream_message_stream(message); } @@ -133,7 +133,7 @@ struct bt_stream *bt_message_stream_end_borrow_stream( struct bt_message *message) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END); return borrow_stream_message_stream(message); } @@ -177,7 +177,7 @@ void bt_message_stream_beginning_set_default_clock_snapshot( struct bt_message *message, uint64_t raw_value) { BT_ASSERT_PRE_NON_NULL(message, "Message"); - BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING); + BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING); bt_message_stream_set_default_clock_snapshot(message, raw_value); } @@ -186,7 +186,7 @@ void bt_message_stream_end_set_default_clock_snapshot( struct bt_message *message, uint64_t raw_value) { BT_ASSERT_PRE_NON_NULL(message, "Message"); - BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END); + BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END); return bt_message_stream_set_default_clock_snapshot(message, raw_value); } @@ -216,7 +216,7 @@ bt_message_stream_beginning_borrow_default_clock_snapshot_const( const bt_message *message, const bt_clock_snapshot **snapshot) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING); return bt_message_stream_borrow_default_clock_snapshot_const( message, snapshot); @@ -227,7 +227,7 @@ bt_message_stream_end_borrow_default_clock_snapshot_const( const bt_message *message, const bt_clock_snapshot **snapshot) { BT_ASSERT_PRE_DEV_NON_NULL(message, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END); return bt_message_stream_borrow_default_clock_snapshot_const( message, snapshot); } @@ -248,7 +248,7 @@ bt_message_stream_beginning_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_BEGINNING); return borrow_stream_message_stream_class_default_clock_class(msg); } @@ -258,6 +258,6 @@ bt_message_stream_end_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) { BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END); + BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END); return borrow_stream_message_stream_class_default_clock_class(msg); } diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 97c8523c..9b2f2613 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -114,7 +114,7 @@ uint64_t bt_field_class_bit_array_get_length(const struct bt_field_class *fc) const struct bt_field_class_bit_array *ba_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_BIT_ARRAY, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_BIT_ARRAY, "Field class"); return ba_fc->length; } @@ -421,7 +421,7 @@ bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field class"); return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index); } @@ -434,7 +434,7 @@ bt_field_class_enumeration_signed_borrow_mapping_by_index_const( BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field class"); return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index); } @@ -469,7 +469,7 @@ 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"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field class"); return (const void *) borrow_enumeration_field_class_mapping_by_label( (const void *) fc, label); @@ -480,7 +480,7 @@ 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"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field class"); return (const void *) borrow_enumeration_field_class_mapping_by_label( (const void *) fc, label); @@ -528,7 +528,7 @@ bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)"); BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field class"); g_ptr_array_set_size(enum_fc->label_buf, 0); @@ -569,7 +569,7 @@ bt_field_class_enumeration_signed_get_mapping_labels_for_value( BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)"); BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field class"); g_ptr_array_set_size(enum_fc->label_buf, 0); @@ -664,7 +664,7 @@ bt_field_class_enumeration_unsigned_add_mapping( { BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field class"); return add_mapping_to_enumeration_field_class(fc, label, (const void *) range_set); @@ -677,7 +677,7 @@ bt_field_class_enumeration_signed_add_mapping( { BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field class"); return add_mapping_to_enumeration_field_class(fc, label, (const void *) range_set); @@ -1005,7 +1005,7 @@ bt_field_class_structure_append_member( BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); named_fc = create_named_field_class(name, member_fc); if (!named_fc) { @@ -1031,7 +1031,7 @@ uint64_t bt_field_class_structure_get_member_count( struct bt_field_class_structure *struct_fc = (void *) fc; BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); return (uint64_t) struct_fc->common.named_fcs->len; } @@ -1052,7 +1052,7 @@ bt_field_class_structure_borrow_member_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_at_index( @@ -1064,7 +1064,7 @@ bt_field_class_structure_borrow_member_by_index( struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); return (void *) borrow_named_field_class_from_container_field_class_at_index( @@ -1099,7 +1099,7 @@ bt_field_class_structure_borrow_member_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_by_name( @@ -1111,7 +1111,7 @@ bt_field_class_structure_borrow_member_by_name( struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class"); return (void *) borrow_named_field_class_from_container_field_class_by_name( @@ -1201,7 +1201,7 @@ struct bt_field_class *create_option_field_class( BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field class"); if (fc_type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD) { - BT_ASSERT_PRE_FC_HAS_ID(selector_fc, + BT_ASSERT_PRE_FC_HAS_TYPE(selector_fc, BT_FIELD_CLASS_TYPE_BOOL, "Selector field class"); opt_with_sel_fc = (void *) g_new0( @@ -1380,7 +1380,7 @@ void bt_field_class_option_with_selector_field_bool_set_selector_is_reversed( struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc; BT_ASSERT_PRE_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD, "Field class"); BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class"); opt_fc->sel_is_reversed = sel_is_reversed; @@ -1392,7 +1392,7 @@ bt_bool bt_field_class_option_with_selector_field_bool_selector_is_reversed( struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc; BT_ASSERT_PRE_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD, "Field class"); return opt_fc->sel_is_reversed; } @@ -1544,7 +1544,7 @@ bt_field_class_variant_without_selector_append_option(struct bt_field_class *fc, BT_ASSERT_PRE_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_NON_NULL(name, "Name"); BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class"); - BT_ASSERT_PRE_FC_HAS_ID(fc, + BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD, "Field class"); named_fc = create_named_field_class(name, option_fc); if (!named_fc) { @@ -1669,7 +1669,7 @@ int append_option_to_variant_with_selector_field_field_class( BT_ASSERT_PRE_NON_NULL(name, "Name"); BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class"); BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set"); - BT_ASSERT_PRE_FC_HAS_ID(fc, expected_type, "Field class"); + BT_ASSERT_PRE_FC_HAS_TYPE(fc, expected_type, "Field class"); BT_ASSERT_PRE(range_set->ranges->len > 0, "Integer range set is empty: %!+R", range_set); status = ranges_overlap(var_fc->common.common.named_fcs, range_set, @@ -1789,7 +1789,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_nam const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD, "Field class"); return (const void *) @@ -1802,7 +1802,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_ind const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD, "Field class"); return (const void *) @@ -1815,7 +1815,7 @@ bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_ const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, "Field class"); return (const void *) @@ -1828,7 +1828,7 @@ bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_index const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, "Field class"); return (const void *) @@ -1998,7 +1998,7 @@ uint64_t bt_field_class_array_static_get_length(const struct bt_field_class *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, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY, "Field class"); return (uint64_t) array_fc->length; } @@ -2070,7 +2070,7 @@ bt_field_class_array_dynamic_with_length_field_borrow_length_field_path_const( BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); - BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, + BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD, "Field class"); return seq_fc->length_field_path; diff --git a/src/lib/value.c b/src/lib/value.c index fbdb9f5a..5ddf4e6f 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -778,14 +778,14 @@ end: bt_bool bt_value_bool_get(const struct bt_value *bool_obj) { BT_ASSERT_PRE_DEV_NON_NULL(bool_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL); return BT_VALUE_TO_BOOL(bool_obj)->value; } void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val) { BT_ASSERT_PRE_NON_NULL(bool_obj, "Value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL); + BT_ASSERT_PRE_VALUE_HAS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL); BT_ASSERT_PRE_DEV_VALUE_HOT(bool_obj, "Value object"); BT_VALUE_TO_BOOL(bool_obj)->value = val; BT_LOGT("Set boolean value's raw value: value-addr=%p, value=%d", @@ -795,7 +795,7 @@ void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val) 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, + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(integer_obj, BT_VALUE_TYPE_UNSIGNED_INTEGER); return BT_VALUE_TO_INTEGER(integer_obj)->value.u; } @@ -803,7 +803,7 @@ uint64_t bt_value_integer_unsigned_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, + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(integer_obj, BT_VALUE_TYPE_SIGNED_INTEGER); return BT_VALUE_TO_INTEGER(integer_obj)->value.i; } @@ -813,7 +813,7 @@ void bt_value_integer_set(struct bt_value *integer_obj, enum bt_value_type expected_type, uint64_t uval) { BT_ASSERT_PRE_NON_NULL(integer_obj, "Value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(integer_obj, expected_type); + BT_ASSERT_PRE_VALUE_HAS_TYPE(integer_obj, expected_type); BT_ASSERT_PRE_DEV_VALUE_HOT(integer_obj, "Value object"); BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval; } @@ -838,14 +838,14 @@ void bt_value_integer_signed_set(struct bt_value *integer_obj, double bt_value_real_get(const struct bt_value *real_obj) { BT_ASSERT_PRE_DEV_NON_NULL(real_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(real_obj, BT_VALUE_TYPE_REAL); return BT_VALUE_TO_REAL(real_obj)->value; } void bt_value_real_set(struct bt_value *real_obj, double val) { BT_ASSERT_PRE_NON_NULL(real_obj, "Value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL); + BT_ASSERT_PRE_VALUE_HAS_TYPE(real_obj, BT_VALUE_TYPE_REAL); BT_ASSERT_PRE_DEV_VALUE_HOT(real_obj, "Value object"); BT_VALUE_TO_REAL(real_obj)->value = val; BT_LOGT("Set real number value's raw value: value-addr=%p, value=%f", @@ -855,7 +855,7 @@ void bt_value_real_set(struct bt_value *real_obj, double val) const char *bt_value_string_get(const struct bt_value *string_obj) { BT_ASSERT_PRE_DEV_NON_NULL(string_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(string_obj, BT_VALUE_TYPE_STRING); return BT_VALUE_TO_STRING(string_obj)->gstr->str; } @@ -864,7 +864,7 @@ enum bt_value_string_set_status bt_value_string_set( { BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(string_obj, "Value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING); + BT_ASSERT_PRE_VALUE_HAS_TYPE(string_obj, BT_VALUE_TYPE_STRING); BT_ASSERT_PRE_DEV_VALUE_HOT(string_obj, "Value object"); g_string_assign(BT_VALUE_TO_STRING(string_obj)->gstr, val); BT_LOGT("Set string value's raw value: value-addr=%p, raw-value-addr=%p", @@ -875,7 +875,7 @@ enum bt_value_string_set_status bt_value_string_set( uint64_t bt_value_array_get_length(const struct bt_value *array_obj) { BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len; } @@ -886,7 +886,7 @@ struct bt_value *bt_value_array_borrow_element_by_index( BT_VALUE_TO_ARRAY(array_obj); BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); BT_ASSERT_PRE_DEV_VALID_INDEX(index, typed_array_obj->garray->len); return g_ptr_array_index(typed_array_obj->garray, index); } @@ -909,7 +909,7 @@ enum bt_value_array_append_element_status bt_value_array_append_element( BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object"); BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); + BT_ASSERT_PRE_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); BT_ASSERT_PRE_DEV_VALUE_HOT(array_obj, "Array value object"); g_ptr_array_add(typed_array_obj->garray, element_obj); bt_object_get_ref(element_obj); @@ -1049,7 +1049,7 @@ bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index, BT_ASSERT_PRE_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object"); BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); + BT_ASSERT_PRE_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY); BT_ASSERT_PRE_DEV_VALUE_HOT(array_obj, "Array value object"); BT_ASSERT_PRE_VALID_INDEX(index, typed_array_obj->garray->len); bt_object_put_ref(g_ptr_array_index(typed_array_obj->garray, index)); @@ -1064,7 +1064,7 @@ bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index, uint64_t bt_value_map_get_size(const struct bt_value *map_obj) { BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP); return (uint64_t) g_hash_table_size(BT_VALUE_TO_MAP(map_obj)->ght); } @@ -1073,7 +1073,7 @@ struct bt_value *bt_value_map_borrow_entry_value(struct bt_value *map_obj, { BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object"); BT_ASSERT_PRE_DEV_NON_NULL(key, "Key"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP); return g_hash_table_lookup(BT_VALUE_TO_MAP(map_obj)->ght, GUINT_TO_POINTER(g_quark_from_string(key))); } @@ -1088,7 +1088,7 @@ bt_bool bt_value_map_has_entry(const struct bt_value *map_obj, const char *key) { BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object"); BT_ASSERT_PRE_DEV_NON_NULL(key, "Key"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP); return bt_g_hash_table_contains(BT_VALUE_TO_MAP(map_obj)->ght, GUINT_TO_POINTER(g_quark_from_string(key))); } @@ -1101,7 +1101,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_entry( BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object"); BT_ASSERT_PRE_NON_NULL(key, "Key"); BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP); BT_ASSERT_PRE_DEV_VALUE_HOT(map_obj, "Map value object"); g_hash_table_insert(BT_VALUE_TO_MAP(map_obj)->ght, GUINT_TO_POINTER(g_quark_from_string(key)), element_obj); @@ -1246,7 +1246,7 @@ enum bt_value_map_foreach_entry_status bt_value_map_foreach_entry( BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object"); BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback"); - BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP); g_hash_table_iter_init(&iter, typed_map_obj->ght); while (g_hash_table_iter_next(&iter, &key, &element_obj)) { @@ -1357,8 +1357,8 @@ enum bt_value_map_extend_status bt_value_map_extend( BT_ASSERT_PRE_NON_NULL(base_map_obj, "Base value object"); BT_ASSERT_PRE_DEV_VALUE_HOT(base_map_obj, "Base value object"); BT_ASSERT_PRE_NON_NULL(extension_obj, "Extension value object"); - BT_ASSERT_PRE_VALUE_IS_TYPE(base_map_obj, BT_VALUE_TYPE_MAP); - BT_ASSERT_PRE_VALUE_IS_TYPE(extension_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_VALUE_HAS_TYPE(base_map_obj, BT_VALUE_TYPE_MAP); + BT_ASSERT_PRE_VALUE_HAS_TYPE(extension_obj, BT_VALUE_TYPE_MAP); BT_LOGD("Extending map value: base-value-addr=%p, extension-value-addr=%p", base_map_obj, extension_obj); -- 2.34.1