X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fcallbacks.c;h=fa212c9191e95fc5f5371201bf7883d22d9df05e;hp=591f5109f15de2af16b9aff5cfc2c5ef2f8afcbe;hb=aacd0c695fce3e2bcba4a1c6acd4c82346311b3e;hpb=34861b9ddd0eb8040ac54e51f9352c4d7ff6fead diff --git a/lib/callbacks.c b/lib/callbacks.c index 591f5109..fa212c91 100644 --- a/lib/callbacks.c +++ b/lib/callbacks.c @@ -25,6 +25,7 @@ #include #include #include +#include #include static @@ -62,7 +63,7 @@ struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...) */ int bt_iter_add_callback(struct bt_iter *iter, bt_intern_str event, void *private_data, int flags, - enum bt_cb_ret (*callback)(struct bt_ctf_data *ctf_data, + enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, void *private_data), struct bt_dependencies *depends, struct bt_dependencies *weak_depends, @@ -177,7 +178,7 @@ void process_callbacks(struct bt_iter *iter, struct bt_callback *cb; int i; enum bt_cb_ret ret; - struct bt_ctf_data ctf_data; + struct bt_ctf_event ctf_data; ctf_data.event = extract_ctf_stream_event(stream); ctf_data.stream = stream; @@ -205,7 +206,7 @@ void process_callbacks(struct bt_iter *iter, if (!bt_stream_cb || !bt_stream_cb->per_id_callbacks) goto end; - if (stream->event_id > bt_stream_cb->per_id_callbacks->len) + if (stream->event_id >= bt_stream_cb->per_id_callbacks->len) goto end; bt_chain = &g_array_index(bt_stream_cb->per_id_callbacks, struct bt_callback_chain, stream->event_id);