diff options
author | stijn <stijn@ignitron.net> | 2020-03-31 10:08:57 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-18 22:36:06 +1000 |
commit | b909e8b2dd007d8e7d61547768518b29bb4f833c (patch) | |
tree | c913e1a2ea4c7998b3b80138fdcf71bab7f592e7 /py/binary.c | |
parent | 4677315a01cbf94f56d244a9064098f6f1a1fad8 (diff) | |
download | micropython-b909e8b2dd007d8e7d61547768518b29bb4f833c.tar.gz micropython-b909e8b2dd007d8e7d61547768518b29bb4f833c.zip |
Revert "all: Fix implicit casts of float/double, and signed comparison."
This reverts commit a2110bd3fca59df8b16a2b5fe4645a4af30b06ed. There's
nothing inherently wrong with it, but upcoming commits will apply similar
fixes in a slightly different way.
Diffstat (limited to 'py/binary.c')
-rw-r--r-- | py/binary.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/binary.c b/py/binary.c index c47d9d3fe1..b294387706 100644 --- a/py/binary.c +++ b/py/binary.c @@ -176,9 +176,9 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, size_t index) { #endif #if MICROPY_PY_BUILTINS_FLOAT case 'f': - return mp_obj_new_float((mp_float_t)((float *)p)[index]); + return mp_obj_new_float(((float *)p)[index]); case 'd': - return mp_obj_new_float((mp_float_t)((double *)p)[index]); + return mp_obj_new_float(((double *)p)[index]); #endif // Extension to CPython: array of objects case 'O': @@ -244,12 +244,12 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte *p_base, byte * union { uint32_t i; float f; } fpu = {val}; - return mp_obj_new_float((mp_float_t)fpu.f); + return mp_obj_new_float(fpu.f); } else if (val_type == 'd') { union { uint64_t i; double f; } fpu = {val}; - return mp_obj_new_float((mp_float_t)fpu.f); + return mp_obj_new_float(fpu.f); #endif } else if (is_signed(val_type)) { if ((long long)MP_SMALL_INT_MIN <= val && val <= (long long)MP_SMALL_INT_MAX) { |