Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Iad421161d61079f8777c4d75232e523a59f9120c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3434
38 files changed:
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, \
_name " is not a variant field: %![field-]+f", (_field))
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, \
_name " is not a variant field: %![field-]+f", (_field))
-#define BT_ASSERT_PRE_DEV_FIELD_IS_SET(_field, _name) \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_SET(_field) \
BT_ASSERT_PRE_DEV(bt_field_is_set(_field), \
BT_ASSERT_PRE_DEV(bt_field_is_set(_field), \
- _name " is not set: %!+f", (_field))
+ "Field is not set: %!+f", (_field))
#define _BT_ASSERT_PRE_FIELD_NAME "Field"
#define _BT_ASSERT_PRE_FIELD_NAME "Field"
void bt_current_thread_move_error(const struct bt_error *error)
{
void bt_current_thread_move_error(const struct bt_error *error)
{
- BT_ASSERT_PRE_NON_NULL(error, "Error");
+ BT_ASSERT_PRE_ERROR_NON_NULL(error);
bt_current_thread_clear_error();
thread_error = (void *) error;
BT_LOGD("Moved error object as current thread's error: addr=%p",
bt_current_thread_clear_error();
thread_error = (void *) error;
BT_LOGD("Moved error object as current thread's error: addr=%p",
try_create_thread_error();
va_list args;
try_create_thread_error();
va_list args;
- BT_ASSERT_PRE_NON_NULL(self_comp, "Component");
+ BT_ASSERT_PRE_COMP_NON_NULL(self_comp);
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
try_create_thread_error();
va_list args;
try_create_thread_error();
va_list args;
- BT_ASSERT_PRE_NON_NULL(self_comp_class, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(self_comp_class);
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
try_create_thread_error();
va_list args;
try_create_thread_error();
va_list args;
- BT_ASSERT_PRE_NON_NULL(self_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(self_iter);
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
BT_ASSERT_PRE_NON_NULL(file_name, "File name");
BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
uint64_t bt_error_get_cause_count(const bt_error *error)
{
uint64_t bt_error_get_cause_count(const bt_error *error)
{
- BT_ASSERT_PRE_NON_NULL(error, "Error");
+ BT_ASSERT_PRE_ERROR_NON_NULL(error);
return error_cause_count(error);
}
void bt_error_release(const struct bt_error *error)
{
return error_cause_count(error);
}
void bt_error_release(const struct bt_error *error)
{
- BT_ASSERT_PRE_NON_NULL(error, "Error");
+ BT_ASSERT_PRE_ERROR_NON_NULL(error);
bt_error_destroy((void *) error);
}
const struct bt_error_cause *bt_error_borrow_cause_by_index(
const bt_error *error, uint64_t index)
{
bt_error_destroy((void *) error);
}
const struct bt_error_cause *bt_error_borrow_cause_by_index(
const bt_error *error, uint64_t index)
{
- BT_ASSERT_PRE_NON_NULL(error, "Error");
+ BT_ASSERT_PRE_ERROR_NON_NULL(error);
BT_ASSERT_PRE_VALID_INDEX(index, error_cause_count(error));
return error->causes->pdata[index];
}
BT_ASSERT_PRE_VALID_INDEX(index, error_cause_count(error));
return error->causes->pdata[index];
}
enum bt_error_cause_actor_type bt_error_cause_get_actor_type(
const struct bt_error_cause *cause)
{
enum bt_error_cause_actor_type bt_error_cause_get_actor_type(
const struct bt_error_cause *cause)
{
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
return cause->actor_type;
}
const char *bt_error_cause_get_message(const struct bt_error_cause *cause)
{
return cause->actor_type;
}
const char *bt_error_cause_get_message(const struct bt_error_cause *cause)
{
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
return cause->message->str;
}
const char *bt_error_cause_get_module_name(const struct bt_error_cause *cause)
{
return cause->message->str;
}
const char *bt_error_cause_get_module_name(const struct bt_error_cause *cause)
{
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
return cause->module_name->str;
}
const char *bt_error_cause_get_file_name(const struct bt_error_cause *cause)
{
return cause->module_name->str;
}
const char *bt_error_cause_get_file_name(const struct bt_error_cause *cause)
{
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
return cause->file_name->str;
}
uint64_t bt_error_cause_get_line_number(const bt_error_cause *cause)
{
return cause->file_name->str;
}
uint64_t bt_error_cause_get_line_number(const bt_error_cause *cause)
{
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_name->str;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.type;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.type;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.name->str;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.type;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.type;
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.name->str;
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_component_class_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_name->str;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->output_port_name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->output_port_name->str;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.type;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.type;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.name->str;
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.name->str;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
const struct bt_error_cause_message_iterator_actor *spec_cause =
(const void *) cause;
- BT_ASSERT_PRE_NON_NULL(cause, "Error cause");
+ BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
#include "lib/func-status.h"
#include "lib/graph/message-iterator-class.h"
#include "lib/func-status.h"
#include "lib/graph/message-iterator-class.h"
-#define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
+#define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
"Component class", ": %!+C", (_cc))
BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
"Component class", ": %!+C", (_cc))
int ret;
BT_ASSERT_PRE_NO_ERROR();
int ret;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(name, "Name");
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
BT_LIB_LOGI("Creating source component class: "
"name=\"%s\", %![msg-iter-cls-]+I",
name, message_iterator_class);
BT_LIB_LOGI("Creating source component class: "
"name=\"%s\", %![msg-iter-cls-]+I",
name, message_iterator_class);
int ret;
BT_ASSERT_PRE_NO_ERROR();
int ret;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(name, "Name");
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
BT_LIB_LOGI("Creating filter component class: "
"name=\"%s\", %![msg-iter-cls-]+I",
name, message_iterator_class);
BT_LIB_LOGI("Creating filter component class: "
"name=\"%s\", %![msg-iter-cls-]+I",
name, message_iterator_class);
int ret;
BT_ASSERT_PRE_NO_ERROR();
int ret;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_NON_NULL(method, "Consume next method");
BT_LOGI("Creating sink component class: "
"name=\"%s\", consume-method-addr=%p",
BT_ASSERT_PRE_NON_NULL(method, "Consume next method");
BT_LOGI("Creating sink component class: "
"name=\"%s\", consume-method-addr=%p",
bt_component_class_source_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_source_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: "
bt_component_class_filter_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: "
bt_component_class_sink_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_get_supported_mip_versions_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.get_supported_mip_versions = method;
BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: "
bt_component_class_source_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_source_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set source component class's initialization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set source component class's initialization method: "
bt_component_class_filter_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set filter component class's initialization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set filter component class's initialization method: "
bt_component_class_sink_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set sink component class's initialization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.init = method;
BT_LIB_LOGD("Set sink component class's initialization method: "
bt_component_class_source_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_source_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set source component class's finalization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set source component class's finalization method: "
bt_component_class_filter_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set filter component class's finalization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set filter component class's finalization method: "
bt_component_class_sink_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set sink component class's finalization method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.finalize = method;
BT_LIB_LOGD("Set sink component class's finalization method: "
bt_component_class_source_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_source_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set source component class's query method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set source component class's query method: "
bt_component_class_filter_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set filter component class's query method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set filter component class's query method: "
bt_component_class_sink_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_query_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set sink component class's query method: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.query = method;
BT_LIB_LOGD("Set sink component class's query method: "
bt_component_class_filter_input_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_input_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.input_port_connected = method;
BT_LIB_LOGD("Set filter component class's \"input port connected\" method"
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.input_port_connected = method;
BT_LIB_LOGD("Set filter component class's \"input port connected\" method"
bt_component_class_sink_input_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_input_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.input_port_connected = method;
BT_LIB_LOGD("Set sink component class's \"input port connected\" method"
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.input_port_connected = method;
BT_LIB_LOGD("Set sink component class's \"input port connected\" method"
bt_component_class_source_output_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_source_output_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.output_port_connected = method;
BT_LIB_LOGD("Set source component class's \"output port connected\" method"
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.output_port_connected = method;
BT_LIB_LOGD("Set source component class's \"output port connected\" method"
bt_component_class_filter_output_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_filter_output_port_connected_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.output_port_connected = method;
BT_LIB_LOGD("Set filter component class's \"output port connected\" method"
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.output_port_connected = method;
BT_LIB_LOGD("Set filter component class's \"output port connected\" method"
bt_component_class_sink_graph_is_configured_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_component_class_sink_graph_is_configured_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.graph_is_configured = method;
BT_LIB_LOGD("Set sink component class's \"graph is configured\" method"
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
comp_cls->methods.graph_is_configured = method;
BT_LIB_LOGD("Set sink component class's \"graph is configured\" method"
const char *description)
{
BT_ASSERT_PRE_NO_ERROR();
const char *description)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(description, "Description");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_DESCR_NON_NULL(description);
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
g_string_assign(comp_cls->description, description);
BT_LIB_LOGD("Set component class's description: "
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
g_string_assign(comp_cls->description, description);
BT_LIB_LOGD("Set component class's description: "
const char *help)
{
BT_ASSERT_PRE_NO_ERROR();
const char *help)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
BT_ASSERT_PRE_NON_NULL(help, "Help");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
g_string_assign(comp_cls->help, help);
BT_ASSERT_PRE_NON_NULL(help, "Help");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
g_string_assign(comp_cls->help, help);
const char *bt_component_class_get_name(const struct bt_component_class *comp_cls)
{
const char *bt_component_class_get_name(const struct bt_component_class *comp_cls)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(comp_cls);
return comp_cls->name->str;
}
enum bt_component_class_type bt_component_class_get_type(
const struct bt_component_class *comp_cls)
{
return comp_cls->name->str;
}
enum bt_component_class_type bt_component_class_get_type(
const struct bt_component_class *comp_cls)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(comp_cls);
return comp_cls->type;
}
const char *bt_component_class_get_description(
const struct bt_component_class *comp_cls)
{
return comp_cls->type;
}
const char *bt_component_class_get_description(
const struct bt_component_class *comp_cls)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(comp_cls);
return comp_cls->description &&
comp_cls->description->str[0] != '\0' ?
comp_cls->description->str : NULL;
return comp_cls->description &&
comp_cls->description->str[0] != '\0' ?
comp_cls->description->str : NULL;
const char *bt_component_class_get_help(
const struct bt_component_class *comp_cls)
{
const char *bt_component_class_get_help(
const struct bt_component_class *comp_cls)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(comp_cls);
return comp_cls->help &&
comp_cls->help->str[0] != '\0' ? comp_cls->help->str : NULL;
}
return comp_cls->help &&
comp_cls->help->str[0] != '\0' ? comp_cls->help->str : NULL;
}
GPtrArray *comp_descr_array = NULL;
BT_ASSERT_PRE_NO_ERROR();
GPtrArray *comp_descr_array = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE(!params || bt_value_is_map(params),
- "Parameter value is not a map value: %!+v", params);
+ BT_ASSERT_PRE_COMP_DESCR_SET_NON_NULL(comp_descr_set);
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
+ BT_ASSERT_PRE_PARAM_VALUE_IS_MAP(params);
BT_LIB_LOGI("Adding component descriptor to set: "
"set-addr=%p, %![cc-]+C, "
"%![params-]+v, init-method-data-addr=%p",
BT_LIB_LOGI("Adding component descriptor to set: "
"set-addr=%p, %![cc-]+C, "
"%![params-]+v, init-method-data-addr=%p",
{
struct bt_component_class *cls;
{
struct bt_component_class *cls;
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
cls = component->parent.class;
cls = component->parent.class;
{
struct bt_component_class *cls;
{
struct bt_component_class *cls;
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
cls = component->parent.class;
cls = component->parent.class;
{
struct bt_component *comp = (void *) self_comp;
{
struct bt_component *comp = (void *) self_comp;
- BT_ASSERT_PRE_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_COMP_NON_NULL(comp);
return (bt_bool) bt_graph_is_interrupted(
bt_component_borrow_graph(comp));
}
return (bt_bool) bt_graph_is_interrupted(
bt_component_borrow_graph(comp));
}
{
struct bt_component_class *cls;
{
struct bt_component_class *cls;
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
cls = component->parent.class;
cls = component->parent.class;
enum bt_component_class_type bt_component_get_class_type(
const struct bt_component *component)
{
enum bt_component_class_type bt_component_get_class_type(
const struct bt_component *component)
{
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
return component->class->type;
}
return component->class->type;
}
struct bt_graph *graph = NULL;
enum bt_self_component_add_port_status status;
struct bt_graph *graph = NULL;
enum bt_self_component_add_port_status status;
- BT_ASSERT_PRE_NON_NULL(component, "Component");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_COMP_NON_NULL(component);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE(strlen(name) > 0, "Name is empty");
graph = bt_component_borrow_graph(component);
BT_ASSERT_PRE(
BT_ASSERT_PRE(strlen(name) > 0, "Name is empty");
graph = bt_component_borrow_graph(component);
BT_ASSERT_PRE(
BT_HIDDEN
uint64_t bt_component_get_input_port_count(const struct bt_component *comp)
{
BT_HIDDEN
uint64_t bt_component_get_input_port_count(const struct bt_component *comp)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(comp);
return (uint64_t) comp->input_ports->len;
}
BT_HIDDEN
uint64_t bt_component_get_output_port_count(const struct bt_component *comp)
{
return (uint64_t) comp->input_ports->len;
}
BT_HIDDEN
uint64_t bt_component_get_output_port_count(const struct bt_component *comp)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(comp);
return (uint64_t) comp->output_ports->len;
}
return (uint64_t) comp->output_ports->len;
}
const char *bt_component_get_name(const struct bt_component *component)
{
const char *bt_component_get_name(const struct bt_component *component)
{
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
return component->name->str;
}
const struct bt_component_class *bt_component_borrow_class_const(
const struct bt_component *component)
{
return component->name->str;
}
const struct bt_component_class *bt_component_borrow_class_const(
const struct bt_component *component)
{
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
return component->class;
}
return component->class;
}
{
struct bt_component *component = (void *) self_comp;
{
struct bt_component *component = (void *) self_comp;
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
return component->user_data;
}
return component->user_data;
}
{
struct bt_component *component = (void *) self_comp;
{
struct bt_component *component = (void *) self_comp;
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
component->user_data = data;
BT_LIB_LOGD("Set component's user data: %!+c", component);
}
component->user_data = data;
BT_LIB_LOGD("Set component's user data: %!+c", component);
}
struct bt_port_output *bt_component_borrow_output_port_by_name(
struct bt_component *comp, const char *name)
{
struct bt_port_output *bt_component_borrow_output_port_by_name(
struct bt_component *comp, const char *name)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(comp);
return (void *)
borrow_port_by_name(comp->output_ports, name);
}
return (void *)
borrow_port_by_name(comp->output_ports, name);
}
struct bt_port_input *bt_component_borrow_input_port_by_index(
struct bt_component *comp, uint64_t index)
{
struct bt_port_input *bt_component_borrow_input_port_by_index(
struct bt_component *comp, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(comp);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->input_ports->len);
return (void *)
borrow_port_by_index(comp->input_ports, index);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->input_ports->len);
return (void *)
borrow_port_by_index(comp->input_ports, index);
struct bt_port_output *bt_component_borrow_output_port_by_index(
struct bt_component *comp, uint64_t index)
{
struct bt_port_output *bt_component_borrow_output_port_by_index(
struct bt_component *comp, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(comp);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->output_ports->len);
return (void *)
borrow_port_by_index(comp->output_ports, index);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->output_ports->len);
return (void *)
borrow_port_by_index(comp->output_ports, index);
bt_logging_level bt_component_get_logging_level(
const struct bt_component *component)
{
bt_logging_level bt_component_get_logging_level(
const struct bt_component *component)
{
- BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+ BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
return component->log_level;
}
return component->log_level;
}
{
struct bt_component *comp = (void *) self_component;
{
struct bt_component *comp = (void *) self_component;
- BT_ASSERT_PRE_NON_NULL(self_component, "Component");
+ BT_ASSERT_PRE_COMP_NON_NULL(self_component);
return bt_component_borrow_graph(comp)->mip_version;
}
return bt_component_borrow_graph(comp)->mip_version;
}
const struct bt_port_output *bt_connection_borrow_upstream_port_const(
const struct bt_connection *connection)
{
const struct bt_port_output *bt_connection_borrow_upstream_port_const(
const struct bt_connection *connection)
{
- BT_ASSERT_PRE_DEV_NON_NULL(connection, "Connection");
+ BT_ASSERT_PRE_DEV_CONN_NON_NULL(connection);
return (void *) connection->upstream_port;
}
const struct bt_port_input *bt_connection_borrow_downstream_port_const(
const struct bt_connection *connection)
{
return (void *) connection->upstream_port;
}
const struct bt_port_input *bt_connection_borrow_downstream_port_const(
const struct bt_connection *connection)
{
- BT_ASSERT_PRE_DEV_NON_NULL(connection, "Connection");
+ BT_ASSERT_PRE_DEV_CONN_NON_NULL(connection);
return (void *) connection->downstream_port;
}
return (void *) connection->downstream_port;
}
bool init_can_consume;
BT_ASSERT_PRE_NO_ERROR();
bool init_can_consume;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE_NON_NULL(upstream_port, "Upstream port");
BT_ASSERT_PRE_NON_NULL(downstream_port, "Downstream port port");
BT_ASSERT_PRE(
BT_ASSERT_PRE_NON_NULL(upstream_port, "Upstream port");
BT_ASSERT_PRE_NON_NULL(downstream_port, "Downstream port port");
BT_ASSERT_PRE(
enum bt_graph_run_once_status status;
BT_ASSERT_PRE_NO_ERROR();
enum bt_graph_run_once_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_DEV_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE_DEV(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE_DEV(graph->config_state !=
BT_ASSERT_PRE_DEV(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE_DEV(graph->config_state !=
enum bt_graph_run_status status;
BT_ASSERT_PRE_NO_ERROR();
enum bt_graph_run_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY,
BT_ASSERT_PRE(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY,
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.source_output_port_added, listener);
listener_id = graph->listeners.source_output_port_added->len - 1;
BT_LIB_LOGD("Added \"source component output port added\" listener to graph: "
g_array_append_val(graph->listeners.source_output_port_added, listener);
listener_id = graph->listeners.source_output_port_added->len - 1;
BT_LIB_LOGD("Added \"source component output port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.filter_output_port_added, listener);
listener_id = graph->listeners.filter_output_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component output port added\" listener to graph: "
g_array_append_val(graph->listeners.filter_output_port_added, listener);
listener_id = graph->listeners.filter_output_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component output port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.filter_input_port_added, listener);
listener_id = graph->listeners.filter_input_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component input port added\" listener to graph: "
g_array_append_val(graph->listeners.filter_input_port_added, listener);
listener_id = graph->listeners.filter_input_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component input port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.sink_input_port_added, listener);
listener_id = graph->listeners.sink_input_port_added->len - 1;
BT_LIB_LOGD("Added \"sink component input port added\" listener to graph: "
g_array_append_val(graph->listeners.sink_input_port_added, listener);
listener_id = graph->listeners.sink_input_port_added->len - 1;
BT_LIB_LOGD("Added \"sink component input port added\" listener to graph: "
struct bt_value *new_params = NULL;
BT_ASSERT(comp_cls);
struct bt_value *new_params = NULL;
BT_ASSERT(comp_cls);
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE(
graph->config_state == BT_GRAPH_CONFIGURATION_STATE_CONFIGURING,
"Graph is not in the \"configuring\" state: %!+g", graph);
BT_ASSERT_PRE(!component_name_exists(graph, name),
"Duplicate component name: %!+g, name=\"%s\"", graph, name);
BT_ASSERT_PRE(
graph->config_state == BT_GRAPH_CONFIGURATION_STATE_CONFIGURING,
"Graph is not in the \"configuring\" state: %!+g", graph);
BT_ASSERT_PRE(!component_name_exists(graph, name),
"Duplicate component name: %!+g, name=\"%s\"", graph, name);
- BT_ASSERT_PRE(!params || bt_value_is_map(params),
- "Parameter value is not a map value: %!+v", params);
+ BT_ASSERT_PRE_PARAM_VALUE_IS_MAP(params);
init_can_consume = graph->can_consume;
bt_graph_set_can_consume(graph, false);
BT_LIB_LOGI("Adding component to graph: "
init_can_consume = graph->can_consume;
bt_graph_set_can_consume(graph, false);
BT_LIB_LOGI("Adding component to graph: "
const struct bt_component_source **component)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_component_source **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
const struct bt_component_filter **component)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_component_filter **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
const struct bt_component_sink **component)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_component_sink **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
struct bt_graph *graph, const struct bt_interrupter *intr)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_graph *graph, const struct bt_interrupter *intr)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
g_ptr_array_add(graph->interrupters, (void *) intr);
bt_object_get_ref_no_null_check(intr);
BT_LIB_LOGD("Added interrupter to graph: %![graph-]+g, %![intr-]+z",
g_ptr_array_add(graph->interrupters, (void *) intr);
bt_object_get_ref_no_null_check(intr);
BT_LIB_LOGD("Added interrupter to graph: %![graph-]+g, %![intr-]+z",
struct bt_interrupter *bt_graph_borrow_default_interrupter(bt_graph *graph)
{
struct bt_interrupter *bt_graph_borrow_default_interrupter(bt_graph *graph)
{
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
return graph->default_interrupter;
}
return graph->default_interrupter;
}
void bt_interrupter_set(struct bt_interrupter *intr)
{
void bt_interrupter_set(struct bt_interrupter *intr)
{
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
intr->is_set = true;
}
void bt_interrupter_reset(struct bt_interrupter *intr)
{
intr->is_set = true;
}
void bt_interrupter_reset(struct bt_interrupter *intr)
{
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
intr->is_set = false;
}
bt_bool bt_interrupter_is_set(const struct bt_interrupter *intr)
{
intr->is_set = false;
}
bt_bool bt_interrupter_is_set(const struct bt_interrupter *intr)
{
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
return (bt_bool) intr->is_set;
}
return (bt_bool) intr->is_set;
}
#define BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(_iter) \
BT_ASSERT_PRE((_iter)->state == BT_MESSAGE_ITERATOR_STATE_ACTIVE || \
#define BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(_iter) \
BT_ASSERT_PRE((_iter)->state == BT_MESSAGE_ITERATOR_STATE_ACTIVE || \
- (_iter)->state == BT_MESSAGE_ITERATOR_STATE_ENDED || \
+ (_iter)->state == BT_MESSAGE_ITERATOR_STATE_ENDED || \
(_iter)->state == BT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_AGAIN || \
(_iter)->state == BT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR, \
"Message iterator is in the wrong state: %!+i", _iter)
(_iter)->state == BT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_AGAIN || \
(_iter)->state == BT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR, \
"Message iterator is in the wrong state: %!+i", _iter)
struct bt_component_class_with_iterator_class *upstream_comp_cls_with_iter_cls;
int status;
struct bt_component_class_with_iterator_class *upstream_comp_cls_with_iter_cls;
int status;
- BT_ASSERT_PRE_NON_NULL(message_iterator, "Created message iterator");
+ BT_ASSERT_PRE_NON_NULL(message_iterator,
+ "Created message iterator (output)");
BT_ASSERT_PRE_NON_NULL(port, "Input port");
comp = bt_port_borrow_component_inline(port);
BT_ASSERT_PRE(bt_port_is_connected(port),
BT_ASSERT_PRE_NON_NULL(port, "Input port");
comp = bt_port_borrow_component_inline(port);
BT_ASSERT_PRE(bt_port_is_connected(port),
struct bt_message_iterator **message_iterator)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_message_iterator **message_iterator)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(self_msg_iter);
return create_self_component_input_port_message_iterator(self_msg_iter,
input_port, message_iterator);
}
return create_self_component_input_port_message_iterator(self_msg_iter,
input_port, message_iterator);
}
struct bt_message_iterator *iterator =
(void *) self_iterator;
struct bt_message_iterator *iterator =
(void *) self_iterator;
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
return iterator->user_data;
}
return iterator->user_data;
}
struct bt_message_iterator *iterator =
(void *) self_iterator;
struct bt_message_iterator *iterator =
(void *) self_iterator;
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
iterator->user_data = data;
BT_LIB_LOGD("Set message iterator's user data: "
"%!+i, user-data-addr=%p", iterator, data);
iterator->user_data = data;
BT_LIB_LOGD("Set message iterator's user data: "
"%!+i, user-data-addr=%p", iterator, data);
enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_DEV_NO_ERROR();
enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
BT_ASSERT_PRE_DEV(iterator->state ==
BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
BT_ASSERT_PRE_DEV(iterator->state ==
bt_message_iterator_borrow_component(
struct bt_message_iterator *iterator)
{
bt_message_iterator_borrow_component(
struct bt_message_iterator *iterator)
{
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
return iterator->upstream_component;
}
return iterator->upstream_component;
}
struct bt_message_iterator *iterator =
(void *) self_iterator;
struct bt_message_iterator *iterator =
(void *) self_iterator;
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
return (void *) iterator->upstream_component;
}
return (void *) iterator->upstream_component;
}
struct bt_message_iterator *iterator =
(void *) self_iterator;
struct bt_message_iterator *iterator =
(void *) self_iterator;
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_DEV_MSG_ITER_NON_NULL(iterator);
return (void *) iterator->upstream_port;
}
return (void *) iterator->upstream_port;
}
enum bt_message_iterator_can_seek_ns_from_origin_status status;
BT_ASSERT_PRE_NO_ERROR();
enum bt_message_iterator_can_seek_ns_from_origin_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
+ BT_ASSERT_PRE_RES_OUT_NON_NULL(can_seek);
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
enum bt_message_iterator_can_seek_beginning_status status;
BT_ASSERT_PRE_NO_ERROR();
enum bt_message_iterator_can_seek_beginning_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
+ BT_ASSERT_PRE_RES_OUT_NON_NULL(can_seek);
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
int status;
BT_ASSERT_PRE_NO_ERROR();
int status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
bt_message_iterator_can_seek_forward(
bt_message_iterator *iterator)
{
bt_message_iterator_can_seek_forward(
bt_message_iterator *iterator)
{
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
return iterator->config.can_seek_forward;
}
return iterator->config.can_seek_forward;
}
bt_bool can_seek_by_itself;
BT_ASSERT_PRE_NO_ERROR();
bt_bool can_seek_by_itself;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
bt_component_borrow_graph(iterator->upstream_component)->config_state !=
const struct bt_message_iterator *iterator =
(const void *) self_msg_iter;
const struct bt_message_iterator *iterator =
(const void *) self_msg_iter;
- BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(iterator);
return (bt_bool) bt_graph_is_interrupted(iterator->graph);
}
return (bt_bool) bt_graph_is_interrupted(iterator->graph);
}
bt_message_iterator_class_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_message_iterator_class_initialize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.initialize = method;
BT_LIB_LOGD("Set message iterator class's iterator initialization method"
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.initialize = method;
BT_LIB_LOGD("Set message iterator class's iterator initialization method"
bt_message_iterator_class_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_message_iterator_class_finalize_method method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
+ BT_ASSERT_PRE_METHOD_NON_NULL(method);
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.finalize = method;
BT_LIB_LOGD("Set message iterator class's finalization method"
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.finalize = method;
BT_LIB_LOGD("Set message iterator class's finalization method"
bt_message_iterator_class_can_seek_ns_from_origin_method can_seek_method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_message_iterator_class_can_seek_ns_from_origin_method can_seek_method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_ns_from_origin = seek_method;
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_ns_from_origin = seek_method;
bt_message_iterator_class_can_seek_beginning_method can_seek_method)
{
BT_ASSERT_PRE_NO_ERROR();
bt_message_iterator_class_can_seek_beginning_method can_seek_method)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+ BT_ASSERT_PRE_MSG_ITER_CLS_NON_NULL(message_iterator_class);
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_beginning = seek_method;
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_beginning = seek_method;
bool has_support;
bool need_cs;
bool has_support;
bool need_cs;
- BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(self_msg_iter);
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT(message);
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT(message);
- BT_ASSERT_PRE_DEV_HOT(message, "Message", ": %!+n", message);
+ BT_ASSERT_PRE_DEV_MSG_HOT(message);
bt_property_uint_set(&disc_items_msg->count, count);
}
bt_property_uint_set(&disc_items_msg->count, count);
}
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT_DBG(message);
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT_DBG(message);
- BT_ASSERT_PRE_DEV(disc_items_msg->stream->class->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S",
- message, disc_items_msg->stream->class);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(message,
+ disc_items_msg->stream->class);
return disc_items_msg->default_begin_cs;
}
return disc_items_msg->default_begin_cs;
}
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT_DBG(message);
struct bt_message_discarded_items *disc_items_msg = (void *) message;
BT_ASSERT_DBG(message);
- BT_ASSERT_PRE_DEV(disc_items_msg->stream->class->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S",
- message, disc_items_msg->stream->class);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(message,
+ disc_items_msg->stream->class);
return disc_items_msg->default_end_cs;
}
return disc_items_msg->default_end_cs;
}
uint64_t end_raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t end_raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_BEGIN_LE_END(message_iterator, beginning_raw_value, end_raw_value);
+ BT_ASSERT_PRE_BEGIN_LE_END(message_iterator,
+ beginning_raw_value, end_raw_value);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
struct bt_stream *bt_message_discarded_events_borrow_stream(
struct bt_message *message)
{
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_HAS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(message);
+ BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
+ BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_stream(message);
}
void bt_message_discarded_events_set_count(struct bt_message *message,
uint64_t count)
{
return borrow_discarded_items_message_stream(message);
}
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_NON_NULL(message);
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_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_message_discarded_events_borrow_beginning_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
bt_message_discarded_events_borrow_end_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
enum bt_property_availability bt_message_discarded_events_get_count(
const struct bt_message *message, uint64_t *count)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return get_discarded_items_message_count(message, count);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return get_discarded_items_message_count(message, count);
uint64_t end_raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t end_raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_BEGIN_LE_END(message_iterator, beginning_raw_value, end_raw_value);
+ BT_ASSERT_PRE_BEGIN_LE_END(message_iterator,
+ beginning_raw_value, end_raw_value);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
struct bt_stream *bt_message_discarded_packets_borrow_stream(
struct bt_message *message)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_stream(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_stream(message);
void bt_message_discarded_packets_set_count(struct bt_message *message,
uint64_t count)
{
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_NON_NULL(message);
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_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_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
msg);
bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_end_default_clock_snapshot_const(
msg);
enum bt_property_availability bt_message_discarded_packets_get_count(
const struct bt_message *message, uint64_t *count)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return get_discarded_items_message_count(message, count);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return get_discarded_items_message_count(message, count);
bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_stream_class_default_clock_class(
msg);
struct bt_event *event;
BT_ASSERT_DBG(stream);
struct bt_event *event;
BT_ASSERT_DBG(stream);
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
BT_ASSERT_PRE(event_class_has_trace(event_class),
"Event class is not part of a trace: %!+E", event_class);
BT_ASSERT_PRE_DEV(bt_event_class_borrow_stream_class(event_class) ==
BT_ASSERT_PRE(event_class_has_trace(event_class),
"Event class is not part of a trace: %!+E", event_class);
BT_ASSERT_PRE_DEV(bt_event_class_borrow_stream_class(event_class) ==
const struct bt_stream *stream)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
const struct bt_stream *stream)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
return create_event_message(msg_iter, event_class, NULL, stream, false, 0);
}
return create_event_message(msg_iter, event_class, NULL, stream, false, 0);
}
const struct bt_packet *packet)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
const struct bt_packet *packet)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(packet, "Packet");
+ BT_ASSERT_PRE_PACKET_NON_NULL(packet);
return create_event_message(msg_iter, event_class, packet,
packet->stream, false, 0);
}
return create_event_message(msg_iter, event_class, packet,
packet->stream, false, 0);
}
uint64_t raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
return create_event_message(msg_iter, event_class, NULL, stream,
true, raw_value);
}
return create_event_message(msg_iter, event_class, NULL, stream,
true, raw_value);
}
uint64_t raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t raw_value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(packet, "Packet");
+ BT_ASSERT_PRE_PACKET_NON_NULL(packet);
return create_event_message(msg_iter, event_class, packet,
packet->stream, true, raw_value);
}
return create_event_message(msg_iter, event_class, packet,
packet->stream, true, raw_value);
}
{
struct bt_message_event *event_message;
{
struct bt_message_event *event_message;
- BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_EVENT);
event_message = container_of(message,
struct bt_message_event, parent);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_EVENT);
event_message = container_of(message,
struct bt_message_event, parent);
struct bt_message_event *event_msg = (void *) msg;
struct bt_stream_class *stream_class;
struct bt_message_event *event_msg = (void *) msg;
struct bt_stream_class *stream_class;
- BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(msg);
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);
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);
- BT_ASSERT_PRE_DEV(stream_class->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S", msg, stream_class);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(msg, stream_class);
return event_msg->default_cs;
}
return event_msg->default_cs;
}
struct bt_message_event *event_msg = (void *) msg;
struct bt_stream_class *stream_class;
struct bt_message_event *event_msg = (void *) msg;
struct bt_stream_class *stream_class;
- BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(msg);
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_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
stream_class = bt_event_class_borrow_stream_class_inline(
event_msg->event->class);
struct bt_message *ret_msg = NULL;
BT_ASSERT_PRE_DEV_NO_ERROR();
struct bt_message *ret_msg = NULL;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(clock_class, "Default clock class");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
+ BT_ASSERT_PRE_DEF_CLK_CLS_NON_NULL(clock_class);
BT_LIB_LOGD("Creating message iterator inactivity message object: "
"%![iter-]+i, %![cc-]+K, value=%" PRIu64, msg_iter,
clock_class, value_cycles);
BT_LIB_LOGD("Creating message iterator inactivity message object: "
"%![iter-]+i, %![cc-]+K, value=%" PRIu64, msg_iter,
clock_class, value_cycles);
{
struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
{
struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
- BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg,
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
return inactivity->cs;
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg,
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
return inactivity->cs;
enum bt_message_type bt_message_get_type(
const struct bt_message *message)
{
enum bt_message_type bt_message_get_type(
const struct bt_message *message)
{
- BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(message);
bool need_cs;
BT_ASSERT(msg_iter);
bool need_cs;
BT_ASSERT(msg_iter);
- BT_ASSERT_PRE_NON_NULL(packet, "Packet");
+ BT_ASSERT_PRE_PACKET_NON_NULL(packet);
stream = bt_packet_borrow_stream(packet);
BT_ASSERT(stream);
stream_class = bt_stream_borrow_class(stream);
stream = bt_packet_borrow_stream(packet);
BT_ASSERT(stream);
stream_class = bt_stream_borrow_class(stream);
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, false, 0);
}
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, false, 0);
}
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, true, raw_value);
}
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, true, raw_value);
}
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, false, 0);
}
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, false, 0);
}
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
(void *) self_msg_iter;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(msg_iter);
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, true, raw_value);
}
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, true, raw_value);
}
{
struct bt_message_packet *packet_msg = (void *) message;
{
struct bt_message_packet *packet_msg = (void *) message;
- BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_PACKET_BEGINNING);
return packet_msg->packet;
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_PACKET_BEGINNING);
return packet_msg->packet;
{
struct bt_message_packet *packet_msg = (void *) message;
{
struct bt_message_packet *packet_msg = (void *) message;
- BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+ BT_ASSERT_PRE_DEV_MSG_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_PACKET_END);
return packet_msg->packet;
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_PACKET_END);
return packet_msg->packet;
struct bt_message_packet *packet_msg = (void *) message;
BT_ASSERT_DBG(message);
struct bt_message_packet *packet_msg = (void *) message;
BT_ASSERT_DBG(message);
- BT_ASSERT_PRE_DEV(
- packet_msg->packet->stream->class->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S",
- message, packet_msg->packet->stream->class);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(message,
+ packet_msg->packet->stream->class);
return packet_msg->default_cs;
}
return packet_msg->default_cs;
}
bt_message_packet_beginning_borrow_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
return borrow_packet_message_default_clock_snapshot_const(msg);
}
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
return borrow_packet_message_default_clock_snapshot_const(msg);
}
bt_message_packet_end_borrow_default_clock_snapshot_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
return borrow_packet_message_default_clock_snapshot_const(msg);
}
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
return borrow_packet_message_default_clock_snapshot_const(msg);
}
bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
return borrow_packet_message_stream_class_default_clock_class(msg);
}
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
return borrow_packet_message_stream_class_default_clock_class(msg);
}
bt_message_packet_end_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
return borrow_packet_message_stream_class_default_clock_class(msg);
}
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
return borrow_packet_message_stream_class_default_clock_class(msg);
}
struct bt_message_stream *message;
struct bt_stream_class *stream_class;
struct bt_message_stream *message;
struct bt_stream_class *stream_class;
- BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_MSG_ITER_NON_NULL(self_msg_iter);
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
BT_LIB_LOGD("Creating stream message object: "
stream_class = bt_stream_borrow_class(stream);
BT_ASSERT(stream_class);
BT_LIB_LOGD("Creating stream message object: "
struct bt_stream *bt_message_stream_beginning_borrow_stream(
struct bt_message *message)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return borrow_stream_message_stream(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return borrow_stream_message_stream(message);
struct bt_stream *bt_message_stream_end_borrow_stream(
struct bt_message *message)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_END);
return borrow_stream_message_stream(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_END);
return borrow_stream_message_stream(message);
BT_ASSERT_PRE_DEV_HOT(msg, "Message", ": %!+n", msg);
sc = stream_msg->stream->class;
BT_ASSERT(sc);
BT_ASSERT_PRE_DEV_HOT(msg, "Message", ": %!+n", msg);
sc = stream_msg->stream->class;
BT_ASSERT(sc);
- BT_ASSERT_PRE(sc->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S", msg, sc);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(msg, sc);
BT_ASSERT(stream_msg->default_cs);
bt_clock_snapshot_set_raw_value(stream_msg->default_cs, raw_value);
stream_msg->default_cs_state = BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN;
BT_ASSERT(stream_msg->default_cs);
bt_clock_snapshot_set_raw_value(stream_msg->default_cs, raw_value);
stream_msg->default_cs_state = BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN;
void bt_message_stream_beginning_set_default_clock_snapshot(
struct bt_message *message, uint64_t raw_value)
{
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_NON_NULL(message);
BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING);
bt_message_stream_set_default_clock_snapshot(message, raw_value);
BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING);
bt_message_stream_set_default_clock_snapshot(message, raw_value);
void bt_message_stream_end_set_default_clock_snapshot(
struct bt_message *message, uint64_t raw_value)
{
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_NON_NULL(message);
BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
return bt_message_stream_set_default_clock_snapshot(message, raw_value);
BT_ASSERT_PRE_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
return bt_message_stream_set_default_clock_snapshot(message, raw_value);
BT_ASSERT_DBG(msg);
sc = stream_msg->stream->class;
BT_ASSERT_DBG(sc);
BT_ASSERT_DBG(msg);
sc = stream_msg->stream->class;
BT_ASSERT_DBG(sc);
- BT_ASSERT_PRE_DEV(sc->default_clock_class,
- "Message's stream's class has no default clock class: "
- "%![msg-]+n, %![sc-]+S", msg, sc);
+ BT_ASSERT_PRE_DEV_MSG_SC_DEF_CLK_CLS(msg, sc);
BT_ASSERT_DBG(stream_msg->default_cs);
*snapshot = stream_msg->default_cs;
BT_ASSERT_DBG(stream_msg->default_cs);
*snapshot = stream_msg->default_cs;
bt_message_stream_beginning_borrow_default_clock_snapshot_const(
const bt_message *message, const bt_clock_snapshot **snapshot)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return bt_message_stream_borrow_default_clock_snapshot_const(
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return bt_message_stream_borrow_default_clock_snapshot_const(
bt_message_stream_end_borrow_default_clock_snapshot_const(
const bt_message *message, const bt_clock_snapshot **snapshot)
{
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_NON_NULL(message);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
return bt_message_stream_borrow_default_clock_snapshot_const(
message, snapshot);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
return bt_message_stream_borrow_default_clock_snapshot_const(
message, snapshot);
bt_message_stream_beginning_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(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_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
return borrow_stream_message_stream_class_default_clock_class(msg);
bt_message_stream_end_borrow_stream_class_default_clock_class_const(
const struct bt_message *msg)
{
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_NON_NULL(msg);
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
return borrow_stream_message_stream_class_default_clock_class(msg);
}
BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
return borrow_stream_message_stream_class_default_clock_class(msg);
}
int status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
int status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
+ BT_ASSERT_PRE_COMP_DESCR_SET_NON_NULL(comp_descr_set);
BT_ASSERT_PRE_NON_NULL(operative_mip_version,
"Operative MIP version (output)");
BT_ASSERT_PRE(comp_descr_set->sources->len +
BT_ASSERT_PRE_NON_NULL(operative_mip_version,
"Operative MIP version (output)");
BT_ASSERT_PRE(comp_descr_set->sources->len +
const char *bt_port_get_name(const struct bt_port *port)
{
const char *bt_port_get_name(const struct bt_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return port->name->str;
}
enum bt_port_type bt_port_get_type(const struct bt_port *port)
{
return port->name->str;
}
enum bt_port_type bt_port_get_type(const struct bt_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return port->type;
}
const struct bt_connection *bt_port_borrow_connection_const(
const struct bt_port *port)
{
return port->type;
}
const struct bt_connection *bt_port_borrow_connection_const(
const struct bt_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return port->connection;
}
const struct bt_component *bt_port_borrow_component_const(
const struct bt_port *port)
{
return port->connection;
}
const struct bt_component *bt_port_borrow_component_const(
const struct bt_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return bt_port_borrow_component_inline(port);
}
struct bt_self_component *bt_self_component_port_borrow_component(
struct bt_self_component_port *port)
{
return bt_port_borrow_component_inline(port);
}
struct bt_self_component *bt_self_component_port_borrow_component(
struct bt_self_component_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return (void *) bt_object_borrow_parent((void *) port);
}
return (void *) bt_object_borrow_parent((void *) port);
}
bt_bool bt_port_is_connected(const struct bt_port *port)
{
bt_bool bt_port_is_connected(const struct bt_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return port->connection ? BT_TRUE : BT_FALSE;
}
void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
{
return port->connection ? BT_TRUE : BT_FALSE;
}
void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
{
- BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
+ BT_ASSERT_PRE_DEV_PORT_NON_NULL(port);
return ((struct bt_port *) port)->user_data;
}
return ((struct bt_port *) port)->user_data;
}
struct bt_query_executor *query_exec;
BT_ASSERT_PRE_NO_ERROR();
struct bt_query_executor *query_exec;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
BT_ASSERT_PRE_NON_NULL(object, "Object");
BT_LIB_LOGD("Creating query executor: "
"%![comp-cls-]+C, object=\"%s\", %![params-]+v",
BT_ASSERT_PRE_NON_NULL(object, "Object");
BT_LIB_LOGD("Creating query executor: "
"%![comp-cls-]+C, object=\"%s\", %![params-]+v",
method_t method = NULL;
BT_ASSERT_PRE_NO_ERROR();
method_t method = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
- BT_ASSERT_PRE_NON_NULL(user_result, "Result (output)");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
+ BT_ASSERT_PRE_RES_OUT_NON_NULL(user_result);
/*
* Initial check: is the query executor already interrupted? If
/*
* Initial check: is the query executor already interrupted? If
const struct bt_interrupter *intr)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_interrupter *intr)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
g_ptr_array_add(query_exec->interrupters, (void *) intr);
bt_object_get_ref_no_null_check(intr);
BT_LIB_LOGD("Added interrupter to query executor: "
g_ptr_array_add(query_exec->interrupters, (void *) intr);
bt_object_get_ref_no_null_check(intr);
BT_LIB_LOGD("Added interrupter to query executor: "
bt_bool bt_query_executor_is_interrupted(const struct bt_query_executor *query_exec)
{
bt_bool bt_query_executor_is_interrupted(const struct bt_query_executor *query_exec)
{
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
return (bt_bool) bt_interrupter_array_any_is_set(
query_exec->interrupters);
}
return (bt_bool) bt_interrupter_array_any_is_set(
query_exec->interrupters);
}
struct bt_interrupter *bt_query_executor_borrow_default_interrupter(
struct bt_query_executor *query_exec)
{
struct bt_interrupter *bt_query_executor_borrow_default_interrupter(
struct bt_query_executor *query_exec)
{
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
return query_exec->default_interrupter;
}
return query_exec->default_interrupter;
}
bt_query_executor_set_logging_level(struct bt_query_executor *query_exec,
enum bt_logging_level log_level)
{
bt_query_executor_set_logging_level(struct bt_query_executor *query_exec,
enum bt_logging_level log_level)
{
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
query_exec->log_level = log_level;
return BT_FUNC_STATUS_OK;
}
query_exec->log_level = log_level;
return BT_FUNC_STATUS_OK;
}
enum bt_logging_level bt_query_executor_get_logging_level(
const struct bt_query_executor *query_exec)
{
enum bt_logging_level bt_query_executor_get_logging_level(
const struct bt_query_executor *query_exec)
{
- BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
+ BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec);
return query_exec->log_level;
}
return query_exec->log_level;
}
{
const struct bt_integer_range *range = (const void *) u_range;
{
const struct bt_integer_range *range = (const void *) u_range;
- BT_ASSERT_PRE_DEV_NON_NULL(range, "Integer range");
+ BT_ASSERT_PRE_DEV_INT_RANGE_NON_NULL(range);
{
const struct bt_integer_range *range = (const void *) u_range;
{
const struct bt_integer_range *range = (const void *) u_range;
- BT_ASSERT_PRE_DEV_NON_NULL(range, "Integer range");
+ BT_ASSERT_PRE_DEV_INT_RANGE_NON_NULL(range);
{
const struct bt_integer_range *range = (const void *) i_range;
{
const struct bt_integer_range *range = (const void *) i_range;
- BT_ASSERT_PRE_DEV_NON_NULL(range, "Integer range");
+ BT_ASSERT_PRE_DEV_INT_RANGE_NON_NULL(range);
{
const struct bt_integer_range *range = (const void *) i_range;
{
const struct bt_integer_range *range = (const void *) i_range;
- BT_ASSERT_PRE_DEV_NON_NULL(range, "Integer range");
+ BT_ASSERT_PRE_DEV_INT_RANGE_NON_NULL(range);
uint64_t bt_integer_range_set_get_range_count(
const bt_integer_range_set *range_set)
{
uint64_t bt_integer_range_set_get_range_count(
const bt_integer_range_set *range_set)
{
- BT_ASSERT_PRE_DEV_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_DEV_INT_RANGE_SET_NON_NULL(range_set);
return (uint64_t) range_set->ranges->len;
}
return (uint64_t) range_set->ranges->len;
}
const struct bt_integer_range_set *range_set =
(const void *) u_range_set;
const struct bt_integer_range_set *range_set =
(const void *) u_range_set;
- BT_ASSERT_PRE_DEV_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_DEV_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, range_set->ranges->len);
return (const void *) BT_INTEGER_RANGE_SET_RANGE_AT_INDEX(range_set,
index);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, range_set->ranges->len);
return (const void *) BT_INTEGER_RANGE_SET_RANGE_AT_INDEX(range_set,
index);
const struct bt_integer_range_set *range_set =
(const void *) i_range_set;
const struct bt_integer_range_set *range_set =
(const void *) i_range_set;
- BT_ASSERT_PRE_DEV_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_DEV_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, range_set->ranges->len);
return (const void *) BT_INTEGER_RANGE_SET_RANGE_AT_INDEX(range_set,
index);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, range_set->ranges->len);
return (const void *) BT_INTEGER_RANGE_SET_RANGE_AT_INDEX(range_set,
index);
- BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE_DEV_HOT(range_set, "Integer range set", ": %!+R",
range_set);
g_array_append_val(range_set->ranges, range);
BT_ASSERT_PRE_DEV_HOT(range_set, "Integer range set", ": %!+R",
range_set);
g_array_append_val(range_set->ranges, range);
uint64_t bt_plugin_set_get_plugin_count(const struct bt_plugin_set *plugin_set)
{
uint64_t bt_plugin_set_get_plugin_count(const struct bt_plugin_set *plugin_set)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
+ BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(plugin_set);
return (uint64_t) plugin_set->plugins->len;
}
const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const(
const struct bt_plugin_set *plugin_set, uint64_t index)
{
return (uint64_t) plugin_set->plugins->len;
}
const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const(
const struct bt_plugin_set *plugin_set, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
+ BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(plugin_set);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, plugin_set->plugins->len);
return g_ptr_array_index(plugin_set->plugins, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, plugin_set->plugins->len);
return g_ptr_array_index(plugin_set->plugins, index);
}
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(path, "Path");
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(path, "Path");
- BT_ASSERT_PRE_NON_NULL(path, "Plugin set (output)");
+ BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(path);
BT_LOGI("Creating plugins from file: path=\"%s\"", path);
/* Try shared object plugins */
BT_LOGI("Creating plugins from file: path=\"%s\"", path);
/* Try shared object plugins */
uint64_t dir_i, plugin_i;
BT_ASSERT_PRE_NO_ERROR();
uint64_t dir_i, plugin_i;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
+ BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(plugin_set_out);
BT_LOGI("Finding all plugins in standard directories and built-in plugins: "
"find-in-std-env-var=%d, find-in-user-dir=%d, "
"find-in-sys-dir=%d, find-in-static=%d",
BT_LOGI("Finding all plugins in standard directories and built-in plugins: "
"find-in-std-env-var=%d, find-in-user-dir=%d, "
"find-in-sys-dir=%d, find-in-static=%d",
uint64_t i;
BT_ASSERT_PRE_NO_ERROR();
uint64_t i;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(plugin_name, "Name");
- BT_ASSERT_PRE_NON_NULL(plugin_out, "Plugin (output)");
+ BT_ASSERT_PRE_NAME_NON_NULL(plugin_name);
+ BT_ASSERT_PRE_PLUGIN_OUT_NON_NULL(plugin_out);
BT_LOGI("Finding named plugin in standard directories and built-in plugins: "
"name=\"%s\", find-in-std-env-var=%d, find-in-user-dir=%d, "
"find-in-sys-dir=%d, find-in-static=%d",
BT_LOGI("Finding named plugin in standard directories and built-in plugins: "
"name=\"%s\", find-in-std-env-var=%d, find-in-user-dir=%d, "
"find-in-sys-dir=%d, find-in-static=%d",
BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
+ BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(plugin_set_out);
BT_LOGI("Creating all plugins in directory: path=\"%s\", recurse=%d",
path, recurse);
*plugin_set_out = bt_plugin_set_create();
BT_LOGI("Creating all plugins in directory: path=\"%s\", recurse=%d",
path, recurse);
*plugin_set_out = bt_plugin_set_create();
const char *bt_plugin_get_name(const struct bt_plugin *plugin)
{
const char *bt_plugin_get_name(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return plugin->info.name_set ? plugin->info.name->str : NULL;
}
const char *bt_plugin_get_author(const struct bt_plugin *plugin)
{
return plugin->info.name_set ? plugin->info.name->str : NULL;
}
const char *bt_plugin_get_author(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return plugin->info.author_set ? plugin->info.author->str : NULL;
}
const char *bt_plugin_get_license(const struct bt_plugin *plugin)
{
return plugin->info.author_set ? plugin->info.author->str : NULL;
}
const char *bt_plugin_get_license(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return plugin->info.license_set ? plugin->info.license->str : NULL;
}
const char *bt_plugin_get_path(const struct bt_plugin *plugin)
{
return plugin->info.license_set ? plugin->info.license->str : NULL;
}
const char *bt_plugin_get_path(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return plugin->info.path_set ? plugin->info.path->str : NULL;
}
const char *bt_plugin_get_description(const struct bt_plugin *plugin)
{
return plugin->info.path_set ? plugin->info.path->str : NULL;
}
const char *bt_plugin_get_description(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return plugin->info.description_set ?
plugin->info.description->str : NULL;
}
return plugin->info.description_set ?
plugin->info.description->str : NULL;
}
enum bt_property_availability avail =
BT_PROPERTY_AVAILABILITY_AVAILABLE;
enum bt_property_availability avail =
BT_PROPERTY_AVAILABILITY_AVAILABLE;
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
if (!plugin->info.version_set) {
BT_LIB_LOGD("Plugin's version is not set: %!+l", plugin);
if (!plugin->info.version_set) {
BT_LIB_LOGD("Plugin's version is not set: %!+l", plugin);
uint64_t bt_plugin_get_source_component_class_count(const struct bt_plugin *plugin)
{
uint64_t bt_plugin_get_source_component_class_count(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return (uint64_t) plugin->src_comp_classes->len;
}
uint64_t bt_plugin_get_filter_component_class_count(const struct bt_plugin *plugin)
{
return (uint64_t) plugin->src_comp_classes->len;
}
uint64_t bt_plugin_get_filter_component_class_count(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return (uint64_t) plugin->flt_comp_classes->len;
}
uint64_t bt_plugin_get_sink_component_class_count(const struct bt_plugin *plugin)
{
return (uint64_t) plugin->flt_comp_classes->len;
}
uint64_t bt_plugin_get_sink_component_class_count(const struct bt_plugin *plugin)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
return (uint64_t) plugin->sink_comp_classes->len;
}
return (uint64_t) plugin->sink_comp_classes->len;
}
const struct bt_plugin *plugin, GPtrArray *comp_classes,
uint64_t index)
{
const struct bt_plugin *plugin, GPtrArray *comp_classes,
uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp_classes->len);
return g_ptr_array_index(comp_classes, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp_classes->len);
return g_ptr_array_index(comp_classes, index);
}
struct bt_component_class *comp_class = NULL;
size_t i;
struct bt_component_class *comp_class = NULL;
size_t i;
- BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
- BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
+ BT_ASSERT_PRE_DEV_NAME_NON_NULL(name);
for (i = 0; i < comp_classes->len; i++) {
struct bt_component_class *comp_class_candidate =
for (i = 0; i < comp_classes->len; i++) {
struct bt_component_class *comp_class_candidate =
#include "lib/func-status.h"
#include "lib/value.h"
#include "lib/func-status.h"
#include "lib/value.h"
-#define BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(_cc) \
+#define BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(_cc) \
BT_ASSERT_PRE_DEV_HOT((_cc), "Clock class", ": %!+K", (_cc))
static
BT_ASSERT_PRE_DEV_HOT((_cc), "Clock class", ": %!+K", (_cc))
static
struct bt_clock_class *clock_class = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_clock_class *clock_class = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
+ BT_ASSERT_PRE_COMP_NON_NULL(self_comp);
BT_LOGD_STR("Creating default clock class object");
clock_class = g_new0(struct bt_clock_class, 1);
BT_LOGD_STR("Creating default clock class object");
clock_class = g_new0(struct bt_clock_class, 1);
const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class)
{
const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->name.value;
}
return clock_class->name.value;
}
struct bt_clock_class *clock_class, const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_clock_class *clock_class, const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
g_string_assign(clock_class->name.str, name);
clock_class->name.value = clock_class->name.str->str;
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
g_string_assign(clock_class->name.str, name);
clock_class->name.value = clock_class->name.str->str;
const char *bt_clock_class_get_description(
const struct bt_clock_class *clock_class)
{
const char *bt_clock_class_get_description(
const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->description.value;
}
return clock_class->description.value;
}
struct bt_clock_class *clock_class, const char *descr)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_clock_class *clock_class, const char *descr)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
- BT_ASSERT_PRE_NON_NULL(descr, "Description");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
+ BT_ASSERT_PRE_DESCR_NON_NULL(descr);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
g_string_assign(clock_class->description.str, descr);
clock_class->description.value = clock_class->description.str->str;
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
g_string_assign(clock_class->description.str, descr);
clock_class->description.value = clock_class->description.str->str;
uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class)
{
uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->frequency;
}
void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
uint64_t frequency)
{
return clock_class->frequency;
}
void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
uint64_t frequency)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
"Invalid frequency: %![cc-]+K, new-freq=%" PRIu64,
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
"Invalid frequency: %![cc-]+K, new-freq=%" PRIu64,
uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class)
{
uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->precision;
}
void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
uint64_t precision)
{
return clock_class->precision;
}
void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
uint64_t precision)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(precision != UINT64_C(-1),
"Invalid precision: %![cc-]+K, new-precision=%" PRIu64,
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(precision != UINT64_C(-1),
"Invalid precision: %![cc-]+K, new-precision=%" PRIu64,
void bt_clock_class_get_offset(const struct bt_clock_class *clock_class,
int64_t *seconds, uint64_t *cycles)
{
void bt_clock_class_get_offset(const struct bt_clock_class *clock_class,
int64_t *seconds, uint64_t *cycles)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_NON_NULL(seconds, "Seconds (output)");
BT_ASSERT_PRE_DEV_NON_NULL(cycles, "Cycles (output)");
*seconds = clock_class->offset_seconds;
BT_ASSERT_PRE_DEV_NON_NULL(seconds, "Seconds (output)");
BT_ASSERT_PRE_DEV_NON_NULL(cycles, "Cycles (output)");
*seconds = clock_class->offset_seconds;
void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
int64_t seconds, uint64_t cycles)
{
void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
int64_t seconds, uint64_t cycles)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(cycles < clock_class->frequency,
"Offset (cycles) is greater than clock class's frequency: "
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(cycles < clock_class->frequency,
"Offset (cycles) is greater than clock class's frequency: "
bt_bool bt_clock_class_origin_is_unix_epoch(const struct bt_clock_class *clock_class)
{
bt_bool bt_clock_class_origin_is_unix_epoch(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return (bool) clock_class->origin_is_unix_epoch;
}
void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class,
bt_bool origin_is_unix_epoch)
{
return (bool) clock_class->origin_is_unix_epoch;
}
void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class,
bt_bool origin_is_unix_epoch)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
clock_class->origin_is_unix_epoch = (bool) origin_is_unix_epoch;
BT_LIB_LOGD("Set clock class's origin is Unix epoch property: %!+K",
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
clock_class->origin_is_unix_epoch = (bool) origin_is_unix_epoch;
BT_LIB_LOGD("Set clock class's origin is Unix epoch property: %!+K",
bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
{
bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->uuid.value;
}
void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
bt_uuid uuid)
{
return clock_class->uuid.value;
}
void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
bt_uuid uuid)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
- BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
+ BT_ASSERT_PRE_UUID_NON_NULL(uuid);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
bt_uuid_copy(clock_class->uuid.uuid, uuid);
clock_class->uuid.value = clock_class->uuid.uuid;
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
bt_uuid_copy(clock_class->uuid.uuid, uuid);
clock_class->uuid.value = clock_class->uuid.uuid;
int ret;
BT_ASSERT_PRE_DEV_NO_ERROR();
int ret;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_NON_NULL(ns, "Nanoseconds (output)");
ret = bt_util_ns_from_origin_clock_class(clock_class, cycles, ns);
if (ret) {
BT_ASSERT_PRE_DEV_NON_NULL(ns, "Nanoseconds (output)");
ret = bt_util_ns_from_origin_clock_class(clock_class, cycles, ns);
if (ret) {
const struct bt_value *bt_clock_class_borrow_user_attributes_const(
const struct bt_clock_class *clock_class)
{
const struct bt_value *bt_clock_class_borrow_user_attributes_const(
const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->user_attributes;
}
return clock_class->user_attributes;
}
struct bt_clock_class *clock_class,
const struct bt_value *user_attributes)
{
struct bt_clock_class *clock_class,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
bt_object_put_ref_no_null_check(clock_class->user_attributes);
clock_class->user_attributes = (void *) user_attributes;
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
bt_object_put_ref_no_null_check(clock_class->user_attributes);
clock_class->user_attributes = (void *) user_attributes;
uint64_t bt_clock_snapshot_get_value(
const struct bt_clock_snapshot *clock_snapshot)
{
uint64_t bt_clock_snapshot_get_value(
const struct bt_clock_snapshot *clock_snapshot)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
"Clock snapshot is not set: %!+k", clock_snapshot);
return clock_snapshot->value_cycles;
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
"Clock snapshot is not set: %!+k", clock_snapshot);
return clock_snapshot->value_cycles;
int ret = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_DEV_NO_ERROR();
int ret = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
"Clock snapshot is not set: %!+k", clock_snapshot);
BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
"Clock snapshot is not set: %!+k", clock_snapshot);
const struct bt_clock_class *bt_clock_snapshot_borrow_clock_class_const(
const struct bt_clock_snapshot *clock_snapshot)
{
const struct bt_clock_class *bt_clock_snapshot_borrow_clock_class_const(
const struct bt_clock_snapshot *clock_snapshot)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
return clock_snapshot->clock_class;
}
return clock_snapshot->clock_class;
}
#include "utils.h"
#include "lib/func-status.h"
#include "utils.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(_ec) \
+#define BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(_ec) \
BT_ASSERT_PRE_DEV_HOT(((const struct bt_event_class *) (_ec)), \
"Event class", ": %!+E", (_ec))
BT_ASSERT_PRE_DEV_HOT(((const struct bt_event_class *) (_ec)), \
"Event class", ": %!+E", (_ec))
struct bt_stream_class *stream_class)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_stream_class *stream_class)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE(stream_class->assigns_automatic_event_class_id,
"Stream class does not automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
BT_ASSERT_PRE(stream_class->assigns_automatic_event_class_id,
"Stream class does not automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
const char *bt_event_class_get_name(const struct bt_event_class *event_class)
{
const char *bt_event_class_get_name(const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->name.value;
}
return event_class->name.value;
}
struct bt_event_class *event_class, const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_event_class *event_class, const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
g_string_assign(event_class->name.str, name);
event_class->name.value = event_class->name.str->str;
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
g_string_assign(event_class->name.str, name);
event_class->name.value = event_class->name.str->str;
uint64_t bt_event_class_get_id(const struct bt_event_class *event_class)
{
uint64_t bt_event_class_get_id(const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->id;
}
return event_class->id;
}
const struct bt_event_class *event_class,
enum bt_event_class_log_level *log_level)
{
const struct bt_event_class *event_class,
enum bt_event_class_log_level *log_level)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
BT_ASSERT_PRE_DEV_NON_NULL(log_level, "Log level (output)");
*log_level = (enum bt_event_class_log_level)
event_class->log_level.value;
BT_ASSERT_PRE_DEV_NON_NULL(log_level, "Log level (output)");
*log_level = (enum bt_event_class_log_level)
event_class->log_level.value;
struct bt_event_class *event_class,
enum bt_event_class_log_level log_level)
{
struct bt_event_class *event_class,
enum bt_event_class_log_level log_level)
{
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
bt_property_uint_set(&event_class->log_level,
(uint64_t) log_level);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
bt_property_uint_set(&event_class->log_level,
(uint64_t) log_level);
const char *bt_event_class_get_emf_uri(const struct bt_event_class *event_class)
{
const char *bt_event_class_get_emf_uri(const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->emf_uri.value;
}
return event_class->emf_uri.value;
}
const char *emf_uri)
{
BT_ASSERT_PRE_NO_ERROR();
const char *emf_uri)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
g_string_assign(event_class->emf_uri.str, emf_uri);
BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
g_string_assign(event_class->emf_uri.str, emf_uri);
struct bt_stream_class *bt_event_class_borrow_stream_class(
struct bt_event_class *event_class)
{
struct bt_stream_class *bt_event_class_borrow_stream_class(
struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return bt_event_class_borrow_stream_class_inline(event_class);
}
return bt_event_class_borrow_stream_class_inline(event_class);
}
bt_event_class_borrow_specific_context_field_class_const(
const struct bt_event_class *event_class)
{
bt_event_class_borrow_specific_context_field_class_const(
const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->specific_context_fc;
}
return event_class->specific_context_fc;
}
bt_event_class_borrow_specific_context_field_class(
struct bt_event_class *event_class)
{
bt_event_class_borrow_specific_context_field_class(
struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->specific_context_fc;
}
return event_class->specific_context_fc;
}
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
- BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
+ BT_ASSERT_PRE_FC_NON_NULL(field_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
- BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE,
- "Specific context field class is not a structure field class: "
- "%!+F", field_class);
+ BT_ASSERT_PRE_FC_IS_STRUCT(field_class, "Specific context field class");
stream_class = bt_event_class_borrow_stream_class_inline(
event_class);
resolve_ctx.packet_context = stream_class->packet_context_fc;
stream_class = bt_event_class_borrow_stream_class_inline(
event_class);
resolve_ctx.packet_context = stream_class->packet_context_fc;
const struct bt_field_class *bt_event_class_borrow_payload_field_class_const(
const struct bt_event_class *event_class)
{
const struct bt_field_class *bt_event_class_borrow_payload_field_class_const(
const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->payload_fc;
}
struct bt_field_class *bt_event_class_borrow_payload_field_class(
struct bt_event_class *event_class)
{
return event_class->payload_fc;
}
struct bt_field_class *bt_event_class_borrow_payload_field_class(
struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->payload_fc;
}
return event_class->payload_fc;
}
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
- BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
+ BT_ASSERT_PRE_FC_NON_NULL(field_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
- BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE,
- "Payload field class is not a structure field class: %!+F",
- field_class);
+ BT_ASSERT_PRE_FC_IS_STRUCT(field_class, "Payload field class");
stream_class = bt_event_class_borrow_stream_class_inline(
event_class);
resolve_ctx.packet_context = stream_class->packet_context_fc;
stream_class = bt_event_class_borrow_stream_class_inline(
event_class);
resolve_ctx.packet_context = stream_class->packet_context_fc;
const struct bt_value *bt_event_class_borrow_user_attributes_const(
const struct bt_event_class *event_class)
{
const struct bt_value *bt_event_class_borrow_user_attributes_const(
const struct bt_event_class *event_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
return event_class->user_attributes;
}
return event_class->user_attributes;
}
struct bt_event_class *event_class,
const struct bt_value *user_attributes)
{
struct bt_event_class *event_class,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
bt_object_put_ref_no_null_check(event_class->user_attributes);
event_class->user_attributes = (void *) user_attributes;
bt_object_get_ref_no_null_check(event_class->user_attributes);
bt_object_put_ref_no_null_check(event_class->user_attributes);
event_class->user_attributes = (void *) user_attributes;
bt_object_get_ref_no_null_check(event_class->user_attributes);
struct bt_event_class *bt_event_borrow_class(struct bt_event *event)
{
struct bt_event_class *bt_event_borrow_class(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
struct bt_stream *bt_event_borrow_stream(struct bt_event *event)
{
struct bt_stream *bt_event_borrow_stream(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
struct bt_field *bt_event_borrow_common_context_field(struct bt_event *event)
{
struct bt_field *bt_event_borrow_common_context_field(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->common_context_field;
}
const struct bt_field *bt_event_borrow_common_context_field_const(
const struct bt_event *event)
{
return event->common_context_field;
}
const struct bt_field *bt_event_borrow_common_context_field_const(
const struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->common_context_field;
}
struct bt_field *bt_event_borrow_specific_context_field(struct bt_event *event)
{
return event->common_context_field;
}
struct bt_field *bt_event_borrow_specific_context_field(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->specific_context_field;
}
const struct bt_field *bt_event_borrow_specific_context_field_const(
const struct bt_event *event)
{
return event->specific_context_field;
}
const struct bt_field *bt_event_borrow_specific_context_field_const(
const struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->specific_context_field;
}
struct bt_field *bt_event_borrow_payload_field(struct bt_event *event)
{
return event->specific_context_field;
}
struct bt_field *bt_event_borrow_payload_field(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->payload_field;
}
const struct bt_field *bt_event_borrow_payload_field_const(
const struct bt_event *event)
{
return event->payload_field;
}
const struct bt_field *bt_event_borrow_payload_field_const(
const struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
return event->payload_field;
}
return event->payload_field;
}
struct bt_packet *bt_event_borrow_packet(struct bt_event *event)
{
struct bt_packet *bt_event_borrow_packet(struct bt_event *event)
{
- BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+ BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event);
enum bt_field_class_type bt_field_class_get_type(
const struct bt_field_class *fc)
{
enum bt_field_class_type bt_field_class_get_type(
const struct bt_field_class *fc)
{
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
struct bt_field_class_bit_array *ba_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_bit_array *ba_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_ASSERT_PRE(length > 0 && length <= 64,
"Unsupported length for bit array field class "
"(minimum is 1, maximum is 64): length=%" PRIu64, length);
BT_ASSERT_PRE(length > 0 && length <= 64,
"Unsupported length for bit array field class "
"(minimum is 1, maximum is 64): length=%" PRIu64, length);
{
const struct bt_field_class_bit_array *ba_fc = (const void *) 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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_BIT_ARRAY,
"Field class");
return ba_fc->length;
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_BIT_ARRAY,
"Field class");
return ba_fc->length;
struct bt_field_class_bool *bool_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_bool *bool_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD("Creating default boolean field class object.");
bool_fc = g_new0(struct bt_field_class_bool, 1);
if (!bool_fc) {
BT_LOGD("Creating default boolean field class object.");
bool_fc = g_new0(struct bt_field_class_bool, 1);
if (!bool_fc) {
{
struct bt_field_class_integer *int_fc = NULL;
{
struct bt_field_class_integer *int_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD("Creating default integer field class object: type=%s",
bt_common_field_class_type_string(type));
int_fc = g_new0(struct bt_field_class_integer, 1);
BT_LOGD("Creating default integer field class object: type=%s",
bt_common_field_class_type_string(type));
int_fc = g_new0(struct bt_field_class_integer, 1);
{
const struct bt_field_class_integer *int_fc = (const void *) fc;
{
const struct bt_field_class_integer *int_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
return int_fc->range;
}
BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
return int_fc->range;
}
{
struct bt_field_class_integer *int_fc = (void *) fc;
{
struct bt_field_class_integer *int_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
BT_ASSERT_PRE(size >= 1 && size <= 64,
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
BT_ASSERT_PRE(size >= 1 && size <= 64,
{
const struct bt_field_class_integer *int_fc = (const void *) fc;
{
const struct bt_field_class_integer *int_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
return int_fc->base;
}
BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
return int_fc->base;
}
{
struct bt_field_class_integer *int_fc = (void *) fc;
{
struct bt_field_class_integer *int_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
int_fc->base = base;
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
int_fc->base = base;
{
struct bt_field_class_enumeration *enum_fc = NULL;
{
struct bt_field_class_enumeration *enum_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD("Creating default enumeration field class object: type=%s",
bt_common_field_class_type_string(type));
enum_fc = g_new0(struct bt_field_class_enumeration, 1);
BT_LOGD("Creating default enumeration field class object: type=%s",
bt_common_field_class_type_string(type));
enum_fc = g_new0(struct bt_field_class_enumeration, 1);
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_ENUM(fc, "Field class");
return (uint64_t) enum_fc->mappings->len;
}
BT_ASSERT_PRE_DEV_FC_IS_ENUM(fc, "Field class");
return (uint64_t) enum_fc->mappings->len;
}
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
"Field class");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
"Field class");
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
{
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
bt_field_class_enumeration_signed_borrow_mapping_by_label_const(
const struct bt_field_class *fc, const char *label)
{
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_NON_NULL(fc);
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(
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(
bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const(
const struct bt_field_class *fc, const char *label)
{
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_NON_NULL(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(
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(
uint64_t i;
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t i;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
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_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
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_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
uint64_t i;
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t i;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
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_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
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_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT(fc);
BT_ASSERT_PRE_NON_NULL(label, "Label");
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT(fc);
BT_ASSERT_PRE_NON_NULL(label, "Label");
- BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE(!enumeration_field_class_has_mapping_with_label(
enum_fc, label),
"Duplicate mapping name in enumeration field class: "
BT_ASSERT_PRE(!enumeration_field_class_has_mapping_with_label(
enum_fc, label),
"Duplicate mapping name in enumeration field class: "
const struct bt_integer_range_set_unsigned *range_set)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_integer_range_set_unsigned *range_set)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
"Field class");
return add_mapping_to_enumeration_field_class(fc, label,
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 struct bt_integer_range_set_signed *range_set)
{
BT_ASSERT_PRE_NO_ERROR();
const struct bt_integer_range_set_signed *range_set)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
return add_mapping_to_enumeration_field_class(fc, label,
BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
return add_mapping_to_enumeration_field_class(fc, label,
{
struct bt_field_class_real *real_fc = NULL;
{
struct bt_field_class_real *real_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD("Creating default real field class object: type=%s",
bt_common_field_class_type_string(type));
real_fc = g_new0(struct bt_field_class_real, 1);
BT_LOGD("Creating default real field class object: type=%s",
bt_common_field_class_type_string(type));
real_fc = g_new0(struct bt_field_class_real, 1);
struct bt_field_class_structure *struct_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_structure *struct_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
if (!struct_fc) {
BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
if (!struct_fc) {
struct bt_named_field_class *named_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_named_field_class *named_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
named_fc = create_named_field_class(name, member_fc);
BT_ASSERT_PRE_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
named_fc = create_named_field_class(name, member_fc);
{
struct bt_field_class_structure *struct_fc = (void *) fc;
{
struct bt_field_class_structure *struct_fc = (void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (uint64_t) struct_fc->common.named_fcs->len;
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (uint64_t) struct_fc->common.named_fcs->len;
bt_field_class_structure_borrow_member_by_index_const(
const struct bt_field_class *fc, uint64_t index)
{
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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (const void *)
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (const void *)
bt_field_class_structure_borrow_member_by_index(
struct bt_field_class *fc, uint64_t index)
{
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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (void *)
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (void *)
gpointer value;
BT_ASSERT_DBG(fc);
gpointer value;
BT_ASSERT_DBG(fc);
- BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_DEV_NAME_NON_NULL(name);
if (!g_hash_table_lookup_extended(fc->name_to_index, name, &orig_key,
&value)) {
goto end;
if (!g_hash_table_lookup_extended(fc->name_to_index, name, &orig_key,
&value)) {
goto end;
bt_field_class_structure_borrow_member_by_name_const(
const struct bt_field_class *fc, const char *name)
{
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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (const void *)
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (const void *)
bt_field_class_structure_borrow_member_by_name(
struct bt_field_class *fc, const char *name)
{
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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (void *)
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
return (void *)
{
const struct bt_named_field_class *named_fc = (const void *) member;
{
const struct bt_named_field_class *named_fc = (const void *) member;
- BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_DEV_STRUCT_FC_MEMBER_NON_NULL(member);
return named_fc->name->str;
}
return named_fc->name->str;
}
{
const struct bt_named_field_class *named_fc = (const void *) member;
{
const struct bt_named_field_class *named_fc = (const void *) member;
- BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_DEV_STRUCT_FC_MEMBER_NON_NULL(member);
{
struct bt_named_field_class *named_fc = (void *) member;
{
struct bt_named_field_class *named_fc = (void *) member;
- BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_DEV_STRUCT_FC_MEMBER_NON_NULL(member);
{
struct bt_field_class_option *opt_fc = NULL;
{
struct bt_field_class_option *opt_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_ASSERT_PRE_NON_NULL(content_fc, "Content field class");
BT_LIB_LOGD("Creating option field class: "
"type=%s, %![content-fc-]+F, %![sel-fc-]+F",
BT_ASSERT_PRE_NON_NULL(content_fc, "Content field class");
BT_LIB_LOGD("Creating option field class: "
"type=%s, %![content-fc-]+F, %![sel-fc-]+F",
(const void *) u_range_set;
BT_ASSERT_PRE_NO_ERROR();
(const void *) u_range_set;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
fc = (void *) create_option_field_class(trace_class,
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
fc = (void *) create_option_field_class(trace_class,
(const void *) i_range_set;
BT_ASSERT_PRE_NO_ERROR();
(const void *) i_range_set;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(range_set);
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
fc = (void *) create_option_field_class(trace_class,
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
fc = (void *) create_option_field_class(trace_class,
{
struct bt_field_class_option *opt_fc = (void *) fc;
{
struct bt_field_class_option *opt_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_OPTION(fc, "Field class");
return opt_fc->content_fc;
}
BT_ASSERT_PRE_FC_IS_OPTION(fc, "Field class");
return opt_fc->content_fc;
}
{
struct bt_field_class_option *opt_fc = (void *) fc;
{
struct bt_field_class_option *opt_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_OPTION(fc, "Field class");
return opt_fc->content_fc;
}
BT_ASSERT_PRE_FC_IS_OPTION(fc, "Field class");
return opt_fc->content_fc;
}
const struct bt_field_class_option_with_selector_field *opt_fc =
(const void *) fc;
const struct bt_field_class_option_with_selector_field *opt_fc =
(const void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL(fc, "Field class");
return opt_fc->selector_field_path;
}
BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL(fc, "Field class");
return opt_fc->selector_field_path;
}
{
struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc;
{
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_NON_NULL(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");
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");
{
struct bt_field_class_option_with_selector_field_bool *opt_fc = (void *) fc;
{
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_NON_NULL(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_ASSERT_PRE_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD, "Field class");
return opt_fc->sel_is_reversed;
struct bt_field_class_option_with_selector_field_integer *opt_fc =
(void *) fc;
struct bt_field_class_option_with_selector_field_integer *opt_fc =
(void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL(fc, "Field class");
return (const void *) opt_fc->range_set;
}
BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL(fc, "Field class");
return (const void *) opt_fc->range_set;
}
struct bt_field_class_option_with_selector_field_integer *opt_fc =
(void *) fc;
struct bt_field_class_option_with_selector_field_integer *opt_fc =
(void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL(fc, "Field class");
return (const void *) opt_fc->range_set;
}
BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL(fc, "Field class");
return (const void *) opt_fc->range_set;
}
enum bt_field_class_type fc_type;
BT_ASSERT_PRE_NO_ERROR();
enum bt_field_class_type fc_type;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
if (selector_fc) {
BT_ASSERT_PRE_FC_IS_INT(selector_fc, "Selector field class");
if (selector_fc) {
BT_ASSERT_PRE_FC_IS_INT(selector_fc, "Selector field class");
struct bt_named_field_class *named_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_named_field_class *named_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
BT_ASSERT_PRE_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD, "Field class");
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
BT_ASSERT_PRE_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD, "Field class");
struct bt_field_class_variant_with_selector_field_option *opt = NULL;
bool has_overlap;
struct bt_field_class_variant_with_selector_field_option *opt = NULL;
bool has_overlap;
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
- BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE_INT_RANGE_SET_NON_NULL(range_set);
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);
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);
{
const struct bt_field_class_variant *var_fc = (const void *) fc;
{
const struct bt_field_class_variant *var_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (uint64_t) var_fc->common.named_fcs->len;
}
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (uint64_t) var_fc->common.named_fcs->len;
}
bt_field_class_variant_borrow_option_by_name_const(
const struct bt_field_class *fc, const char *name)
{
bt_field_class_variant_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_by_name(
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_by_name(
bt_field_class_variant_borrow_option_by_index_const(
const struct bt_field_class *fc, uint64_t index)
{
bt_field_class_variant_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_at_index(
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_at_index(
bt_field_class_variant_borrow_option_by_name(
struct bt_field_class *fc, const char *name)
{
bt_field_class_variant_borrow_option_by_name(
struct bt_field_class *fc, const char *name)
{
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_by_name(
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_by_name(
bt_field_class_variant_borrow_option_by_index(
struct bt_field_class *fc, uint64_t index)
{
bt_field_class_variant_borrow_option_by_index(
struct bt_field_class *fc, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_at_index(
BT_ASSERT_PRE_DEV_FC_IS_VARIANT(fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_at_index(
bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_name_const(
const struct bt_field_class *fc, const char *name)
{
bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_index_const(
const struct bt_field_class *fc, uint64_t index)
{
bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_const(
const struct bt_field_class *fc, const char *name)
{
bt_field_class_variant_with_selector_field_integer_signed_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_index_const(
const struct bt_field_class *fc, uint64_t index)
{
bt_field_class_variant_with_selector_field_integer_signed_borrow_option_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_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
{
const struct bt_named_field_class *named_fc = (const void *) option;
{
const struct bt_named_field_class *named_fc = (const void *) option;
- BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(option);
return named_fc->name->str;
}
return named_fc->name->str;
}
{
const struct bt_named_field_class *named_fc = (const void *) option;
{
const struct bt_named_field_class *named_fc = (const void *) option;
- BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(option);
{
struct bt_named_field_class *named_fc = (void *) option;
{
struct bt_named_field_class *named_fc = (void *) option;
- BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(option);
const struct bt_field_class_variant_with_selector_field_option *opt =
(const void *) option;
const struct bt_field_class_variant_with_selector_field_option *opt =
(const void *) option;
- BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(option);
return (const void *) opt->range_set;
}
return (const void *) opt->range_set;
}
const struct bt_field_class_variant_with_selector_field_option *opt =
(const void *) option;
const struct bt_field_class_variant_with_selector_field_option *opt =
(const void *) option;
- BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_DEV_VAR_FC_OPT_NON_NULL(option);
return (const void *) opt->range_set;
}
return (const void *) opt->range_set;
}
const struct bt_field_class_variant_with_selector_field *var_fc =
(const void *) fc;
const struct bt_field_class_variant_with_selector_field *var_fc =
(const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_VARIANT_WITH_SEL(fc, "Field class");
return var_fc->selector_field_path;
}
BT_ASSERT_PRE_DEV_FC_IS_VARIANT_WITH_SEL(fc, "Field class");
return var_fc->selector_field_path;
}
struct bt_field_class_array_static *array_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_array_static *array_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default static array field class object.");
array_fc = g_new0(struct bt_field_class_array_static, 1);
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default static array field class object.");
array_fc = g_new0(struct bt_field_class_array_static, 1);
{
const struct bt_field_class_array *array_fc = (const void *) fc;
{
const struct bt_field_class_array *array_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
return array_fc->element_fc;
}
BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
return array_fc->element_fc;
}
{
struct bt_field_class_array *array_fc = (void *) fc;
{
struct bt_field_class_array *array_fc = (void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
return array_fc->element_fc;
}
BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
return array_fc->element_fc;
}
{
const struct bt_field_class_array_static *array_fc = (const void *) fc;
{
const struct bt_field_class_array_static *array_fc = (const void *) fc;
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
"Field class");
return (uint64_t) array_fc->length;
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
"Field class");
return (uint64_t) array_fc->length;
struct bt_field_class_array_dynamic *array_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_array_dynamic *array_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default dynamic array field class object.");
array_fc = g_new0(struct bt_field_class_array_dynamic, 1);
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default dynamic array field class object.");
array_fc = g_new0(struct bt_field_class_array_dynamic, 1);
const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc;
BT_ASSERT_PRE_NO_ERROR();
const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
"Field class");
BT_ASSERT_PRE_DEV_FC_HAS_TYPE(fc,
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
"Field class");
struct bt_field_class_string *string_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_field_class_string *string_fc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
if (!string_fc) {
BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
if (!string_fc) {
const struct bt_value *bt_field_class_borrow_user_attributes_const(
const struct bt_field_class *fc)
{
const struct bt_value *bt_field_class_borrow_user_attributes_const(
const struct bt_field_class *fc)
{
- BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
return fc->user_attributes;
}
return fc->user_attributes;
}
struct bt_field_class *fc,
const struct bt_value *user_attributes)
{
struct bt_field_class *fc,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(fc, "Field class");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
"User attributes object is not a map value object.");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
"User attributes object is not a map value object.");
BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
struct bt_named_field_class *named_fc,
const struct bt_value *user_attributes)
{
struct bt_named_field_class *named_fc,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_HOT(named_fc,
"Structure field class member or variant field class option",
".");
BT_ASSERT_PRE_DEV_HOT(named_fc,
"Structure field class member or variant field class option",
".");
bt_field_class_structure_member_borrow_user_attributes_const(
const struct bt_field_class_structure_member *member)
{
bt_field_class_structure_member_borrow_user_attributes_const(
const struct bt_field_class_structure_member *member)
{
- BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
return bt_named_field_class_borrow_user_attributes_const(
(const void *) member);
}
return bt_named_field_class_borrow_user_attributes_const(
(const void *) member);
}
bt_field_class_structure_member_borrow_user_attributes(
struct bt_field_class_structure_member *member)
{
bt_field_class_structure_member_borrow_user_attributes(
struct bt_field_class_structure_member *member)
{
- BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
return (void *) bt_named_field_class_borrow_user_attributes_const(
(void *) member);
}
return (void *) bt_named_field_class_borrow_user_attributes_const(
(void *) member);
}
struct bt_field_class_structure_member *member,
const struct bt_value *user_attributes)
{
struct bt_field_class_structure_member *member,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
bt_named_field_class_set_user_attributes((void *) member,
user_attributes);
}
bt_named_field_class_set_user_attributes((void *) member,
user_attributes);
}
const struct bt_value *bt_field_class_variant_option_borrow_user_attributes_const(
const struct bt_field_class_variant_option *option)
{
const struct bt_value *bt_field_class_variant_option_borrow_user_attributes_const(
const struct bt_field_class_variant_option *option)
{
- BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
return bt_named_field_class_borrow_user_attributes_const(
(const void *) option);
}
return bt_named_field_class_borrow_user_attributes_const(
(const void *) option);
}
struct bt_value *bt_field_class_variant_option_borrow_user_attributes(
struct bt_field_class_variant_option *option)
{
struct bt_value *bt_field_class_variant_option_borrow_user_attributes(
struct bt_field_class_variant_option *option)
{
- BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
return (void *) bt_named_field_class_borrow_user_attributes_const(
(void *) option);
}
return (void *) bt_named_field_class_borrow_user_attributes_const(
(void *) option);
}
struct bt_field_class_variant_option *option,
const struct bt_value *user_attributes)
{
struct bt_field_class_variant_option *option,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
bt_named_field_class_set_user_attributes((void *) option,
user_attributes);
}
bt_named_field_class_set_user_attributes((void *) option,
user_attributes);
}
enum bt_field_path_scope bt_field_path_get_root_scope(
const struct bt_field_path *field_path)
{
enum bt_field_path_scope bt_field_path_get_root_scope(
const struct bt_field_path *field_path)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
+ BT_ASSERT_PRE_DEV_FP_NON_NULL(field_path);
return field_path->root;
}
uint64_t bt_field_path_get_item_count(const struct bt_field_path *field_path)
{
return field_path->root;
}
uint64_t bt_field_path_get_item_count(const struct bt_field_path *field_path)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
+ BT_ASSERT_PRE_DEV_FP_NON_NULL(field_path);
return (uint64_t) field_path->items->len;
}
const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const(
const struct bt_field_path *field_path, uint64_t index)
{
return (uint64_t) field_path->items->len;
}
const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const(
const struct bt_field_path *field_path, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
+ BT_ASSERT_PRE_DEV_FP_NON_NULL(field_path);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, field_path->items->len);
return bt_field_path_borrow_item_by_index_inline(field_path, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, field_path->items->len);
return bt_field_path_borrow_item_by_index_inline(field_path, index);
}
#include "field-class.h"
#include "lib/func-status.h"
#include "field-class.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_DEV_FIELD_HOT(_field, _name) \
- BT_ASSERT_PRE_DEV_HOT((const struct bt_field *) (_field), (_name), \
- ": %!+f", (_field))
+#define BT_ASSERT_PRE_DEV_FIELD_HOT(_field) \
+ BT_ASSERT_PRE_DEV_HOT((const struct bt_field *) (_field), \
+ "Field", ": %!+f", (_field))
static
void reset_single_field(struct bt_field *field);
static
void reset_single_field(struct bt_field *field);
struct bt_field_class *bt_field_borrow_class(struct bt_field *field)
{
struct bt_field_class *bt_field_borrow_class(struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
return field->class;
}
const struct bt_field_class *bt_field_borrow_class_const(
const struct bt_field *field)
{
return field->class;
}
const struct bt_field_class *bt_field_borrow_class_const(
const struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
return field->class;
}
enum bt_field_class_type bt_field_get_class_type(const struct bt_field *field)
{
return field->class;
}
enum bt_field_class_type bt_field_get_class_type(const struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
return field->class->type;
}
return field->class->type;
}
{
const struct bt_field_bool *bool_field = (const void *) field;
{
const struct bt_field_bool *bool_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_BOOL,
"Field");
return (bt_bool) bool_field->value;
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_BOOL,
"Field");
return (bt_bool) bool_field->value;
{
struct bt_field_bool *bool_field = (void *) field;
{
struct bt_field_bool *bool_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_BOOL,
"Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_BOOL,
"Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
bool_field->value = (bool) value;
bt_field_set_single(field, true);
}
bool_field->value = (bool) value;
bt_field_set_single(field, true);
}
{
const struct bt_field_bit_array *ba_field = (const void *) field;
{
const struct bt_field_bit_array *ba_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_BIT_ARRAY, "Field");
return ba_field->value_as_int;
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_BIT_ARRAY, "Field");
return ba_field->value_as_int;
struct bt_field_bit_array *ba_field = (void *) field;
struct bt_field_class_bit_array *ba_fc;
struct bt_field_bit_array *ba_field = (void *) field;
struct bt_field_class_bit_array *ba_fc;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_BIT_ARRAY, "Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_BIT_ARRAY, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
ba_fc = (void *) field->class;
ba_field->value_as_int = value;
ba_fc = (void *) field->class;
ba_field->value_as_int = value;
{
const struct bt_field_integer *int_field = (const void *) field;
{
const struct bt_field_integer *int_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
return int_field->value.i;
}
BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
return int_field->value.i;
}
{
struct bt_field_integer *int_field = (void *) field;
{
struct bt_field_integer *int_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_signed(
((struct bt_field_class_integer *) field->class)->range, value),
"Value is out of bounds: value=%" PRId64 ", %![field-]+f, "
BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_signed(
((struct bt_field_class_integer *) field->class)->range, value),
"Value is out of bounds: value=%" PRId64 ", %![field-]+f, "
{
const struct bt_field_integer *int_field = (const void *) field;
{
const struct bt_field_integer *int_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
return int_field->value.u;
}
BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
return int_field->value.u;
}
{
struct bt_field_integer *int_field = (void *) field;
{
struct bt_field_integer *int_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_unsigned(
((struct bt_field_class_integer *) field->class)->range, value),
"Value is out of bounds: value=%" PRIu64 ", %![field-]+f, "
BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_unsigned(
((struct bt_field_class_integer *) field->class)->range, value),
"Value is out of bounds: value=%" PRIu64 ", %![field-]+f, "
{
const struct bt_field_real *real_field = (const void *) field;
{
const struct bt_field_real *real_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL, "Field");
return (float) real_field->value;
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL, "Field");
return (float) real_field->value;
{
const struct bt_field_real *real_field = (const void *) field;
{
const struct bt_field_real *real_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL, "Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL, "Field");
{
struct bt_field_real *real_field = (void *) field;
{
struct bt_field_real *real_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL, "Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
real_field->value = (double) value;
bt_field_set_single(field, true);
real_field->value = (double) value;
bt_field_set_single(field, true);
{
struct bt_field_real *real_field = (void *) field;
{
struct bt_field_real *real_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL, "Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
real_field->value = value;
bt_field_set_single(field, true);
real_field->value = value;
bt_field_set_single(field, true);
const struct bt_field_integer *int_field = (const void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
const struct bt_field_integer *int_field = (const void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field");
return (int)
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field");
return (int)
const struct bt_field_integer *int_field = (const void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
const struct bt_field_integer *int_field = (const void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field");
return (int)
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field");
return (int)
{
const struct bt_field_string *string_field = (const void *) field;
{
const struct bt_field_string *string_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
return (const char *) string_field->buf->data;
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
return (const char *) string_field->buf->data;
{
const struct bt_field_string *string_field = (const void *) field;
{
const struct bt_field_string *string_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_IS_SET(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
return string_field->length;
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
return string_field->length;
struct bt_field *field, const char *value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
struct bt_field *field, const char *value)
{
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
clear_string_field(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
clear_string_field(field);
uint64_t new_length;
BT_ASSERT_PRE_DEV_NO_ERROR();
uint64_t new_length;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRING, "Field");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRING, "Field");
void bt_field_string_clear(struct bt_field *field)
{
void bt_field_string_clear(struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRING, "Field");
clear_string_field(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRING, "Field");
clear_string_field(field);
{
const struct bt_field_array *array_field = (const void *) field;
{
const struct bt_field_array *array_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
return array_field->length;
}
BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
return array_field->length;
}
struct bt_field_array *array_field = (void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
struct bt_field_array *array_field = (void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
if (G_UNLIKELY(length > array_field->fields->len)) {
/* Make more room */
if (G_UNLIKELY(length > array_field->fields->len)) {
/* Make more room */
{
struct bt_field_array *array_field = (void *) field;
{
struct bt_field_array *array_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, array_field->length);
return array_field->fields->pdata[index];
BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, array_field->length);
return array_field->fields->pdata[index];
{
struct bt_field_structure *struct_field = (void *) field;
{
struct bt_field_structure *struct_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, struct_field->fields->len);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
BT_ASSERT_PRE_DEV_VALID_INDEX(index, struct_field->fields->len);
gpointer orig_key;
gpointer index;
gpointer orig_key;
gpointer index;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_NON_NULL(name, "Field name");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(name, "Field name");
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
{
struct bt_field_option *opt_field = (void *) field;
{
struct bt_field_option *opt_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_OPTION(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_OPTION(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
if (has_field) {
opt_field->selected_field = opt_field->content_field;
if (has_field) {
opt_field->selected_field = opt_field->content_field;
{
struct bt_field_option *opt_field = (void *) field;
{
struct bt_field_option *opt_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_OPTION(field, "Field");
return opt_field->selected_field;
}
BT_ASSERT_PRE_DEV_FIELD_IS_OPTION(field, "Field");
return opt_field->selected_field;
}
{
struct bt_field_variant *var_field = (void *) field;
{
struct bt_field_variant *var_field = (void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV(var_field->selected_field,
"Variant field has no selected field: %!+f", field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV(var_field->selected_field,
"Variant field has no selected field: %!+f", field);
bt_field_variant_borrow_selected_option_class_const(
const struct bt_field *field)
{
bt_field_variant_borrow_selected_option_class_const(
const struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
return borrow_variant_field_selected_class_option(field);
}
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
return borrow_variant_field_selected_class_option(field);
}
bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_class_const(
const struct bt_field *field)
{
bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_class_const(
const struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD, "Field");
return (const void *) borrow_variant_field_selected_class_option(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD, "Field");
return (const void *) borrow_variant_field_selected_class_option(field);
bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class_const(
const struct bt_field *field)
{
bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class_const(
const struct bt_field *field)
{
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, "Field");
return (const void *) borrow_variant_field_selected_class_option(field);
BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD, "Field");
return (const void *) borrow_variant_field_selected_class_option(field);
struct bt_field_variant *var_field = (void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
struct bt_field_variant *var_field = (void *) field;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
- BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_HOT(field);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, var_field->fields->len);
var_field->selected_field = var_field->fields->pdata[index];
var_field->selected_index = index;
BT_ASSERT_PRE_DEV_VALID_INDEX(index, var_field->fields->len);
var_field->selected_field = var_field->fields->pdata[index];
var_field->selected_index = index;
{
const struct bt_field_variant *var_field = (const void *) field;
{
const struct bt_field_variant *var_field = (const void *) field;
- BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+ BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV(var_field->selected_field,
"Variant field has no selected field: %!+f", field);
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV(var_field->selected_field,
"Variant field has no selected field: %!+f", field);
struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet)
{
struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet)
{
- BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
+ BT_ASSERT_PRE_DEV_PACKET_NON_NULL(packet);
struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet)
{
struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet)
{
- BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
+ BT_ASSERT_PRE_DEV_PACKET_NON_NULL(packet);
return packet->context_field ? packet->context_field->field : NULL;
}
return packet->context_field ? packet->context_field->field : NULL;
}
struct bt_stream *stream = (void *) c_stream;
BT_ASSERT_PRE_NO_ERROR();
struct bt_stream *stream = (void *) c_stream;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
BT_ASSERT_PRE(stream->class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
stream->class);
BT_ASSERT_PRE(stream->class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
stream->class);
#include "lib/value.h"
#include "lib/func-status.h"
#include "lib/value.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(_sc) \
+#define BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(_sc) \
BT_ASSERT_PRE_DEV_HOT((_sc), "Stream class", ": %!+S", (_sc))
static
BT_ASSERT_PRE_DEV_HOT((_sc), "Stream class", ": %!+S", (_sc))
static
struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(tc);
BT_ASSERT_PRE(tc->assigns_automatic_stream_class_id,
"Trace class does not automatically assigns stream class IDs: "
"%![sc-]+T", tc);
BT_ASSERT_PRE(tc->assigns_automatic_stream_class_id,
"Trace class does not automatically assigns stream class IDs: "
"%![sc-]+T", tc);
struct bt_trace_class *tc, uint64_t id)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_trace_class *tc, uint64_t id)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(tc);
BT_ASSERT_PRE(!tc->assigns_automatic_stream_class_id,
"Trace class automatically assigns stream class IDs: "
"%![sc-]+T", tc);
BT_ASSERT_PRE(!tc->assigns_automatic_stream_class_id,
"Trace class automatically assigns stream class IDs: "
"%![sc-]+T", tc);
struct bt_trace_class *bt_stream_class_borrow_trace_class(
struct bt_stream_class *stream_class)
{
struct bt_trace_class *bt_stream_class_borrow_trace_class(
struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return bt_stream_class_borrow_trace_class_inline(stream_class);
}
return bt_stream_class_borrow_trace_class_inline(stream_class);
}
const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class)
{
const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->name.value;
}
return stream_class->name.value;
}
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
g_string_assign(stream_class->name.str, name);
stream_class->name.value = stream_class->name.str->str;
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
g_string_assign(stream_class->name.str, name);
stream_class->name.value = stream_class->name.str->str;
uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class)
{
uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->id;
}
uint64_t bt_stream_class_get_event_class_count(
const struct bt_stream_class *stream_class)
{
return stream_class->id;
}
uint64_t bt_stream_class_get_event_class_count(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (uint64_t) stream_class->event_classes->len;
}
struct bt_event_class *bt_stream_class_borrow_event_class_by_index(
struct bt_stream_class *stream_class, uint64_t index)
{
return (uint64_t) stream_class->event_classes->len;
}
struct bt_event_class *bt_stream_class_borrow_event_class_by_index(
struct bt_stream_class *stream_class, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, stream_class->event_classes->len);
return g_ptr_array_index(stream_class->event_classes, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, stream_class->event_classes->len);
return g_ptr_array_index(stream_class->event_classes, index);
}
struct bt_event_class *event_class = NULL;
uint64_t i;
struct bt_event_class *event_class = NULL;
uint64_t i;
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
for (i = 0; i < stream_class->event_classes->len; i++) {
struct bt_event_class *event_class_candidate =
for (i = 0; i < stream_class->event_classes->len; i++) {
struct bt_event_class *event_class_candidate =
bt_stream_class_borrow_packet_context_field_class_const(
const struct bt_stream_class *stream_class)
{
bt_stream_class_borrow_packet_context_field_class_const(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->packet_context_fc;
}
return stream_class->packet_context_fc;
}
bt_stream_class_borrow_packet_context_field_class(
struct bt_stream_class *stream_class)
{
bt_stream_class_borrow_packet_context_field_class(
struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->packet_context_fc;
}
return stream_class->packet_context_fc;
}
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
stream_class);
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
stream_class);
- BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
+ BT_ASSERT_PRE_FC_NON_NULL(field_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
- BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE,
- "Packet context field class is not a structure field class: %!+F",
- field_class);
+ BT_ASSERT_PRE_FC_IS_STRUCT(field_class, "Packet context field class");
ret = bt_resolve_field_paths(field_class, &resolve_ctx);
if (ret) {
/*
ret = bt_resolve_field_paths(field_class, &resolve_ctx);
if (ret) {
/*
bt_stream_class_borrow_event_common_context_field_class_const(
const struct bt_stream_class *stream_class)
{
bt_stream_class_borrow_event_common_context_field_class_const(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->event_common_context_fc;
}
return stream_class->event_common_context_fc;
}
bt_stream_class_borrow_event_common_context_field_class(
struct bt_stream_class *stream_class)
{
bt_stream_class_borrow_event_common_context_field_class(
struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->event_common_context_fc;
}
return stream_class->event_common_context_fc;
}
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_FC_NON_NULL(field_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
- BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE,
- "Event common context field class is not a structure field class: %!+F",
- field_class);
+ BT_ASSERT_PRE_FC_IS_STRUCT(field_class,
+ "Event common context field class");
resolve_ctx.packet_context = stream_class->packet_context_fc;
ret = bt_resolve_field_paths(field_class, &resolve_ctx);
if (ret) {
resolve_ctx.packet_context = stream_class->packet_context_fc;
ret = bt_resolve_field_paths(field_class, &resolve_ctx);
if (ret) {
struct bt_clock_class *clock_class)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_clock_class *clock_class)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
bt_object_put_ref(stream_class->default_clock_class);
stream_class->default_clock_class = clock_class;
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
bt_object_put_ref(stream_class->default_clock_class);
stream_class->default_clock_class = clock_class;
struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
struct bt_stream_class *stream_class)
{
struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->default_clock_class;
}
const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const(
const struct bt_stream_class *stream_class)
{
return stream_class->default_clock_class;
}
const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->default_clock_class;
}
bt_bool bt_stream_class_assigns_automatic_event_class_id(
const struct bt_stream_class *stream_class)
{
return stream_class->default_clock_class;
}
bt_bool bt_stream_class_assigns_automatic_event_class_id(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->assigns_automatic_event_class_id;
}
return (bt_bool) stream_class->assigns_automatic_event_class_id;
}
struct bt_stream_class *stream_class,
bt_bool value)
{
struct bt_stream_class *stream_class,
bt_bool value)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_event_class_id = (bool) value;
BT_LIB_LOGD("Set stream class's automatic event class ID "
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_event_class_id = (bool) value;
BT_LIB_LOGD("Set stream class's automatic event class ID "
bt_bool bt_stream_class_assigns_automatic_stream_id(
const struct bt_stream_class *stream_class)
{
bt_bool bt_stream_class_assigns_automatic_stream_id(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->assigns_automatic_stream_id;
}
return (bt_bool) stream_class->assigns_automatic_stream_id;
}
bt_bool supports_discarded_events,
bt_bool with_default_clock_snapshots)
{
bt_bool supports_discarded_events,
bt_bool with_default_clock_snapshots)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(supports_discarded_events ||
!with_default_clock_snapshots,
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(supports_discarded_events ||
!with_default_clock_snapshots,
bt_bool bt_stream_class_supports_discarded_events(
const struct bt_stream_class *stream_class)
{
bt_bool bt_stream_class_supports_discarded_events(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->supports_discarded_events;
}
bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(
const struct bt_stream_class *stream_class)
{
return (bt_bool) stream_class->supports_discarded_events;
}
bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->discarded_events_have_default_clock_snapshots;
}
return (bt_bool) stream_class->discarded_events_have_default_clock_snapshots;
}
bt_bool supports_discarded_packets,
bt_bool with_default_clock_snapshots)
{
bt_bool supports_discarded_packets,
bt_bool with_default_clock_snapshots)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(!supports_discarded_packets ||
stream_class->supports_packets,
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(!supports_discarded_packets ||
stream_class->supports_packets,
bt_bool bt_stream_class_supports_discarded_packets(
const struct bt_stream_class *stream_class)
{
bt_bool bt_stream_class_supports_discarded_packets(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->supports_discarded_packets;
}
bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(
const struct bt_stream_class *stream_class)
{
return (bt_bool) stream_class->supports_discarded_packets;
}
bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->discarded_packets_have_default_clock_snapshots;
}
return (bt_bool) stream_class->discarded_packets_have_default_clock_snapshots;
}
bt_bool with_default_clock_snapshot =
with_beginning_default_clock_snapshot ||
with_end_default_clock_snapshot;
bt_bool with_default_clock_snapshot =
with_beginning_default_clock_snapshot ||
with_end_default_clock_snapshot;
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(supports_packets ||
!with_default_clock_snapshot,
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(supports_packets ||
!with_default_clock_snapshot,
bt_bool bt_stream_class_supports_packets(
const struct bt_stream_class *stream_class)
{
bt_bool bt_stream_class_supports_packets(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->supports_packets;
}
bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(
const struct bt_stream_class *stream_class)
{
return (bt_bool) stream_class->supports_packets;
}
bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->packets_have_beginning_default_clock_snapshot;
}
bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(
const struct bt_stream_class *stream_class)
{
return (bt_bool) stream_class->packets_have_beginning_default_clock_snapshot;
}
bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return (bt_bool) stream_class->packets_have_end_default_clock_snapshot;
}
return (bt_bool) stream_class->packets_have_end_default_clock_snapshot;
}
struct bt_stream_class *stream_class,
bt_bool value)
{
struct bt_stream_class *stream_class,
bt_bool value)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_stream_id = (bool) value;
BT_LIB_LOGD("Set stream class's automatic stream ID "
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_stream_id = (bool) value;
BT_LIB_LOGD("Set stream class's automatic stream ID "
const struct bt_value *bt_stream_class_borrow_user_attributes_const(
const struct bt_stream_class *stream_class)
{
const struct bt_value *bt_stream_class_borrow_user_attributes_const(
const struct bt_stream_class *stream_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
return stream_class->user_attributes;
}
return stream_class->user_attributes;
}
struct bt_stream_class *stream_class,
const struct bt_value *user_attributes)
{
struct bt_stream_class *stream_class,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
bt_object_put_ref_no_null_check(stream_class->user_attributes);
stream_class->user_attributes = (void *) user_attributes;
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
bt_object_put_ref_no_null_check(stream_class->user_attributes);
stream_class->user_attributes = (void *) user_attributes;
#include "lib/value.h"
#include "lib/func-status.h"
#include "lib/value.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_DEV_STREAM_HOT(_stream) \
+#define BT_ASSERT_PRE_DEV_STREAM_HOT(_stream) \
BT_ASSERT_PRE_DEV_HOT((_stream), "Stream", ": %!+s", (_stream))
static
BT_ASSERT_PRE_DEV_HOT((_stream), "Stream", ": %!+s", (_stream))
static
uint64_t id;
BT_ASSERT_PRE_NO_ERROR();
uint64_t id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
BT_ASSERT_PRE(stream_class->assigns_automatic_stream_id,
"Stream class does not automatically assigns stream IDs: "
"%![sc-]+S", stream_class);
BT_ASSERT_PRE(stream_class->assigns_automatic_stream_id,
"Stream class does not automatically assigns stream IDs: "
"%![sc-]+S", stream_class);
struct bt_trace *trace, uint64_t id)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_trace *trace, uint64_t id)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
BT_ASSERT_PRE(!stream_class->assigns_automatic_stream_id,
"Stream class automatically assigns stream IDs: "
"%![sc-]+S", stream_class);
BT_ASSERT_PRE(!stream_class->assigns_automatic_stream_id,
"Stream class automatically assigns stream IDs: "
"%![sc-]+S", stream_class);
struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream)
{
struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream);
struct bt_trace *bt_stream_borrow_trace(struct bt_stream *stream)
{
struct bt_trace *bt_stream_borrow_trace(struct bt_stream *stream)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream);
return bt_stream_borrow_trace_inline(stream);
}
return bt_stream_borrow_trace_inline(stream);
}
const char *bt_stream_get_name(const struct bt_stream *stream)
{
const char *bt_stream_get_name(const struct bt_stream *stream)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream);
return stream->name.value;
}
return stream->name.value;
}
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
g_string_assign(stream->name.str, name);
stream->name.value = stream->name.str->str;
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
g_string_assign(stream->name.str, name);
stream->name.value = stream->name.str->str;
uint64_t bt_stream_get_id(const struct bt_stream *stream)
{
uint64_t bt_stream_get_id(const struct bt_stream *stream)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream class");
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream);
const struct bt_value *bt_stream_borrow_user_attributes_const(
const struct bt_stream *stream)
{
const struct bt_value *bt_stream_borrow_user_attributes_const(
const struct bt_stream *stream)
{
- BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+ BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream);
return stream->user_attributes;
}
return stream->user_attributes;
}
void bt_stream_set_user_attributes(struct bt_stream *stream,
const struct bt_value *user_attributes)
{
void bt_stream_set_user_attributes(struct bt_stream *stream,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(stream, "Stream");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_STREAM_NON_NULL(stream);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
bt_object_put_ref_no_null_check(stream->user_attributes);
stream->user_attributes = (void *) user_attributes;
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
bt_object_put_ref_no_null_check(stream->user_attributes);
stream->user_attributes = (void *) user_attributes;
struct bt_trace_class *tc = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_trace_class *tc = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
+ BT_ASSERT_PRE_COMP_NON_NULL(self_comp);
BT_LOGD_STR("Creating default trace class object.");
tc = g_new0(struct bt_trace_class, 1);
if (!tc) {
BT_LOGD_STR("Creating default trace class object.");
tc = g_new0(struct bt_trace_class, 1);
if (!tc) {
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
- BT_ASSERT_PRE_NON_NULL(listener, "Listener");
+ BT_ASSERT_PRE_TC_NON_NULL(tc);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(listener);
/* Find the next available spot */
for (i = 0; i < tc->destruction_listeners->len; i++) {
/* Find the next available spot */
for (i = 0; i < tc->destruction_listeners->len; i++) {
struct bt_trace_class_destruction_listener_elem *elem;
BT_ASSERT_PRE_NO_ERROR();
struct bt_trace_class_destruction_listener_elem *elem;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(tc);
BT_ASSERT_PRE(has_listener_id(tc, listener_id),
"Trace class has no such trace class destruction listener ID: "
"%![tc-]+T, %" PRIu64, tc, listener_id);
BT_ASSERT_PRE(has_listener_id(tc, listener_id),
"Trace class has no such trace class destruction listener ID: "
"%![tc-]+T, %" PRIu64, tc, listener_id);
uint64_t bt_trace_class_get_stream_class_count(const struct bt_trace_class *tc)
{
uint64_t bt_trace_class_get_stream_class_count(const struct bt_trace_class *tc)
{
- BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_DEV_TC_NON_NULL(tc);
return (uint64_t) tc->stream_classes->len;
}
struct bt_stream_class *bt_trace_class_borrow_stream_class_by_index(
struct bt_trace_class *tc, uint64_t index)
{
return (uint64_t) tc->stream_classes->len;
}
struct bt_stream_class *bt_trace_class_borrow_stream_class_by_index(
struct bt_trace_class *tc, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_DEV_TC_NON_NULL(tc);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, tc->stream_classes->len);
return g_ptr_array_index(tc->stream_classes, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, tc->stream_classes->len);
return g_ptr_array_index(tc->stream_classes, index);
}
struct bt_stream_class *stream_class = NULL;
uint64_t i;
struct bt_stream_class *stream_class = NULL;
uint64_t i;
- BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_DEV_TC_NON_NULL(tc);
for (i = 0; i < tc->stream_classes->len; i++) {
struct bt_stream_class *stream_class_candidate =
for (i = 0; i < tc->stream_classes->len; i++) {
struct bt_stream_class *stream_class_candidate =
bt_bool bt_trace_class_assigns_automatic_stream_class_id(const struct bt_trace_class *tc)
{
bt_bool bt_trace_class_assigns_automatic_stream_class_id(const struct bt_trace_class *tc)
{
- BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_DEV_TC_NON_NULL(tc);
return (bt_bool) tc->assigns_automatic_stream_class_id;
}
void bt_trace_class_set_assigns_automatic_stream_class_id(struct bt_trace_class *tc,
bt_bool value)
{
return (bt_bool) tc->assigns_automatic_stream_class_id;
}
void bt_trace_class_set_assigns_automatic_stream_class_id(struct bt_trace_class *tc,
bt_bool value)
{
- BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+ BT_ASSERT_PRE_TC_NON_NULL(tc);
BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(tc);
tc->assigns_automatic_stream_class_id = (bool) value;
BT_LIB_LOGD("Set trace class's automatic stream class ID "
BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(tc);
tc->assigns_automatic_stream_class_id = (bool) value;
BT_LIB_LOGD("Set trace class's automatic stream class ID "
const struct bt_value *bt_trace_class_borrow_user_attributes_const(
const struct bt_trace_class *trace_class)
{
const struct bt_value *bt_trace_class_borrow_user_attributes_const(
const struct bt_trace_class *trace_class)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_DEV_TC_NON_NULL(trace_class);
return trace_class->user_attributes;
}
return trace_class->user_attributes;
}
void bt_trace_class_set_user_attributes(struct bt_trace_class *trace_class,
const struct bt_value *user_attributes)
{
void bt_trace_class_set_user_attributes(struct bt_trace_class *trace_class,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_TC_NON_NULL(trace_class);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(trace_class);
bt_object_put_ref_no_null_check(trace_class->user_attributes);
trace_class->user_attributes = (void *) user_attributes;
BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(trace_class);
bt_object_put_ref_no_null_check(trace_class->user_attributes);
trace_class->user_attributes = (void *) user_attributes;
const char *bt_trace_get_name(const struct bt_trace *trace)
{
const char *bt_trace_get_name(const struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
return trace->name.value;
}
return trace->name.value;
}
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
const char *name)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
g_string_assign(trace->name.str, name);
trace->name.value = trace->name.str->str;
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
g_string_assign(trace->name.str, name);
trace->name.value = trace->name.str->str;
bt_uuid bt_trace_get_uuid(const struct bt_trace *trace)
{
bt_uuid bt_trace_get_uuid(const struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
return trace->uuid.value;
}
void bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid)
{
return trace->uuid.value;
}
void bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid)
{
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_UUID_NON_NULL(uuid);
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
bt_uuid_copy(trace->uuid.uuid, uuid);
trace->uuid.value = trace->uuid.uuid;
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
bt_uuid_copy(trace->uuid.uuid, uuid);
trace->uuid.value = trace->uuid.uuid;
struct bt_value *value_obj;
BT_ASSERT_PRE_NO_ERROR();
struct bt_value *value_obj;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE_NON_NULL(value, "Value");
value_obj = bt_value_string_create_init(value);
BT_ASSERT_PRE_NON_NULL(value, "Value");
value_obj = bt_value_string_create_init(value);
struct bt_value *value_obj;
BT_ASSERT_PRE_NO_ERROR();
struct bt_value *value_obj;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
value_obj = bt_value_integer_signed_create_init(value);
if (!value_obj) {
value_obj = bt_value_integer_signed_create_init(value);
if (!value_obj) {
uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace)
{
uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
return bt_attributes_get_count(trace->environment);
}
return bt_attributes_get_count(trace->environment);
}
const struct bt_trace *trace, uint64_t index,
const char **name, const struct bt_value **value)
{
const struct bt_trace *trace, uint64_t index,
const char **name, const struct bt_value **value)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_DEV_NAME_NON_NULL(name);
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_VALID_INDEX(index,
bt_attributes_get_count(trace->environment));
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_VALID_INDEX(index,
bt_attributes_get_count(trace->environment));
const struct bt_value *bt_trace_borrow_environment_entry_value_by_name_const(
const struct bt_trace *trace, const char *name)
{
const struct bt_value *bt_trace_borrow_environment_entry_value_by_name_const(
const struct bt_trace *trace, const char *name)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_DEV_NAME_NON_NULL(name);
return bt_attributes_borrow_field_value_by_name(trace->environment,
name);
}
uint64_t bt_trace_get_stream_count(const struct bt_trace *trace)
{
return bt_attributes_borrow_field_value_by_name(trace->environment,
name);
}
uint64_t bt_trace_get_stream_count(const struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
return (uint64_t) trace->streams->len;
}
struct bt_stream *bt_trace_borrow_stream_by_index(
struct bt_trace *trace, uint64_t index)
{
return (uint64_t) trace->streams->len;
}
struct bt_stream *bt_trace_borrow_stream_by_index(
struct bt_trace *trace, uint64_t index)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
BT_ASSERT_PRE_DEV_VALID_INDEX(index, trace->streams->len);
return g_ptr_array_index(trace->streams, index);
}
BT_ASSERT_PRE_DEV_VALID_INDEX(index, trace->streams->len);
return g_ptr_array_index(trace->streams, index);
}
struct bt_stream *stream = NULL;
uint64_t i;
struct bt_stream *stream = NULL;
uint64_t i;
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
for (i = 0; i < trace->streams->len; i++) {
struct bt_stream *stream_candidate =
for (i = 0; i < trace->streams->len; i++) {
struct bt_stream *stream_candidate =
};
BT_ASSERT_PRE_NO_ERROR();
};
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(listener, "Listener");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(listener);
/* Find the next available spot */
for (i = 0; i < trace->destruction_listeners->len; i++) {
/* Find the next available spot */
for (i = 0; i < trace->destruction_listeners->len; i++) {
struct bt_trace_destruction_listener_elem *elem;
BT_ASSERT_PRE_NO_ERROR();
struct bt_trace_destruction_listener_elem *elem;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
BT_ASSERT_PRE(has_listener_id(trace, listener_id),
"Trace has no such trace destruction listener ID: "
"%![trace-]+t, %" PRIu64, trace, listener_id);
BT_ASSERT_PRE(has_listener_id(trace, listener_id),
"Trace has no such trace destruction listener ID: "
"%![trace-]+t, %" PRIu64, trace, listener_id);
struct bt_trace_class *bt_trace_borrow_class(struct bt_trace *trace)
{
struct bt_trace_class *bt_trace_borrow_class(struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
const struct bt_value *bt_trace_borrow_user_attributes_const(
const struct bt_trace *trace)
{
const struct bt_value *bt_trace_borrow_user_attributes_const(
const struct bt_trace *trace)
{
- BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace);
return trace->user_attributes;
}
return trace->user_attributes;
}
struct bt_trace *trace,
const struct bt_value *user_attributes)
{
struct bt_trace *trace,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
- BT_ASSERT_PRE_NON_NULL(user_attributes, "User attributes");
- BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
- "User attributes object is not a map value object.");
+ BT_ASSERT_PRE_TRACE_NON_NULL(trace);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
bt_object_put_ref_no_null_check(trace->user_attributes);
trace->user_attributes = (void *) user_attributes;
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
bt_object_put_ref_no_null_check(trace->user_attributes);
trace->user_attributes = (void *) user_attributes;
#include "common/assert.h"
#include "func-status.h"
#include "common/assert.h"
#include "func-status.h"
-#define BT_ASSERT_PRE_DEV_VALUE_HOT(_value, _name) \
- BT_ASSERT_PRE_DEV_HOT(((struct bt_value *) (_value)), (_name), \
- ": %!+v", (_value))
+#define BT_ASSERT_PRE_DEV_VALUE_HOT(_value) \
+ BT_ASSERT_PRE_DEV_HOT(((struct bt_value *) (_value)), \
+ "Value object", ": %!+v", (_value))
#define BT_VALUE_TO_BOOL(_base) ((struct bt_value_bool *) (_base))
#define BT_VALUE_TO_INTEGER(_base) ((struct bt_value_integer *) (_base))
#define BT_VALUE_TO_BOOL(_base) ((struct bt_value_bool *) (_base))
#define BT_VALUE_TO_INTEGER(_base) ((struct bt_value_integer *) (_base))
enum bt_value_type bt_value_get_type(const struct bt_value *object)
{
enum bt_value_type bt_value_get_type(const struct bt_value *object)
{
- BT_ASSERT_PRE_DEV_NON_NULL(object, "Value object");
+ BT_ASSERT_PRE_DEV_VALUE_NON_NULL(object);
struct bt_value_string *string_obj = NULL;
BT_ASSERT_PRE_NO_ERROR();
struct bt_value_string *string_obj = NULL;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(val, "Value");
+ BT_ASSERT_PRE_NON_NULL(val, "Raw value");
BT_LOGD("Creating string value object: val-len=%zu", strlen(val));
string_obj = g_new0(struct bt_value_string, 1);
BT_LOGD("Creating string value object: val-len=%zu", strlen(val));
string_obj = g_new0(struct bt_value_string, 1);
bt_bool bt_value_bool_get(const struct bt_value *bool_obj)
{
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_NON_NULL(bool_obj);
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_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_NON_NULL(bool_obj);
BT_ASSERT_PRE_VALUE_HAS_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_ASSERT_PRE_DEV_VALUE_HOT(bool_obj);
BT_VALUE_TO_BOOL(bool_obj)->value = val;
BT_LOGT("Set boolean value's raw value: value-addr=%p, value=%d",
bool_obj, val);
BT_VALUE_TO_BOOL(bool_obj)->value = val;
BT_LOGT("Set boolean value's raw value: value-addr=%p, value=%d",
bool_obj, val);
uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj)
{
uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj)
{
- BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object");
+ BT_ASSERT_PRE_DEV_VALUE_NON_NULL(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_ASSERT_PRE_DEV_VALUE_HAS_TYPE(integer_obj,
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)
{
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_NON_NULL(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_ASSERT_PRE_DEV_VALUE_HAS_TYPE(integer_obj,
BT_VALUE_TYPE_SIGNED_INTEGER);
return BT_VALUE_TO_INTEGER(integer_obj)->value.i;
void bt_value_integer_set(struct bt_value *integer_obj,
enum bt_value_type expected_type, uint64_t uval)
{
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_NON_NULL(integer_obj);
BT_ASSERT_PRE_VALUE_HAS_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_ASSERT_PRE_DEV_VALUE_HOT(integer_obj);
BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval;
}
BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval;
}
double bt_value_real_get(const struct bt_value *real_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_NON_NULL(real_obj);
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_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_NON_NULL(real_obj);
BT_ASSERT_PRE_VALUE_HAS_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_ASSERT_PRE_DEV_VALUE_HOT(real_obj);
BT_VALUE_TO_REAL(real_obj)->value = val;
BT_LOGT("Set real number value's raw value: value-addr=%p, value=%f",
real_obj, val);
BT_VALUE_TO_REAL(real_obj)->value = val;
BT_LOGT("Set real number value's raw value: value-addr=%p, value=%f",
real_obj, val);
const char *bt_value_string_get(const struct bt_value *string_obj)
{
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_NON_NULL(string_obj);
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
return BT_VALUE_TO_STRING(string_obj)->gstr->str;
}
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
return BT_VALUE_TO_STRING(string_obj)->gstr->str;
}
struct bt_value *string_obj, const char *val)
{
BT_ASSERT_PRE_NO_ERROR();
struct bt_value *string_obj, const char *val)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
+ BT_ASSERT_PRE_VALUE_NON_NULL(string_obj);
BT_ASSERT_PRE_VALUE_HAS_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");
+ BT_ASSERT_PRE_DEV_VALUE_HOT(string_obj);
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",
string_obj, val);
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",
string_obj, val);
uint64_t bt_value_array_get_length(const struct bt_value *array_obj)
{
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_NON_NULL(array_obj);
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len;
}
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len;
}
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
- BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
+ BT_ASSERT_PRE_DEV_VALUE_NON_NULL(array_obj);
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_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_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
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_DEV_VALUE_HOT(array_obj);
g_ptr_array_add(typed_array_obj->garray, element_obj);
bt_object_get_ref(element_obj);
BT_LOGT("Appended element to array value: array-value-addr=%p, "
g_ptr_array_add(typed_array_obj->garray, element_obj);
bt_object_get_ref(element_obj);
BT_LOGT("Appended element to array value: array-value-addr=%p, "
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_HAS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
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_DEV_VALUE_HOT(array_obj);
BT_ASSERT_PRE_VALID_INDEX(index, typed_array_obj->garray->len);
bt_object_put_ref(g_ptr_array_index(typed_array_obj->garray, index));
g_ptr_array_index(typed_array_obj->garray, index) = element_obj;
BT_ASSERT_PRE_VALID_INDEX(index, typed_array_obj->garray->len);
bt_object_put_ref(g_ptr_array_index(typed_array_obj->garray, index));
g_ptr_array_index(typed_array_obj->garray, index) = element_obj;
uint64_t bt_value_map_get_size(const struct bt_value *map_obj)
{
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_NON_NULL(map_obj);
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);
}
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);
}
struct bt_value *bt_value_map_borrow_entry_value(struct bt_value *map_obj,
const char *key)
{
struct bt_value *bt_value_map_borrow_entry_value(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_NON_NULL(map_obj);
+ BT_ASSERT_PRE_DEV_KEY_NON_NULL(key);
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)));
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)));
bt_bool bt_value_map_has_entry(const struct bt_value *map_obj, const char *key)
{
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_NON_NULL(map_obj);
+ BT_ASSERT_PRE_DEV_KEY_NON_NULL(key);
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)));
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)));
{
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
{
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
- BT_ASSERT_PRE_NON_NULL(key, "Key");
+ BT_ASSERT_PRE_KEY_NON_NULL(key);
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
- BT_ASSERT_PRE_DEV_VALUE_HOT(map_obj, "Map value object");
+ BT_ASSERT_PRE_DEV_VALUE_HOT(map_obj);
g_hash_table_insert(BT_VALUE_TO_MAP(map_obj)->ght,
GUINT_TO_POINTER(g_quark_from_string(key)), element_obj);
bt_object_get_ref(element_obj);
g_hash_table_insert(BT_VALUE_TO_MAP(map_obj)->ght,
GUINT_TO_POINTER(g_quark_from_string(key)), element_obj);
bt_object_get_ref(element_obj);
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
- BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback");
+ BT_ASSERT_PRE_DEV_VALUE_NON_NULL(map_obj);
+ BT_ASSERT_PRE_DEV_NON_NULL(func, "User function");
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
g_hash_table_iter_init(&iter, typed_map_obj->ght);
BT_ASSERT_PRE_DEV_VALUE_HAS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
g_hash_table_iter_init(&iter, typed_map_obj->ght);
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(base_map_obj, "Base value object");
BT_ASSERT_PRE_NO_ERROR();
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_DEV_VALUE_HOT(base_map_obj);
BT_ASSERT_PRE_NON_NULL(extension_obj, "Extension value object");
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_ASSERT_PRE_NON_NULL(extension_obj, "Extension value object");
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);
enum bt_value_copy_status status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
enum bt_value_copy_status status = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(object, "Value object");
+ BT_ASSERT_PRE_VALUE_NON_NULL(object);
BT_ASSERT_PRE_NON_NULL(copy_obj, "Value object copy (output)");
BT_LOGD("Copying value object: addr=%p", object);
*copy_obj = copy_funcs[object->type](object);
BT_ASSERT_PRE_NON_NULL(copy_obj, "Value object copy (output)");
BT_LOGD("Copying value object: addr=%p", object);
*copy_obj = copy_funcs[object->type](object);