all: Fix implicit conversion from double to float.
These are found when building with -Wfloat-conversion.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user