Parser test should report AST creation errors
[babeltrace.git] / types / float.c
index b3e0dc1cfc3808c27ebf16ee8be6e731a91a39f0..2ce6b5929d50d5f5609ef1ee8c96787208acd9df 100644 (file)
  */
 
 #include <babeltrace/compiler.h>
-#include <babeltrace/types.h>
+#include <babeltrace/format.h>
 
-void float_copy(struct stream_pos *dest, const struct format *fdest, 
-               struct stream_pos *src, const struct format *fsrc,
+void float_copy(struct stream_pos *destp,
+               const struct format *fdest,
+               struct stream_pos *srcp,
+               const struct format *fsrc,
                const struct type_class *type_class)
 {
        struct type_class_float *float_class =
                container_of(type_class, struct type_class_float, p);
 
        if (fsrc->float_copy == fdest->float_copy) {
-               fsrc->float_copy(dest, src, float_class);
+               fsrc->float_copy(destp, srcp, float_class);
        } else {
                double v;
 
-               v = fsrc->double_read(src, float_class);
-               fdest->double_write(dest, float_class, v);
+               v = fsrc->double_read(srcp, float_class);
+               fdest->double_write(destp, float_class, v);
        }
 }
 
@@ -57,7 +59,6 @@ struct type_class_float *float_type_new(const char *name,
                                        size_t alignment)
 {
        struct type_class_float *float_class;
-       struct type_class_integer *int_class;
        struct type_class *type_class;
        int ret;
 
@@ -68,6 +69,7 @@ struct type_class_float *float_type_new(const char *name,
        type_class->alignment = alignment;
        type_class->copy = float_copy;
        type_class->free = _float_type_free;
+       type_class->ref = 1;
        float_class->byte_order = byte_order;
 
        float_class->sign = integer_type_new(NULL, 1,
@@ -84,7 +86,7 @@ struct type_class_float *float_type_new(const char *name,
                goto error_exp;
 
        if (float_class->p.name) {
-               ret = ctf_register_type(&float_class->p);
+               ret = register_type(&float_class->p);
                if (ret)
                        goto error_register;
        }
This page took 0.023287 seconds and 4 git commands to generate.