X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=a63eb60b496c1ca85c9b2621ec7a3985d9c4635d;hp=d214d1aae4f25c0bd4d0c9b027187aa9b1113abc;hb=1ae19169d9cb823765444d22cdb05cd2ed3f162f;hpb=8563e754804a60faf870282d494ea419dc87016b diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index d214d1aa..a63eb60b 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -49,7 +49,8 @@ extern int yydebug; struct trace_descriptor *ctf_open_trace(const char *path, int flags); void ctf_close_trace(struct trace_descriptor *descriptor); -static rw_dispatch read_dispatch_table[] = { +static +rw_dispatch read_dispatch_table[] = { [ CTF_TYPE_INTEGER ] = ctf_integer_read, [ CTF_TYPE_FLOAT ] = ctf_float_read, [ CTF_TYPE_ENUM ] = ctf_enum_read, @@ -60,7 +61,8 @@ static rw_dispatch read_dispatch_table[] = { [ CTF_TYPE_SEQUENCE ] = ctf_sequence_rw, }; -static rw_dispatch write_dispatch_table[] = { +static +rw_dispatch write_dispatch_table[] = { [ CTF_TYPE_INTEGER ] = ctf_integer_write, [ CTF_TYPE_FLOAT ] = ctf_float_write, [ CTF_TYPE_ENUM ] = ctf_enum_write, @@ -71,6 +73,7 @@ static rw_dispatch write_dispatch_table[] = { [ CTF_TYPE_SEQUENCE ] = ctf_sequence_rw, }; +static struct format ctf_format = { .open_trace = ctf_open_trace, .close_trace = ctf_close_trace, @@ -92,7 +95,6 @@ void ctf_init_pos(struct ctf_stream_pos *pos, int fd, int open_flags) sizeof(struct packet_index)); else pos->packet_index = NULL; - switch (open_flags & O_ACCMODE) { case O_RDONLY: pos->prot = PROT_READ; @@ -622,11 +624,10 @@ void ctf_close_trace(struct trace_descriptor *tdp) for (i = 0; i < td->streams->len; i++) { struct ctf_stream *stream; int j; - stream = g_ptr_array_index(td->streams, i); for (j = 0; j < stream->files->len; j++) { struct ctf_file_stream *file_stream; - file_stream = g_ptr_array_index(td->streams, j); + file_stream = g_ptr_array_index(stream->files, j); ctf_close_file_stream(file_stream); }