sink.text.pretty: abort on unknown field class type
[babeltrace.git] / src / plugins / ctf / common / bfcr / bfcr.cpp
index d1495a617187dc096a46ee7b9e076d2f600fc9ce..f59f65d0f2f076041982281a1fbd062a2351bcfc 100644 (file)
@@ -7,27 +7,26 @@
  * Babeltrace - CTF binary field class reader (BFCR)
  */
 
+#include <glib.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <babeltrace2/babeltrace.h>
+
 #define BT_COMP_LOG_SELF_COMP (bfcr->self_comp)
 #define BT_LOG_OUTPUT_LEVEL   (bfcr->log_level)
 #define BT_LOG_TAG            "PLUGIN/CTF/BFCR"
 #include "logging/comp-logging.h"
 
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <stdbool.h>
+#include "common/align.h"
 #include "common/assert.h"
-#include <string.h>
-#include "compat/bitfield.h"
 #include "common/common.h"
-#include <babeltrace2/babeltrace.h>
-#include "common/align.h"
-#include <glib.h>
+#include "compat/bitfield.h"
 
-#include "bfcr.hpp"
 #include "../metadata/ctf-meta.hpp"
+#include "bfcr.hpp"
 
 #define DIV8(_x)                ((_x) >> 3)
 #define BYTES_TO_BITS(_x)       ((_x) *8)
@@ -55,8 +54,6 @@ struct stack_entry
     int64_t index;
 };
 
-struct bt_bfcr;
-
 /* Visit stack */
 struct stack
 {
@@ -238,7 +235,7 @@ static int stack_push(struct stack *stack, struct ctf_field_class *base_class, s
         g_array_set_size(stack->entries, stack->size + 1);
     }
 
-    entry = &g_array_index(stack->entries, struct stack_entry, stack->size);
+    entry = &bt_g_array_index(stack->entries, struct stack_entry, stack->size);
     entry->base_class = base_class;
     entry->base_len = base_len;
     entry->index = 0;
@@ -335,7 +332,7 @@ static inline struct stack_entry *stack_top(struct stack *stack)
 {
     BT_ASSERT_DBG(stack);
     BT_ASSERT_DBG(stack_size(stack));
-    return &g_array_index(stack->entries, struct stack_entry, stack->size - 1);
+    return &bt_g_array_index(stack->entries, struct stack_entry, stack->size - 1);
 }
 
 static inline size_t available_bits(struct bt_bfcr *bfcr)
@@ -1103,7 +1100,6 @@ static inline enum bt_bfcr_status handle_state(struct bt_bfcr *bfcr)
     return status;
 }
 
-BT_HIDDEN
 struct bt_bfcr *bt_bfcr_create(struct bt_bfcr_cbs cbs, void *data, bt_logging_level log_level,
                                bt_self_component *self_comp)
 {
@@ -1137,7 +1133,6 @@ end:
     return bfcr;
 }
 
-BT_HIDDEN
 void bt_bfcr_destroy(struct bt_bfcr *bfcr)
 {
     if (bfcr->stack) {
@@ -1165,7 +1160,6 @@ static void update_packet_offset(struct bt_bfcr *bfcr)
     bfcr->buf.packet_offset += bfcr->buf.at;
 }
 
-BT_HIDDEN
 size_t bt_bfcr_start(struct bt_bfcr *bfcr, struct ctf_field_class *cls, const uint8_t *buf,
                      size_t offset, size_t packet_offset, size_t sz, enum bt_bfcr_status *status)
 {
@@ -1232,7 +1226,6 @@ end:
     return bfcr->buf.at;
 }
 
-BT_HIDDEN
 size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz,
                         enum bt_bfcr_status *status)
 {
@@ -1263,7 +1256,6 @@ size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz,
     return bfcr->buf.at;
 }
 
-BT_HIDDEN
 void bt_bfcr_set_unsigned_int_cb(struct bt_bfcr *bfcr, bt_bfcr_unsigned_int_cb_func cb)
 {
     BT_ASSERT_DBG(bfcr);
This page took 0.02447 seconds and 4 git commands to generate.