CTF float/types compile fixes
[babeltrace.git] / formats / ctf / types / float.c
index be068316eb9241084abd4b0e662d6f2acd1880a9..000bc18361f2a081abcb2f7aa7825f3b1daafef2 100644 (file)
@@ -111,7 +111,7 @@ double ctf_double_read(struct stream_pos *srcp,
                       const struct type_class_float *float_class)
 {
        union doubleIEEE754 u;
-       struct type_class_float *dest_class = float_type_new(NULL,
+       struct type_class_float *dest_class = float_type_class_new(NULL,
                                DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
@@ -119,9 +119,9 @@ double ctf_double_read(struct stream_pos *srcp,
        struct stream_pos destp;
 
        align_pos(srcp, float_class->p.alignment);
-       init_pos(&destp, (unsigned char *) u.bits);
+       init_pos(&destp, (char *) u.bits);
        _ctf_float_copy(&destp, dest_class, srcp, float_class);
-       float_type_free(dest_class);
+       type_class_unref(&dest_class->p);
        return u.v;
 }
 
@@ -130,7 +130,7 @@ void ctf_double_write(struct stream_pos *destp,
                      double v)
 {
        union doubleIEEE754 u;
-       struct type_class_float *src_class = float_type_new(NULL,
+       struct type_class_float *src_class = float_type_class_new(NULL,
                                DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
@@ -139,16 +139,16 @@ void ctf_double_write(struct stream_pos *destp,
 
        u.v = v;
        align_pos(destp, float_class->p.alignment);
-       init_pos(&srcp, (unsigned char *) u.bits);
+       init_pos(&srcp, (char *) u.bits);
        _ctf_float_copy(destp, float_class, &srcp, src_class);
-       float_type_free(src_class);
+       type_class_unref(&src_class->p);
 }
 
 long double ctf_ldouble_read(struct stream_pos *srcp,
                             const struct type_class_float *float_class)
 {
        union ldoubleIEEE754 u;
-       struct type_class_float *dest_class = float_type_new(NULL,
+       struct type_class_float *dest_class = float_type_class_new(NULL,
                                LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
@@ -156,9 +156,9 @@ long double ctf_ldouble_read(struct stream_pos *srcp,
        struct stream_pos destp;
 
        align_pos(srcp, float_class->p.alignment);
-       init_pos(&destp, (unsigned char *) u.bits);
+       init_pos(&destp, (char *) u.bits);
        _ctf_float_copy(&destp, dest_class, srcp, float_class);
-       float_type_free(dest_class);
+       type_class_unref(&dest_class->p);
        return u.v;
 }
 
@@ -167,7 +167,7 @@ void ctf_ldouble_write(struct stream_pos *destp,
                       long double v)
 {
        union ldoubleIEEE754 u;
-       struct type_class_float *src_class = float_type_new(NULL,
+       struct type_class_float *src_class = float_type_class_new(NULL,
                                LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
@@ -176,7 +176,7 @@ void ctf_ldouble_write(struct stream_pos *destp,
 
        u.v = v;
        align_pos(destp, float_class->p.alignment);
-       init_pos(&srcp, (unsigned char *) u.bits);
+       init_pos(&srcp, (char *) u.bits);
        _ctf_float_copy(destp, float_class, &srcp, src_class);
-       float_type_free(src_class);
+       type_class_unref(&src_class->p);
 }
This page took 0.027568 seconds and 4 git commands to generate.