projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finish float
[babeltrace.git]
/
types
/
float.c
diff --git
a/types/float.c
b/types/float.c
index 2f40d930b6d87c119da1c95fe350439ed2adfc5b..5c2e7f8d2a99c06648035a25adce79facd815502 100644
(file)
--- a/
types/float.c
+++ b/
types/float.c
@@
-29,12
+29,12
@@
void float_copy(struct stream_pos *dest, const struct format *fdest,
container_of(type_class, struct type_class_float, p);
if (fsrc->float_copy == fdest->float_copy) {
container_of(type_class, struct type_class_float, p);
if (fsrc->float_copy == fdest->float_copy) {
- fsrc->float_copy(dest,
float_class,
src, float_class);
+ fsrc->float_copy(dest, src, float_class);
} else {
double v;
} else {
double v;
- v = fsrc->double_read(src, f
src
);
- fdest->double_write(dest, f
dest
, v);
+ v = fsrc->double_read(src, f
loat_class
);
+ fdest->double_write(dest, f
loat_class
, v);
}
}
}
}
@@
-70,7
+70,11
@@
struct type_class_float *float_type_new(const char *name,
type_class->free = _float_type_free;
float_class->byte_order = byte_order;
type_class->free = _float_type_free;
float_class->byte_order = byte_order;
- float_class->mantissa = bitfield_type_new(NULL, mantissa_len,
+ float_class->sign = bitfield_type_new(NULL, 1,
+ byte_order, false, 1);
+ if (!float_class->mantissa)
+ goto error_sign;
+ float_class->mantissa = bitfield_type_new(NULL, mantissa_len - 1,
byte_order, false, 1);
if (!float_class->mantissa)
goto error_mantissa;
byte_order, false, 1);
if (!float_class->mantissa)
goto error_mantissa;
@@
-91,6
+95,8
@@
error_register:
error_exp:
bitfield_type_free(float_class->mantissa);
error_mantissa:
error_exp:
bitfield_type_free(float_class->mantissa);
error_mantissa:
+ bitfield_type_free(float_class->sign);
+error_sign:
g_free(float_class);
return NULL;
}
g_free(float_class);
return NULL;
}
This page took
0.02501 seconds
and
4
git commands to generate.