lib: strictly type function return status enumerations
[babeltrace.git] / src / lib / trace-ir / packet.c
index 585ed48b15ccafc3d1eb0281b4f1b44e95006044..d32da65a8a155bd176309168ddc2dd6317c6c9ba 100644 (file)
@@ -20,8 +20,8 @@
  * SOFTWARE.
  */
 
-#define BT_LOG_TAG "PACKET"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/PACKET"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/packet-const.h>
@@ -39,6 +39,7 @@
 #include "stream-class.h"
 #include "stream.h"
 #include "trace.h"
+#include "lib/func-status.h"
 
 #define BT_ASSERT_PRE_PACKET_HOT(_packet) \
        BT_ASSERT_PRE_HOT((_packet), "Packet", ": %!+a", (_packet))
@@ -220,13 +221,13 @@ struct bt_packet *bt_packet_create(const struct bt_stream *c_stream)
 
        BT_ASSERT_PRE_NON_NULL(stream, "Stream");
        packet = bt_object_pool_create_object(&stream->packet_pool);
-       if (unlikely(!packet)) {
+       if (G_UNLIKELY(!packet)) {
                BT_LIB_LOGE("Cannot allocate one packet from stream's packet pool: "
                        "%![stream-]+s", stream);
                goto end;
        }
 
-       if (likely(!packet->stream)) {
+       if (G_LIKELY(!packet->stream)) {
                packet->stream = stream;
                bt_object_get_no_null_check_no_parent_check(
                        &packet->stream->base);
@@ -236,7 +237,8 @@ end:
        return (void *) packet;
 }
 
-enum bt_packet_status bt_packet_move_context_field(struct bt_packet *packet,
+enum bt_packet_move_context_field_status bt_packet_move_context_field(
+               struct bt_packet *packet,
                struct bt_packet_context_field *context_field)
 {
        struct bt_stream_class *stream_class;
@@ -261,7 +263,7 @@ enum bt_packet_status bt_packet_move_context_field(struct bt_packet *packet,
 
        /* Move new field */
        packet->context_field = field_wrapper;
-       return BT_PACKET_STATUS_OK;
+       return BT_FUNC_STATUS_OK;
 }
 
 void bt_packet_get_ref(const struct bt_packet *packet)
This page took 0.024174 seconds and 4 git commands to generate.