all: Fix implicit conversion from double to float.

These are found when building with -Wfloat-conversion.
This commit is contained in:
stijn
2020-03-31 14:48:08 +02:00
committed by Damien George
parent dc4d119d3d
commit bcf01d1686
23 changed files with 266 additions and 265 deletions

View File

@@ -332,12 +332,13 @@ class RawCode(object):
"#if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A || MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B"
)
print(
"STATIC const mp_obj_float_t %s = {{&mp_type_float}, %.16g};" % (obj_name, obj)
"STATIC const mp_obj_float_t %s = {{&mp_type_float}, (mp_float_t)%.16g};"
% (obj_name, obj)
)
print("#endif")
elif type(obj) is complex:
print(
"STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, %.16g, %.16g};"
"STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, (mp_float_t)%.16g, (mp_float_t)%.16g};"
% (obj_name, obj.real, obj.imag)
)
else: