From 5f75b32d8fb09e51e5f746461abce90572e7ba73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 26 Oct 2015 12:11:30 -0400 Subject: [PATCH 1/1] Clean-up: Use memset() to initialize packet_index MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- formats/ctf/ctf.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 7d51b7dc..917e9501 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1512,6 +1512,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos, int ret; begin: + memset(&packet_index, 0, sizeof(packet_index)); if (!pos->mmap_offset) { first_packet = 1; } @@ -1543,16 +1544,6 @@ begin: pos->offset = 0; /* Position of the packet header */ packet_index.offset = pos->mmap_offset; - packet_index.content_size = 0; - packet_index.packet_size = 0; - packet_index.ts_real.timestamp_begin = 0; - packet_index.ts_real.timestamp_end = 0; - packet_index.ts_cycles.timestamp_begin = 0; - packet_index.ts_cycles.timestamp_end = 0; - packet_index.events_discarded = 0; - packet_index.events_discarded_len = 0; - packet_index.stream_instance_id = 0; - packet_index.packet_seq_num = 0; /* read and check header, set stream id (and check) */ if (file_stream->parent.trace_packet_header) { -- 2.34.1