Fix -Wmissing-prototypes/-Wmissing-declarations warnings
[babeltrace.git] / src / plugins / ctf / fs-sink / translate-ctf-ir-to-tsdl.c
index 399f3b3cfc6291b6146b053e5007003104e4d446..d7a9b8483930c6150b0f7ae615a269cedbb16b42 100644 (file)
@@ -20,6 +20,8 @@
  * SOFTWARE.
  */
 
+#include "translate-ctf-ir-to-tsdl.h"
+
 #include <babeltrace2/babeltrace.h>
 #include "common/macros.h"
 #include <stdio.h>
@@ -216,11 +218,10 @@ void append_integer_field_class(struct ctx *ctx,
 {
        const bt_field_class *ir_fc = fc->base.base.ir_fc;
        bt_field_class_type type = bt_field_class_get_type(ir_fc);
-       bool is_signed = type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION ||
-               type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER;
+       bool is_signed = bt_field_class_type_is(type,
+               BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
 
-       if (type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION ||
-                       type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION) {
+       if (bt_field_class_type_is(type, BT_FIELD_CLASS_TYPE_ENUMERATION)) {
                g_string_append(ctx->tsdl, "enum : ");
        }
 
@@ -229,8 +230,7 @@ void append_integer_field_class(struct ctx *ctx,
                bt_field_class_integer_get_preferred_display_base(ir_fc),
                NULL, NULL, false);
 
-       if (type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION ||
-                       type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION) {
+       if (bt_field_class_type_is(type, BT_FIELD_CLASS_TYPE_ENUMERATION)) {
                uint64_t i;
 
                g_string_append(ctx->tsdl, " {\n");
@@ -334,7 +334,8 @@ void append_float_field_class(struct ctx *ctx,
 {
        unsigned int mant_dig, exp_dig;
 
-       if (bt_field_class_real_is_single_precision(fc->base.base.ir_fc)) {
+       if (bt_field_class_get_type(fc->base.base.ir_fc) ==
+                       BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL) {
                mant_dig = 24;
                exp_dig = 8;
        } else {
@@ -482,14 +483,14 @@ void append_struct_field_class_members(struct ctx *ctx,
                                ctx->indent_level++;
 
                                for (i = 0; i < var_fc->options->len; i++) {
-                                       struct fs_sink_ctf_named_field_class *named_fc =
+                                       struct fs_sink_ctf_named_field_class *option_named_fc =
                                                fs_sink_ctf_field_class_variant_borrow_option_by_index(
                                                        var_fc, i);
 
                                        append_indent(ctx);
                                        g_string_append_printf(ctx->tsdl,
                                                "\"%s\" = %" PRIu64 ",\n",
-                                               named_fc->name->str, i);
+                                               option_named_fc->name->str, i);
                                }
 
                                append_end_block(ctx);
This page took 0.025455 seconds and 4 git commands to generate.