Start packet mmap work
[babeltrace.git] / formats / ctf / types / float.c
index ee9a8318660f115d5787f94cf50becd4ab99de70..3d84952bbb547480f97bbd77768d55113b42f820 100644 (file)
@@ -111,15 +111,16 @@ double ctf_double_read(struct stream_pos *srcp,
                       const struct declaration_float *float_declaration)
 {
        union doubleIEEE754 u;
-       struct declaration_float *dest_declaration = float_declaration_new(NULL,
-                               DBL_MANT_DIG,
+       struct declaration_float *dest_declaration =
+               float_declaration_new(DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
                                __alignof__(double));
        struct stream_pos destp;
 
        align_pos(srcp, float_declaration->p.alignment);
-       init_pos(&destp, (char *) u.bits);
+       init_pos(&destp, -1);
+       destp.base = (char *) u.bits;
        _ctf_float_copy(&destp, dest_declaration, srcp, float_declaration);
        declaration_unref(&dest_declaration->p);
        return u.v;
@@ -130,8 +131,8 @@ void ctf_double_write(struct stream_pos *destp,
                      double v)
 {
        union doubleIEEE754 u;
-       struct declaration_float *src_declaration = float_declaration_new(NULL,
-                               DBL_MANT_DIG,
+       struct declaration_float *src_declaration =
+               float_declaration_new(DBL_MANT_DIG,
                                sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
                                BYTE_ORDER,
                                __alignof__(double));
@@ -139,7 +140,8 @@ void ctf_double_write(struct stream_pos *destp,
 
        u.v = v;
        align_pos(destp, float_declaration->p.alignment);
-       init_pos(&srcp, (char *) u.bits);
+       init_pos(&srcp, -1);
+       srcp.base = (char *) u.bits;
        _ctf_float_copy(destp, float_declaration, &srcp, src_declaration);
        declaration_unref(&src_declaration->p);
 }
@@ -148,15 +150,16 @@ long double ctf_ldouble_read(struct stream_pos *srcp,
                             const struct declaration_float *float_declaration)
 {
        union ldoubleIEEE754 u;
-       struct declaration_float *dest_declaration = float_declaration_new(NULL,
-                               LDBL_MANT_DIG,
+       struct declaration_float *dest_declaration =
+               float_declaration_new(LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
                                __alignof__(long double));
        struct stream_pos destp;
 
        align_pos(srcp, float_declaration->p.alignment);
-       init_pos(&destp, (char *) u.bits);
+       init_pos(&destp, -1);
+       destp.base = (char *) u.bits;
        _ctf_float_copy(&destp, dest_declaration, srcp, float_declaration);
        declaration_unref(&dest_declaration->p);
        return u.v;
@@ -167,8 +170,8 @@ void ctf_ldouble_write(struct stream_pos *destp,
                       long double v)
 {
        union ldoubleIEEE754 u;
-       struct declaration_float *src_declaration = float_declaration_new(NULL,
-                               LDBL_MANT_DIG,
+       struct declaration_float *src_declaration =
+               float_declaration_new(LDBL_MANT_DIG,
                                sizeof(long double) * CHAR_BIT - LDBL_MANT_DIG,
                                BYTE_ORDER,
                                __alignof__(long double));
@@ -176,7 +179,8 @@ void ctf_ldouble_write(struct stream_pos *destp,
 
        u.v = v;
        align_pos(destp, float_declaration->p.alignment);
-       init_pos(&srcp, (char *) u.bits);
+       init_pos(&srcp, -1);
+       srcp.base = (char *) u.bits;
        _ctf_float_copy(destp, float_declaration, &srcp, src_declaration);
        declaration_unref(&src_declaration->p);
 }
This page took 0.024373 seconds and 4 git commands to generate.