X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Fcommon%2Fmetadata%2Fctf-meta-translate.c;h=9c9e23eeebc91f04def1e08291ff87011e35c890;hp=7d0d966acc0fada002887d520aa22f6630bce880;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=6da709aa5711ee57761028c143fc00b65026c15d diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.c b/src/plugins/ctf/common/metadata/ctf-meta-translate.c index 7d0d966a..9c9e23ee 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.c +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.c @@ -1,21 +1,14 @@ /* - * Copyright 2018 - Philippe Proulx + * SPDX-License-Identifier: MIT * - * 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. + * Copyright 2018 Philippe Proulx */ #include #include "common/macros.h" #include "common/assert.h" #include +#include #include #include #include @@ -115,11 +108,11 @@ bt_field_class *ctf_field_class_enum_to_ir(struct ctx *ctx, if (fc->base.is_signed) { ret = bt_field_class_enumeration_signed_add_mapping( ir_fc, mapping->label->str, range_set); - BT_RANGE_SET_SIGNED_PUT_REF_AND_RESET(range_set); + BT_INTEGER_RANGE_SET_SIGNED_PUT_REF_AND_RESET(range_set); } else { ret = bt_field_class_enumeration_unsigned_add_mapping( ir_fc, mapping->label->str, range_set); - BT_RANGE_SET_UNSIGNED_PUT_REF_AND_RESET(range_set); + BT_INTEGER_RANGE_SET_UNSIGNED_PUT_REF_AND_RESET(range_set); } BT_ASSERT(ret == 0); @@ -134,13 +127,12 @@ bt_field_class *ctf_field_class_float_to_ir(struct ctx *ctx, { bt_field_class *ir_fc; - ir_fc = bt_field_class_real_create(ctx->ir_tc); - BT_ASSERT(ir_fc); - if (fc->base.size == 32) { - bt_field_class_real_set_is_single_precision(ir_fc, - BT_TRUE); + ir_fc = bt_field_class_real_single_precision_create(ctx->ir_tc); + } else { + ir_fc = bt_field_class_real_double_precision_create(ctx->ir_tc); } + BT_ASSERT(ir_fc); return ir_fc; } @@ -303,7 +295,7 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, bt_field_class_enumeration_signed_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_selector_signed_append_option( + ret = bt_field_class_variant_with_selector_field_integer_signed_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } else { @@ -319,7 +311,7 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_selector_unsigned_append_option( + ret = bt_field_class_variant_with_selector_field_integer_unsigned_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } @@ -427,7 +419,7 @@ bt_field_class *ctf_field_class_to_ir(struct ctx *ctx, ir_fc = ctf_field_class_variant_to_ir(ctx, (void *) fc); break; default: - abort(); + bt_common_abort(); } fc->ir_fc = ir_fc; @@ -485,7 +477,7 @@ bt_field_class *scope_ctf_field_class_to_ir(struct ctx *ctx) fc = ctx->ec->payload_fc; break; default: - abort(); + bt_common_abort(); } if (fc && ctf_field_class_struct_has_immediate_member_in_ir(