X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Ftrace-ir%2Fpacket.c;h=2b33bb80bf9562f61c39cdaaa4d9a1933ac7c9fc;hb=d98421f2abfc5adab28ab7ee9b63537a6c7261cc;hp=166f7ca2e5d433532d11d712e4d1f276b421d61d;hpb=17f3083a0b4d318d3303c8a5bfa63db6a874ec73;p=babeltrace.git diff --git a/src/lib/trace-ir/packet.c b/src/lib/trace-ir/packet.c index 166f7ca2..2b33bb80 100644 --- a/src/lib/trace-ir/packet.c +++ b/src/lib/trace-ir/packet.c @@ -1,30 +1,13 @@ /* - * Copyright 2016-2018 Philippe Proulx - * - * 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. + * SPDX-License-Identifier: MIT * - * 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. + * Copyright 2016-2018 Philippe Proulx */ #define BT_LOG_TAG "LIB/PACKET" #include "lib/logging.h" -#include "lib/assert-pre.h" -#include +#include "lib/assert-cond.h" #include #include #include @@ -242,36 +225,6 @@ end: return (void *) 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; - struct bt_field_wrapper *field_wrapper = (void *) context_field; - - BT_ASSERT_PRE_DEV_NO_ERROR(); - BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet"); - BT_ASSERT_PRE_DEV_NON_NULL(field_wrapper, "Context field"); - BT_ASSERT_PRE_DEV_HOT(packet, "Packet", ": %!+a", packet); - stream_class = packet->stream->class; - BT_ASSERT_PRE_DEV(stream_class->packet_context_fc, - "Stream class has no packet context field class: %!+S", - stream_class); - BT_ASSERT_PRE_DEV(field_wrapper->field->class == - stream_class->packet_context_fc, - "Unexpected packet context field's class: " - "%![fc-]+F, %![expected-fc-]+F", field_wrapper->field->class, - stream_class->packet_context_fc); - - /* Recycle current context field: always exists */ - BT_ASSERT(packet->context_field); - recycle_context_field(packet->context_field, stream_class); - - /* Move new field */ - packet->context_field = field_wrapper; - return BT_FUNC_STATUS_OK; -} - void bt_packet_get_ref(const struct bt_packet *packet) { bt_object_get_ref(packet);