Fix API: add const qualifiers, privatize struct bt_ctf_event
[babeltrace.git] / lib / iterator.c
index f79a1d24c222344c8ff890161af2fcb258c2d2d2..e50846f4cb6179a7cd2eb1ac1903f042d4da5f1e 100644 (file)
@@ -110,8 +110,7 @@ static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs,
        for (i = 0; i < stream_pos->packet_index->len; i++) {
                index = &g_array_index(stream_pos->packet_index,
                                struct packet_index, i);
-               if (index->timestamp_begin >= timestamp ||
-                               index->timestamp_end <= timestamp)
+               if (index->timestamp_end <= timestamp)
                        continue;
 
                stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET);
@@ -225,8 +224,6 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)
                        if (ret)
                                goto error;
                }
-       case BT_SEEK_BEGIN:
-               /* fall-through to seek time of 0 */
        case BT_SEEK_TIME:
                tc = iter->ctx->tc;
 
@@ -433,8 +430,8 @@ end:
 
 int bt_iter_init(struct bt_iter *iter,
                struct bt_context *ctx,
-               struct bt_iter_pos *begin_pos,
-               struct bt_iter_pos *end_pos)
+               const struct bt_iter_pos *begin_pos,
+               const struct bt_iter_pos *end_pos)
 {
        int i, stream_id;
        int ret = 0;
@@ -499,8 +496,8 @@ error_heap_init:
 }
 
 struct bt_iter *bt_iter_create(struct bt_context *ctx,
-               struct bt_iter_pos *begin_pos,
-               struct bt_iter_pos *end_pos)
+               const struct bt_iter_pos *begin_pos,
+               const struct bt_iter_pos *end_pos)
 {
        struct bt_iter *iter;
        int ret;
This page took 0.023839 seconds and 4 git commands to generate.