- union doubleIEEE754 u;
- struct ctf_float dest = {
- .exp_len = sizeof(double) * CHAR_BIT - DBL_MANT_DIG,
- .mantissa_len = DBL_MANT_DIG,
- .byte_order = BYTE_ORDER,
- };
-
- float_copy(&u.bits, &dest, ptr, src);
- 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, NULL);
+ struct definition_float *tmpfloat =
+ container_of(tmpdef, struct definition_float, p);
+ struct ctf_stream_pos destp;
+ int ret;
+
+ ctf_init_pos(&destp, -1, O_RDWR);
+ destp.base = (char *) u.bits;
+
+ ctf_align_pos(pos, float_declaration->p.alignment);
+ ret = _ctf_float_copy(&destp.parent, tmpfloat, ppos, float_definition);
+ float_definition->value = u.v;
+ definition_unref(tmpdef);
+ return ret;