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 <eeppeliteloop@gmail.com>
Change-Id: I8b77443c3675d94ffc796b97eca2f773b71832db
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3439
#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_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))
(((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) \
_name " has the wrong type: expected-type=%s, %![fc-]+F"
#define BT_ASSERT_PRE_FC_IS_INT(_fc, _name) \
BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc), \
_BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name), (_fc))
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) \
bt_common_field_class_type_string(_type), (_fc))
#define BT_ASSERT_PRE_DEV_FC_IS_INT(_fc, _name) \
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))
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) \
bt_common_field_class_type_string(_type), (_fc))
#define BT_ASSERT_PRE_DEV_FC_HOT(_fc, _name) \
"Message's stream's class has no default clock class: " \
"%![msg-]+n, %![sc-]+S", (_msg), (_sc));
"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))
(((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"
"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_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))
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_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"
bt_message_type_string(_type), (_msg))
#define _BT_ASSERT_PRE_MSG_NAME "Message"
#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_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))
(((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"
"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_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))
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_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"
bt_common_value_type_string(_type), (_value))
#define _BT_ASSERT_PRE_VALUE_NAME "Value object"
struct bt_message *message)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
return borrow_discarded_items_message_stream(message);
}
uint64_t count)
{
BT_ASSERT_PRE_NON_NULL(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);
}
BT_ASSERT_PRE(count > 0, "Discarded event count is 0.");
set_discarded_items_message_count(message, count);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
}
const struct bt_message *message, uint64_t *count)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return get_discarded_items_message_count(message, count);
}
struct bt_message *message)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_stream(message);
}
uint64_t count)
{
BT_ASSERT_PRE_NON_NULL(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);
}
BT_ASSERT_PRE(count > 0, "Discarded packet count is 0.");
set_discarded_items_message_count(message, count);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
}
const struct bt_message *message, uint64_t *count)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return get_discarded_items_message_count(message, count);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
}
struct bt_message_event *event_message;
BT_ASSERT_PRE_DEV_NON_NULL(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;
event_message = container_of(message,
struct bt_message_event, parent);
return event_message->event;
struct bt_stream_class *stream_class;
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
stream_class = bt_event_class_borrow_stream_class_inline(
event_msg->event->class);
BT_ASSERT_DBG(stream_class);
struct bt_stream_class *stream_class;
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
stream_class = bt_event_class_borrow_stream_class_inline(
event_msg->event->class);
BT_ASSERT_DBG(stream_class);
struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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;
}
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
return inactivity->cs;
}
struct bt_message_packet *packet_msg = (void *) message;
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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;
}
BT_MESSAGE_TYPE_PACKET_BEGINNING);
return packet_msg->packet;
}
struct bt_message_packet *packet_msg = (void *) message;
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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;
}
BT_MESSAGE_TYPE_PACKET_END);
return packet_msg->packet;
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_packet_message_default_clock_snapshot_const(msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_packet_message_default_clock_snapshot_const(msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_packet_message_stream_class_default_clock_class(msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_packet_message_stream_class_default_clock_class(msg);
}
struct bt_message *message)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return borrow_stream_message_stream(message);
}
struct bt_message *message)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
BT_MESSAGE_TYPE_STREAM_END);
return borrow_stream_message_stream(message);
}
struct bt_message *message, uint64_t raw_value)
{
BT_ASSERT_PRE_NON_NULL(message, "Message");
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);
}
bt_message_stream_set_default_clock_snapshot(message, raw_value);
}
struct bt_message *message, uint64_t raw_value)
{
BT_ASSERT_PRE_NON_NULL(message, "Message");
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);
}
return bt_message_stream_set_default_clock_snapshot(message, raw_value);
}
const bt_message *message, const bt_clock_snapshot **snapshot)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return bt_message_stream_borrow_default_clock_snapshot_const(
message, snapshot);
const bt_message *message, const bt_clock_snapshot **snapshot)
{
BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
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);
}
return bt_message_stream_borrow_default_clock_snapshot_const(
message, snapshot);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return borrow_stream_message_stream_class_default_clock_class(msg);
}
const struct bt_message *msg)
{
BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
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);
}
return borrow_stream_message_stream_class_default_clock_class(msg);
}
const struct bt_field_class_bit_array *ba_fc = (const void *) fc;
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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;
}
"Field class");
return ba_fc->length;
}
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
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);
}
"Field class");
return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
}
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
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);
}
"Field class");
return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
}
const struct bt_field_class *fc, const char *label)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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);
"Field class");
return (const void *) borrow_enumeration_field_class_mapping_by_label(
(const void *) fc, label);
const struct bt_field_class *fc, const char *label)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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);
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field class");
return (const void *) borrow_enumeration_field_class_mapping_by_label(
(const void *) fc, label);
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_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);
"Field class");
g_ptr_array_set_size(enum_fc->label_buf, 0);
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_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);
"Field class");
g_ptr_array_set_size(enum_fc->label_buf, 0);
{
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
{
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);
"Field class");
return add_mapping_to_enumeration_field_class(fc, label,
(const void *) range_set);
{
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
{
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);
"Field class");
return add_mapping_to_enumeration_field_class(fc, label,
(const void *) range_set);
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
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) {
"Field class");
named_fc = create_named_field_class(name, member_fc);
if (!named_fc) {
struct bt_field_class_structure *struct_fc = (void *) fc;
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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;
}
"Field class");
return (uint64_t) struct_fc->common.named_fcs->len;
}
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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(
"Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_at_index(
struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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(
"Field class");
return (void *)
borrow_named_field_class_from_container_field_class_at_index(
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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(
"Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_by_name(
struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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(
"Field class");
return (void *)
borrow_named_field_class_from_container_field_class_by_name(
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_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(
BT_FIELD_CLASS_TYPE_BOOL,
"Selector field class");
opt_with_sel_fc = (void *) g_new0(
struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
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;
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;
struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
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;
}
BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD, "Field class");
return opt_fc->sel_is_reversed;
}
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_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) {
BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD, "Field class");
named_fc = create_named_field_class(name, option_fc);
if (!named_fc) {
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_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,
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,
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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 *)
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
return (const void *)
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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 *)
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
return (const void *)
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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 *)
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
return (const void *)
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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 *)
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
return (const void *)
const struct bt_field_class_array_static *array_fc = (const void *) fc;
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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;
}
"Field class");
return (uint64_t) array_fc->length;
}
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
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;
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
"Field class");
return seq_fc->length_field_path;
bt_bool bt_value_bool_get(const struct bt_value *bool_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(bool_obj, "Value object");
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");
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",
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",
uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object");
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;
}
BT_VALUE_TYPE_UNSIGNED_INTEGER);
return BT_VALUE_TO_INTEGER(integer_obj)->value.u;
}
int64_t bt_value_integer_signed_get(const struct bt_value *integer_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object");
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;
}
BT_VALUE_TYPE_SIGNED_INTEGER);
return BT_VALUE_TO_INTEGER(integer_obj)->value.i;
}
enum bt_value_type expected_type, uint64_t uval)
{
BT_ASSERT_PRE_NON_NULL(integer_obj, "Value object");
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;
}
BT_ASSERT_PRE_DEV_VALUE_HOT(integer_obj, "Value object");
BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval;
}
double bt_value_real_get(const struct bt_value *real_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(real_obj, "Value object");
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");
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",
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",
const char *bt_value_string_get(const struct bt_value *string_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(string_obj, "Value object");
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;
}
return BT_VALUE_TO_STRING(string_obj)->gstr->str;
}
{
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
{
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",
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",
uint64_t bt_value_array_get_length(const struct bt_value *array_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
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;
}
return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len;
}
BT_VALUE_TO_ARRAY(array_obj);
BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
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);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, typed_array_obj->garray->len);
return g_ptr_array_index(typed_array_obj->garray, 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_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);
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);
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_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));
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));
uint64_t bt_value_map_get_size(const struct bt_value *map_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
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);
}
return (uint64_t) g_hash_table_size(BT_VALUE_TO_MAP(map_obj)->ght);
}
{
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
BT_ASSERT_PRE_DEV_NON_NULL(key, "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 g_hash_table_lookup(BT_VALUE_TO_MAP(map_obj)->ght,
GUINT_TO_POINTER(g_quark_from_string(key)));
}
return g_hash_table_lookup(BT_VALUE_TO_MAP(map_obj)->ght,
GUINT_TO_POINTER(g_quark_from_string(key)));
}
{
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
BT_ASSERT_PRE_DEV_NON_NULL(key, "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)));
}
return bt_g_hash_table_contains(BT_VALUE_TO_MAP(map_obj)->ght,
GUINT_TO_POINTER(g_quark_from_string(key)));
}
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_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);
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);
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback");
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)) {
g_hash_table_iter_init(&iter, typed_map_obj->ght);
while (g_hash_table_iter_next(&iter, &key, &element_obj)) {
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_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);
BT_LOGD("Extending map value: base-value-addr=%p, extension-value-addr=%p",
base_map_obj, extension_obj);