- align_pos(src, float_type->p.alignment);
- align_pos(dest, float_type->p.alignment);
- _ctf_float_copy(dest, float_type, src, float_type);
-}
-
-double ctf_double_read(struct stream_pos *srcp,
- const struct type_float *float_type)
-{
- union doubleIEEE754 u;
- struct type_float *dest_type = float_type_new(NULL,
- DBL_MANT_DIG,
- sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
- BYTE_ORDER,
- __alignof__(double));
- struct stream_pos destp;
-
- align_pos(srcp, float_type->p.alignment);
- init_pos(&destp, (char *) u.bits);
- _ctf_float_copy(&destp, dest_type, srcp, float_type);
- type_unref(&dest_type->p);
- return u.v;
+ struct definition_float *float_definition =
+ container_of(definition, struct definition_float, p);
+ const struct declaration_float *float_declaration =
+ float_definition->declaration;
+ struct ctf_stream_pos *pos = ctf_pos(ppos);
+ union ldoubleIEEE754 u;
+ struct definition *tmpdef =
+ static_ldouble_declaration->p.definition_new(&static_ldouble_declaration->p,
+ NULL, 0, 0);
+ struct definition_float *tmpfloat =
+ container_of(tmpdef, struct definition_float, p);
+ struct ctf_stream_pos destp;
+
+ ctf_init_pos(&destp, -1, O_WRONLY);
+ destp.base = (char *) u.bits;
+
+ ctf_align_pos(pos, float_declaration->p.alignment);
+ _ctf_float_copy(&destp.parent, tmpfloat, ppos, float_definition);
+ float_definition->value = u.v;
+ definition_unref(tmpdef);