static
void add_to_loaded_plugins(struct bt_plugin_set *plugin_set)
{
- int i;
- int count;
+ int64_t i;
+ int64_t count;
count = bt_plugin_set_get_plugin_count(plugin_set);
assert(count >= 0);
printf(" %sComponent classes%s: %d\n",
bt_common_color_bold(),
bt_common_color_reset(),
- bt_plugin_get_component_class_count(plugin));
+ (int) bt_plugin_get_component_class_count(plugin));
if (cfg->cmd_data.help.cfg_component->type !=
void bt_ctf_attributes_destroy(struct bt_value *attr_obj);
BT_HIDDEN
-int bt_ctf_attributes_get_count(struct bt_value *attr_obj);
+int64_t bt_ctf_attributes_get_count(struct bt_value *attr_obj);
BT_HIDDEN
const char *bt_ctf_attributes_get_field_name(struct bt_value *attr_obj,
@sa bt_ctf_event_class_get_attribute_value(): Returns the value of
the attribute of a given event class at a given index.
*/
-extern int bt_ctf_event_class_get_attribute_count(
+extern int64_t bt_ctf_event_class_get_attribute_count(
struct bt_ctf_event_class *event_class);
/**
@prenotnull{event_class}
@postrefcountsame{event_class}
*/
-extern int bt_ctf_event_class_get_field_count(
+extern int64_t bt_ctf_event_class_get_field_count(
struct bt_ctf_event_class *event_class);
/**
* http://www.efficios.com/ctf
*/
+#include <stdint.h>
#include <babeltrace/ctf-ir/field-types.h>
#ifdef __cplusplus
@prenotnull{field_path}
@postrefcountsame{field_path}
*/
-extern int bt_ctf_field_path_get_index_count(
+extern int64_t bt_ctf_field_path_get_index_count(
const struct bt_ctf_field_path *field_path);
/**
* SOFTWARE.
*/
+#include <stdint.h>
#include <babeltrace/ctf-writer/event-types.h>
#include <babeltrace/ctf-writer/event-fields.h>
#include <babeltrace/ctf-writer/writer.h>
struct bt_ctf_field_type *element_type);
BT_HIDDEN
-int bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *type);
+int64_t bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *type);
BT_HIDDEN
struct bt_ctf_field_type *bt_ctf_field_type_get_field_at_index(
@preisenumft{enum_field_type}
@postrefcountsame{enum_field_type}
*/
-extern int bt_ctf_field_type_enumeration_get_mapping_count(
+extern int64_t bt_ctf_field_type_enumeration_get_mapping_count(
struct bt_ctf_field_type *enum_field_type);
/**
@preisstructft{struct_field_type}
@postrefcountsame{struct_field_type}
*/
-extern int bt_ctf_field_type_structure_get_field_count(
+extern int64_t bt_ctf_field_type_structure_get_field_count(
struct bt_ctf_field_type *struct_field_type);
/**
@preisvarft{variant_field_type}
@postrefcountsame{variant_field_type}
*/
-extern int bt_ctf_field_type_variant_get_field_count(
+extern int64_t bt_ctf_field_type_variant_get_field_count(
struct bt_ctf_field_type *variant_field_type);
/**
#include <stdint.h>
#include <stddef.h>
+#include <babeltrace/ctf-ir/field-types.h>
#ifdef __cplusplus
extern "C" {
@prenotnull{stream_class}
@postrefcountsame{stream_class}
*/
-extern int bt_ctf_stream_class_get_event_class_count(
+extern int64_t bt_ctf_stream_class_get_event_class_count(
struct bt_ctf_stream_class *stream_class);
/**
@prenotnull{trace_class}
@postrefcountsame{trace_class}
*/
-extern int bt_ctf_trace_get_environment_field_count(
+extern int64_t bt_ctf_trace_get_environment_field_count(
struct bt_ctf_trace *trace_class);
/**
@prenotnull{trace_class}
@postrefcountsame{trace_class}
*/
-extern int bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace_class);
+extern int64_t bt_ctf_trace_get_clock_class_count(
+ struct bt_ctf_trace *trace_class);
/**
@brief Returns the CTF IR clock class at index \p index in the CTF
@prenotnull{trace_class}
@postrefcountsame{trace_class}
*/
-extern int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace_class);
+extern int64_t bt_ctf_trace_get_stream_class_count(
+ struct bt_ctf_trace *trace_class);
/**
@brief Returns the stream class at index \p index in the CTF IR trace
@prenotnull{trace_class}
@postrefcountsame{trace_class}
*/
-extern int bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace_class);
+extern int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace_class);
/**
@brief Returns the stream at index \p index in the CTF IR trace
#include <babeltrace/babeltrace-internal.h>
typedef void *(*bt_child_accessor)(void *object, int index);
-typedef int (*bt_child_count_accessor)(void *object);
+typedef int64_t (*bt_child_count_accessor)(void *object);
typedef int (*bt_child_visitor)(void *object, bt_ctf_visitor visitor,
void *data);
{
/* Only makes sense to get the address after aligning on CHAR_BIT */
assert(!(pos->offset % CHAR_BIT));
- return mmap_align_addr(pos->base_mma) +
+ return ((char *) mmap_align_addr(pos->base_mma)) +
pos->mmap_base_offset + (pos->offset / CHAR_BIT);
}
@prenotnull{clock_class_priority_map}
@postrefcountsame{clock_class_priority_map}
*/
-extern int bt_clock_class_priority_map_get_clock_class_count(
+extern int64_t bt_clock_class_priority_map_get_clock_class_count(
struct bt_clock_class_priority_map *clock_class_priority_map);
/**
struct bt_port;
struct bt_component;
-extern enum bt_component_status bt_component_filter_get_input_port_count(
- struct bt_component *component, uint64_t *count);
+extern int64_t bt_component_filter_get_input_port_count(
+ struct bt_component *component);
extern struct bt_port *bt_component_filter_get_input_port(
struct bt_component *component, const char *name);
extern struct bt_port *bt_component_filter_get_input_port_at_index(
extern struct bt_port *bt_component_filter_get_default_input_port(
struct bt_component *component);
-extern enum bt_component_status bt_component_filter_get_output_port_count(
- struct bt_component *component, uint64_t *count);
+extern int64_t bt_component_filter_get_output_port_count(
+ struct bt_component *component);
extern struct bt_port *bt_component_filter_get_output_port(
struct bt_component *component, const char *name);
extern struct bt_port *bt_component_filter_get_output_port_at_index(
struct bt_graph *graph);
BT_HIDDEN
-uint64_t bt_component_get_input_port_count(struct bt_component *comp);
+int64_t bt_component_get_input_port_count(struct bt_component *comp);
BT_HIDDEN
-uint64_t bt_component_get_output_port_count(struct bt_component *comp);
+int64_t bt_component_get_output_port_count(struct bt_component *comp);
BT_HIDDEN
struct bt_port *bt_component_get_input_port_at_index(struct bt_component *comp,
struct bt_component;
struct bt_notification;
-extern enum bt_component_status bt_component_sink_get_input_port_count(
- struct bt_component *component, uint64_t *count);
+extern int64_t bt_component_sink_get_input_port_count(
+ struct bt_component *component);
extern struct bt_port *bt_component_sink_get_input_port(
struct bt_component *component, const char *name);
extern struct bt_port *bt_component_sink_get_input_port_at_index(
struct bt_component;
struct bt_notification_iterator;
-extern enum bt_component_status bt_component_source_get_output_port_count(
- struct bt_component *component, uint64_t *count);
+extern int64_t bt_component_source_get_output_port_count(
+ struct bt_component *component);
extern struct bt_port *bt_component_source_get_output_port(
struct bt_component *component, const char *name);
extern struct bt_port *bt_component_source_get_output_port_at_index(
#include <babeltrace/align-internal.h>
#include <stdlib.h>
+#include <stdint.h>
#include <sys/mman.h>
/*
free(mma);
return MAP_FAILED;
}
- mma->addr = mma->page_aligned_addr + (offset - page_aligned_offset);
+ mma->addr = ((uint8_t *) mma->page_aligned_addr) + (offset - page_aligned_offset);
return mma;
}
* SOFTWARE.
*/
+#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <babeltrace/graph/component-class.h>
unsigned int *major, unsigned int *minor, unsigned int *patch,
const char **extra);
-extern int bt_plugin_get_component_class_count(struct bt_plugin *plugin);
+extern int64_t bt_plugin_get_component_class_count(struct bt_plugin *plugin);
extern struct bt_component_class *bt_plugin_get_component_class(
struct bt_plugin *plugin, size_t index);
enum bt_component_class_type type);
extern
-int bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set);
+int64_t bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set);
extern
struct bt_plugin *bt_plugin_set_get_plugin(struct bt_plugin_set *plugin_set,
BT_VALUE_STATUS_CANCELLED = -3,
/* -22 for compatibility with -EINVAL */
- /// Invalid arguments.
+ /// Invalid argument.
BT_VALUE_STATUS_INVAL = -22,
/// General error.
@sa bt_value_array_is_empty(): Checks whether or not a given array
value object is empty.
*/
-extern int bt_value_array_size(const struct bt_value *array_obj);
+extern int64_t bt_value_array_size(const struct bt_value *array_obj);
/**
@brief Checks whether or not the array value object \p array_obj
@postrefcountsame{array_obj}
*/
extern struct bt_value *bt_value_array_get(const struct bt_value *array_obj,
- size_t index);
+ uint64_t index);
/**
@brief Appends the value object \p element_obj to the array value
@postrefcountsame{array_obj}
*/
extern enum bt_value_status bt_value_array_set(struct bt_value *array_obj,
- size_t index, struct bt_value *element_obj);
+ uint64_t index, struct bt_value *element_obj);
/** @} */
@sa bt_value_map_is_empty(): Checks whether or not a given map value
object is empty.
*/
-extern int bt_value_map_size(const struct bt_value *map_obj);
+extern int64_t bt_value_map_size(const struct bt_value *map_obj);
/**
@brief Checks whether or not the map value object \p map_obj is empty.
}
BT_HIDDEN
-int bt_ctf_attributes_get_count(struct bt_value *attr_obj)
+int64_t bt_ctf_attributes_get_count(struct bt_value *attr_obj)
{
return bt_value_array_size(attr_obj);
}
return ret;
}
-int bt_ctf_event_class_get_attribute_count(
+int64_t bt_ctf_event_class_get_attribute_count(
struct bt_ctf_event_class *event_class)
{
- int ret = 0;
+ int64_t ret = 0;
if (!event_class) {
ret = -1;
return ret;
}
-int bt_ctf_event_class_get_field_count(
+int64_t bt_ctf_event_class_get_field_count(
struct bt_ctf_event_class *event_class)
{
- int ret;
+ int64_t ret;
if (!event_class) {
ret = -1;
int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
struct metadata_context *context)
{
- int i;
- int count;
+ int64_t i;
+ int64_t count;
int ret = 0;
struct bt_value *attr_value = NULL;
#include <babeltrace/ctf-ir/field-path-internal.h>
#include <babeltrace/ctf-ir/field-path.h>
#include <limits.h>
+#include <stdint.h>
#include <glib.h>
static
return scope;
}
-int bt_ctf_field_path_get_index_count(
+int64_t bt_ctf_field_path_get_index_count(
const struct bt_ctf_field_path *field_path)
{
- int ret = -1;
+ int64_t ret = -1;
if (!field_path) {
goto end;
{
int ret = 0;
struct bt_ctf_field_type *child_type = NULL;
- int field_count = bt_ctf_field_type_structure_get_field_count(type);
- int i;
+ int64_t field_count = bt_ctf_field_type_structure_get_field_count(type);
+ int64_t i;
if (field_count < 0) {
ret = -1;
int bt_ctf_field_type_variant_validate(struct bt_ctf_field_type *type)
{
int ret = 0;
- int field_count;
+ int64_t field_count;
struct bt_ctf_field_type *child_type = NULL;
struct bt_ctf_field_type_variant *variant =
container_of(type, struct bt_ctf_field_type_variant,
parent);
- int i;
- int tag_mappings_count;
+ int64_t i;
+ int64_t tag_mappings_count;
if (variant->tag_name->len == 0 || !variant->tag) {
ret = -1;
return ret;
}
-int bt_ctf_field_type_enumeration_get_mapping_count(
+int64_t bt_ctf_field_type_enumeration_get_mapping_count(
struct bt_ctf_field_type *type)
{
- int ret = 0;
+ int64_t ret = 0;
struct bt_ctf_field_type_enumeration *enumeration;
if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_ENUM)) {
enumeration = container_of(type, struct bt_ctf_field_type_enumeration,
parent);
- ret = (int) enumeration->entries->len;
+ ret = (int64_t) enumeration->entries->len;
end:
return ret;
}
return ret;
}
-int bt_ctf_field_type_structure_get_field_count(
+int64_t bt_ctf_field_type_structure_get_field_count(
struct bt_ctf_field_type *type)
{
- int ret = 0;
+ int64_t ret = 0;
struct bt_ctf_field_type_structure *structure;
if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_STRUCT)) {
structure = container_of(type, struct bt_ctf_field_type_structure,
parent);
- ret = (int) structure->fields->len;
+ ret = (int64_t) structure->fields->len;
end:
return ret;
}
return field_type;
}
-int bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *type)
+int64_t bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *type)
{
- int ret = 0;
+ int64_t ret = 0;
struct bt_ctf_field_type_variant *variant;
if (!type || (type->id != BT_CTF_FIELD_TYPE_ID_VARIANT)) {
variant = container_of(type, struct bt_ctf_field_type_variant,
parent);
- ret = (int) variant->fields->len;
+ ret = (int64_t) variant->fields->len;
end:
return ret;
}
case BT_CTF_FIELD_TYPE_ID_STRUCT:
{
- int i, element_count;
+ int64_t i, element_count;
element_count = bt_ctf_field_type_structure_get_field_count(
type);
}
BT_HIDDEN
-int bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *field_type)
+int64_t bt_ctf_field_type_get_field_count(struct bt_ctf_field_type *field_type)
{
- int field_count = -1;
+ int64_t field_count = -1;
enum bt_ctf_field_type_id type_id = bt_ctf_field_type_get_type_id(field_type);
switch (type_id) {
#include <babeltrace/align-internal.h>
#include <babeltrace/endian-internal.h>
#include <inttypes.h>
+#include <stdint.h>
static
void bt_ctf_stream_class_destroy(struct bt_object *obj);
return ret;
}
-int bt_ctf_stream_class_get_event_class_count(
+int64_t bt_ctf_stream_class_get_event_class_count(
struct bt_ctf_stream_class *stream_class)
{
- int ret;
+ int64_t ret;
if (!stream_class) {
ret = -1;
}
static
-int get_event_class_count(void *element)
+int64_t get_event_class_count(void *element)
{
return bt_ctf_stream_class_get_event_class_count(
(struct bt_ctf_stream_class *) element);
#include <babeltrace/ref.h>
#include <babeltrace/endian-internal.h>
#include <inttypes.h>
+#include <stdint.h>
#define DEFAULT_IDENTIFIER_SIZE 128
#define DEFAULT_METADATA_STRING_SIZE 4096
return ret;
}
-int bt_ctf_trace_get_environment_field_count(struct bt_ctf_trace *trace)
+int64_t bt_ctf_trace_get_environment_field_count(struct bt_ctf_trace *trace)
{
- int ret = 0;
+ int64_t ret = 0;
if (!trace) {
ret = -1;
return ret;
}
-int bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace)
+int64_t bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace)
{
- int ret = -1;
+ int64_t ret = -1;
if (!trace) {
goto end;
int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
struct bt_ctf_stream_class *stream_class)
{
- int ret, i;
+ int ret;
+ int64_t i;
int64_t stream_id;
struct bt_ctf_validation_output trace_sc_validation_output = { 0 };
struct bt_ctf_validation_output *ec_validation_outputs = NULL;
struct bt_ctf_field_type *packet_context_type = NULL;
struct bt_ctf_field_type *event_header_type = NULL;
struct bt_ctf_field_type *stream_event_ctx_type = NULL;
- int event_class_count;
+ int64_t event_class_count;
struct bt_ctf_trace *current_parent_trace = NULL;
if (!trace || !stream_class || trace->is_static) {
return ret;
}
-int bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace)
+int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace)
{
- int ret;
+ int64_t ret;
if (!trace) {
ret = -1;
return stream;
}
-int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace)
+int64_t bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace)
{
- int ret;
+ int64_t ret;
if (!trace) {
ret = -1;
void append_env_metadata(struct bt_ctf_trace *trace,
struct metadata_context *context)
{
- int i;
- int env_size;
+ int64_t i;
+ int64_t env_size;
env_size = bt_ctf_attributes_get_count(trace->environment);
}
static
-int get_stream_class_count(void *element)
+int64_t get_stream_class_count(void *element)
{
return bt_ctf_trace_get_stream_class_count(
(struct bt_ctf_trace *) element);
return cc_prio_map;
}
-int bt_clock_class_priority_map_get_clock_class_count(
+int64_t bt_clock_class_priority_map_get_clock_class_count(
struct bt_clock_class_priority_map *cc_prio_map)
{
- int ret = -1;
+ int64_t ret = -1;
if (!cc_prio_map) {
goto end;
}
- ret = (int) cc_prio_map->entries->len;
+ ret = (int64_t) cc_prio_map->entries->len;
end:
return ret;
}
BT_HIDDEN
-uint64_t bt_component_get_input_port_count(struct bt_component *comp)
+int64_t bt_component_get_input_port_count(struct bt_component *comp)
{
assert(comp);
return comp->input_ports->len;
}
BT_HIDDEN
-uint64_t bt_component_get_output_port_count(struct bt_component *comp)
+int64_t bt_component_get_output_port_count(struct bt_component *comp)
{
assert(comp);
return comp->output_ports->len;
return ret;
}
-enum bt_component_status bt_component_filter_get_input_port_count(
+int64_t bt_component_filter_get_input_port_count(
struct bt_component *component, uint64_t *count)
{
- enum bt_component_status status = BT_COMPONENT_STATUS_OK;
+ int64_t ret;
- if (!component || !count ||
+ if (!component ||
component->class->type != BT_COMPONENT_CLASS_TYPE_FILTER) {
- status = BT_COMPONENT_STATUS_INVALID;
+ ret = -1;
goto end;
}
- *count = bt_component_get_input_port_count(component);
+ ret = bt_component_get_input_port_count(component);
end:
- return status;
+ return ret;
}
struct bt_port *bt_component_filter_get_input_port(
DEFAULT_INPUT_PORT_NAME);
}
-enum bt_component_status bt_component_filter_get_output_port_count(
+int64_t bt_component_filter_get_output_port_count(
struct bt_component *component, uint64_t *count)
{
- enum bt_component_status status = BT_COMPONENT_STATUS_OK;
+ int64_t ret;
if (!component || !count ||
component->class->type != BT_COMPONENT_CLASS_TYPE_FILTER) {
- status = BT_COMPONENT_STATUS_INVALID;
+ ret = -1;
goto end;
}
- *count = bt_component_get_output_port_count(component);
+ ret = bt_component_get_output_port_count(component);
end:
- return status;
+ return ret;
}
struct bt_port *bt_component_filter_get_output_port(
static
enum bt_component_status get_component_port_counts(
- struct bt_component *component, uint64_t *input_count,
- uint64_t *output_count)
+ struct bt_component *component, int64_t *input_count,
+ int64_t *output_count)
{
enum bt_component_status ret;
switch (bt_component_get_class_type(component)) {
case BT_COMPONENT_CLASS_TYPE_SOURCE:
- ret = bt_component_source_get_output_port_count(component,
- output_count);
- if (ret != BT_COMPONENT_STATUS_OK) {
+ *output_count =
+ bt_component_source_get_output_port_count(component);
+ if (*output_count < 0) {
+ ret = BT_COMPONENT_STATUS_ERROR;
goto end;
}
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
- ret = bt_component_filter_get_output_port_count(component,
- output_count);
- if (ret != BT_COMPONENT_STATUS_OK) {
+ *output_count =
+ bt_component_filter_get_output_port_count(component);
+ if (*output_count < 0) {
+ ret = BT_COMPONENT_STATUS_ERROR;
goto end;
}
- ret = bt_component_filter_get_input_port_count(component,
- input_count);
- if (ret != BT_COMPONENT_STATUS_OK) {
+ *input_count =
+ bt_component_filter_get_input_port_count(component);
+ if (*input_count < 0) {
+ ret = BT_COMPONENT_STATUS_ERROR;
goto end;
}
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
- ret = bt_component_sink_get_input_port_count(component,
- input_count);
- if (ret != BT_COMPONENT_STATUS_OK) {
+ *input_count =
+ bt_component_sink_get_input_port_count(component);
+ if (*input_count < 0) {
+ ret = BT_COMPONENT_STATUS_ERROR;
goto end;
}
break;
struct bt_component *origin,
struct bt_component *new_component)
{
- uint64_t origin_input_port_count = 0;
- uint64_t origin_output_port_count = 0;
- uint64_t new_input_port_count = 0;
- uint64_t new_output_port_count = 0;
+ int64_t origin_input_port_count = 0;
+ int64_t origin_output_port_count = 0;
+ int64_t new_input_port_count = 0;
+ int64_t new_output_port_count = 0;
enum bt_graph_status status = BT_GRAPH_STATUS_OK;
struct bt_graph *origin_graph = NULL;
struct bt_graph *new_graph = NULL;
return ret;
}
-enum bt_component_status bt_component_sink_get_input_port_count(
- struct bt_component *component, uint64_t *count)
+int64_t bt_component_sink_get_input_port_count(struct bt_component *component)
{
- enum bt_component_status status = BT_COMPONENT_STATUS_OK;
+ int64_t ret;
- if (!component || !count ||
+ if (!component ||
component->class->type != BT_COMPONENT_CLASS_TYPE_SINK) {
- status = BT_COMPONENT_STATUS_INVALID;
+ ret = -1;
goto end;
}
- *count = bt_component_get_input_port_count(component);
+ ret = bt_component_get_input_port_count(component);
end:
- return status;
+ return ret;
}
struct bt_port *bt_component_sink_get_input_port(
return source ? &source->parent : NULL;
}
-enum bt_component_status bt_component_source_get_output_port_count(
+int64_t bt_component_source_get_output_port_count(
struct bt_component *component, uint64_t *count)
{
- enum bt_component_status status = BT_COMPONENT_STATUS_OK;
+ int64_t ret;
if (!component || !count ||
component->class->type != BT_COMPONENT_CLASS_TYPE_SOURCE) {
- status = BT_COMPONENT_STATUS_INVALID;
+ ret = -1;
goto end;
}
- *count = bt_component_get_output_port_count(component);
+ ret = bt_component_get_output_port_count(component);
end:
- return status;
+ return ret;
}
struct bt_port *bt_component_source_get_output_port(
#endif
extern
-int bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set)
+int64_t bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set)
{
- int count = -1;
+ int64_t count = -1;
if (!plugin_set) {
goto end;
return status;
}
-int bt_plugin_get_component_class_count(struct bt_plugin *plugin)
+int64_t bt_plugin_get_component_class_count(struct bt_plugin *plugin)
{
return plugin ? plugin->comp_classes->len : -1;
}
return ret;
}
-int bt_value_array_size(const struct bt_value *array_obj)
+int64_t bt_value_array_size(const struct bt_value *array_obj)
{
- int ret;
+ int64_t ret;
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
goto end;
}
- ret = (int) typed_array_obj->garray->len;
+ ret = (int64_t) typed_array_obj->garray->len;
end:
return ret;
return ret;
}
-int bt_value_map_size(const struct bt_value *map_obj)
+int64_t bt_value_map_size(const struct bt_value *map_obj)
{
- int ret;
+ int64_t ret;
struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
if (!map_obj || !bt_value_is_map(map_obj)) {
goto end;
}
- ret = (int) g_hash_table_size(typed_map_obj->ght);
+ ret = (int64_t) g_hash_table_size(typed_map_obj->ght);
end:
return ret;
struct muxer_notif_iter *muxer_notif_iter)
{
struct bt_component *comp;
- uint64_t count;
- uint64_t i;
+ int64_t count;
+ int64_t i;
int ret = 0;
/*
*/
comp = bt_component_from_private_component(muxer_comp->priv_comp);
assert(comp);
- ret = bt_component_filter_get_input_port_count(comp, &count);
- if (ret) {
+ count = bt_component_filter_get_input_port_count(comp);
+ if (count < 0) {
goto end;
}
struct bt_port *upstream_port;
struct bt_port *downstream_port;
struct bt_graph *graph;
- size_t i;
- uint64_t count;
+ int64_t i;
+ int64_t count;
void *conn;
- int ret;
enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK;
clear_test_events();
/* Connect source output ports to muxer input ports */
if (with_upstream) {
- ret = bt_component_source_get_output_port_count(src_comp, &count);
- assert(ret == 0);
+ count = bt_component_source_get_output_port_count(src_comp);
+ assert(count >= 0);
for (i = 0; i < count; i++) {
upstream_port = bt_component_source_get_output_port_at_index(
{
struct bt_port *avail_muxer_port = NULL;
void *conn;
- uint64_t i;
- uint64_t count;
- int ret;
+ int64_t i;
+ int64_t count;
- ret = bt_component_filter_get_input_port_count(muxer_comp, &count);
- assert(ret == 0);
+ count = bt_component_filter_get_input_port_count(muxer_comp);
+ assert(count >= 0);
for (i = 0; i < count; i++) {
struct bt_port *muxer_port =
struct bt_port *upstream_port;
struct bt_port *downstream_port;
struct bt_graph *graph;
- size_t i;
- uint64_t count;
+ int64_t i;
+ int64_t count;
void *conn;
int ret;
enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK;
assert(ret == 0);
/* Connect source output ports to muxer input ports */
- ret = bt_component_source_get_output_port_count(src_comp, &count);
+ count = bt_component_source_get_output_port_count(src_comp);
assert(ret == 0);
for (i = 0; i < count; i++) {
struct bt_port *upstream_port;
struct bt_port *downstream_port;
struct bt_graph *graph;
- size_t i;
- uint64_t count;
+ int64_t i;
+ int64_t count;
void *conn;
int ret;
enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK;
assert(ret == 0);
/* Connect source output ports to muxer input ports */
- ret = bt_component_source_get_output_port_count(src_comp, &count);
+ count = bt_component_source_get_output_port_count(src_comp);
assert(ret == 0);
for (i = 0; i < count; i++) {