Clean-up: Use memset() to initialize packet_index
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 26 Oct 2015 16:11:30 +0000 (12:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 22 Apr 2016 21:54:02 +0000 (17:54 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ctf.c

index 7d51b7dc544e2a700e8be0c0512a1cc883b1f690..917e950119607e4e4bef265f5e6ad90bd86e3a59 100644 (file)
@@ -1512,6 +1512,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
        int ret;
 
 begin:
        int ret;
 
 begin:
+       memset(&packet_index, 0, sizeof(packet_index));
        if (!pos->mmap_offset) {
                first_packet = 1;
        }
        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;
        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) {
 
        /* read and check header, set stream id (and check) */
        if (file_stream->parent.trace_packet_header) {
This page took 0.024356 seconds and 4 git commands to generate.