Replace all assert(false) and assert(0) with abort()
[babeltrace.git] / include / babeltrace / ctf-writer / serialize-internal.h
index 6471993c23a5c739c5e3e1b87c1446fb46c354d3..5cf8c5bd660a787a54d7f61df37df993dff5371b 100644 (file)
@@ -26,6 +26,7 @@
  * http://www.efficios.com/ctf
  */
 
+#include <stdlib.h>
 #include <stdint.h>
 #include <limits.h>
 #include <sys/mman.h>
@@ -48,7 +49,6 @@ struct bt_ctf_stream_pos {
        off_t mmap_offset;      /* mmap offset in the file, in bytes */
        off_t mmap_base_offset; /* offset of start of packet in mmap, in bytes */
        uint64_t packet_size;   /* current packet size, in bits */
-       uint64_t content_size;  /* current content size, in bits */
        int64_t offset;         /* offset from base, in bits. EOF for end of file. */
        struct mmap_align *base_mma;/* mmap base address */
 };
@@ -70,12 +70,13 @@ int bt_ctf_stream_pos_access_ok(struct bt_ctf_stream_pos *pos, uint64_t bit_len)
 
        if (unlikely(pos->offset == EOF))
                return 0;
+
        if (pos->prot == PROT_READ) {
                /*
                 * Reads may only reach up to the "content_size",
                 * regardless of the packet_size.
                 */
-               max_len = pos->content_size;
+               max_len = pos->offset;
        } else {
                /* Writes may take place up to the end of the packet. */
                max_len = pos->packet_size;
@@ -131,7 +132,7 @@ int bt_ctf_stream_pos_init(struct bt_ctf_stream_pos *pos,
                pos->flags = MAP_SHARED;
                break;
        default:
-               assert(BT_FALSE);
+               abort();
        }
 
        return 0;
This page took 0.038665 seconds and 4 git commands to generate.