[lttng-dev] [BABELTRACE PATCH] Use the generic call to move_pos_slow

Julien Desfossez julien.desfossez at polymtl.ca
Tue Dec 13 00:35:26 EST 2011


Replace two hardcoded calls to ctf_move_pos_slow by calls to the
function pointer registered when opening a trace.

Signed-off-by: Julien Desfossez <julien.desfossez at polymtl.ca>
---
 converter/babeltrace-lib.c     |    2 +-
 include/babeltrace/ctf/types.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/converter/babeltrace-lib.c b/converter/babeltrace-lib.c
index 0753621..518ec61 100644
--- a/converter/babeltrace-lib.c
+++ b/converter/babeltrace-lib.c
@@ -279,7 +279,7 @@ static int babeltrace_filestream_seek(struct ctf_file_stream *file_stream,
 		 */
 		break;
 	case BT_SEEK_BEGIN:
-		ctf_move_pos_slow(&file_stream->pos, 0, SEEK_SET);
+		file_stream->pos.move_pos_slow(&file_stream->pos, 0, SEEK_SET);
 		ret = stream_read_event(file_stream);
 		break;
 	case BT_SEEK_TIME:
diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h
index 60749a6..68ccf7a 100644
--- a/include/babeltrace/ctf/types.h
+++ b/include/babeltrace/ctf/types.h
@@ -192,7 +192,7 @@ void ctf_pos_get_event(struct ctf_stream_pos *pos)
 	if (pos->offset == pos->content_size) {
 		printf_debug("ctf_move_pos_slow (before call): %zd\n",
 			     pos->offset);
-		ctf_move_pos_slow(pos, 0, SEEK_CUR);
+		pos->move_pos_slow(pos, 0, SEEK_CUR);
 		printf_debug("ctf_move_pos_slow (after call): %zd\n",
 			     pos->offset);
 	}
-- 
1.7.7.3




More information about the lttng-dev mailing list