X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fmessage%2Fpacket.c;h=84dd8c4c29e609a4faeeb7088fbe1cef0da59f5d;hb=d98421f2abfc5adab28ab7ee9b63537a6c7261cc;hp=637156d3c1f6b18cb6553c8cd99466bcb6fa3f61;hpb=98b15851a941e7342b8bb19e265cdc3a40fabfb8;p=babeltrace.git diff --git a/src/lib/graph/message/packet.c b/src/lib/graph/message/packet.c index 637156d3..84dd8c4c 100644 --- a/src/lib/graph/message/packet.c +++ b/src/lib/graph/message/packet.c @@ -1,31 +1,16 @@ /* + * SPDX-License-Identifier: MIT + * * Copyright 2017-2018 Philippe Proulx * Copyright 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ #define BT_LOG_TAG "LIB/MSG-PACKET" #include "lib/logging.h" -#include "lib/assert-pre.h" -#include "lib/assert-post.h" +#include + +#include "lib/assert-cond.h" #include "compat/compiler.h" #include #include "lib/trace-ir/packet.h" @@ -34,10 +19,7 @@ #include "lib/trace-ir/stream.h" #include "lib/trace-ir/stream-class.h" #include "lib/graph/graph.h" -#include -#include -#include -#include +#include #include "common/assert.h" #include "lib/object.h" #include @@ -83,7 +65,7 @@ struct bt_message *bt_message_packet_end_new(struct bt_graph *graph) static inline struct bt_message *create_packet_message( - struct bt_self_component_port_input_message_iterator *msg_iter, + struct bt_message_iterator *msg_iter, struct bt_packet *packet, struct bt_object_pool *pool, bool with_cs, uint64_t raw_value) { @@ -169,9 +151,10 @@ struct bt_message *bt_message_packet_beginning_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet) { - struct bt_self_component_port_input_message_iterator *msg_iter = + struct bt_message_iterator *msg_iter = (void *) self_msg_iter; + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); return create_packet_message(msg_iter, (void *) packet, &msg_iter->graph->packet_begin_msg_pool, false, 0); @@ -181,9 +164,10 @@ struct bt_message *bt_message_packet_beginning_create_with_default_clock_snapsho struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet, uint64_t raw_value) { - struct bt_self_component_port_input_message_iterator *msg_iter = + struct bt_message_iterator *msg_iter = (void *) self_msg_iter; + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); return create_packet_message(msg_iter, (void *) packet, &msg_iter->graph->packet_begin_msg_pool, true, raw_value); @@ -193,9 +177,10 @@ struct bt_message *bt_message_packet_end_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet) { - struct bt_self_component_port_input_message_iterator *msg_iter = + struct bt_message_iterator *msg_iter = (void *) self_msg_iter; + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); return create_packet_message(msg_iter, (void *) packet, &msg_iter->graph->packet_end_msg_pool, false, 0); @@ -205,9 +190,10 @@ struct bt_message *bt_message_packet_end_create_with_default_clock_snapshot( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet, uint64_t raw_value) { - struct bt_self_component_port_input_message_iterator *msg_iter = + struct bt_message_iterator *msg_iter = (void *) self_msg_iter; + BT_ASSERT_PRE_DEV_NO_ERROR(); BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator"); return create_packet_message(msg_iter, (void *) packet, &msg_iter->graph->packet_end_msg_pool, true, raw_value);