X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Fcommon%2Fmsg-iter%2Fmsg-iter.c;h=dd350c75ecfe4bb52f7b3b3904aeff1a5fed0334;hp=20ca19de04e6ebda4950975e0dd7b943e7548e39;hb=fe4df857056b4a03898f1031f136359ce733b0f5;hpb=4bf5c85fc4fe021489669155ae5de25e86397575 diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.c b/src/plugins/ctf/common/msg-iter/msg-iter.c index 20ca19de..dd350c75 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.c +++ b/src/plugins/ctf/common/msg-iter/msg-iter.c @@ -2113,11 +2113,17 @@ enum bt_bfcr_status bfcr_floating_point_cb(double value, } field = borrow_next_field(notit); + bt_field_class_type type = bt_field_get_class_type(field); BT_ASSERT(field); BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc); - BT_ASSERT(bt_field_get_class_type(field) == - BT_FIELD_CLASS_TYPE_REAL); - bt_field_real_set_value(field, value); + BT_ASSERT(type == BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL || + type == BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL); + + if (type == BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL) { + bt_field_real_single_precision_set_value(field, (float) value); + } else { + bt_field_real_double_precision_set_value(field, value); + } stack_top(notit->stack)->index++; end: