aboutsummaryrefslogtreecommitdiff
path: root/py/binary.c
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-04-13 20:56:31 +0200
committerDamien George <damien.p.george@gmail.com>2020-04-18 22:42:24 +1000
commit70affd9ba22e7f62666a9a2fafc2a3c0be9ef95a (patch)
tree068485d00339bf0b89a5b8ea328396ffa21a0b14 /py/binary.c
parentbcf01d1686a8fa6d257daea25ce0d7df6e4ad839 (diff)
all: Fix implicit floating point to integer conversions.
These are found when building with -Wfloat-conversion.
Diffstat (limited to 'py/binary.c')
-rw-r--r--py/binary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/binary.c b/py/binary.c
index a53b8847c..d0f72ec23 100644
--- a/py/binary.c
+++ b/py/binary.c
@@ -419,10 +419,10 @@ void mp_binary_set_val_array_from_int(char typecode, void *p, size_t index, mp_i
#endif
#if MICROPY_PY_BUILTINS_FLOAT
case 'f':
- ((float *)p)[index] = val;
+ ((float *)p)[index] = (float)val;
break;
case 'd':
- ((double *)p)[index] = val;
+ ((double *)p)[index] = (double)val;
break;
#endif
// Extension to CPython: array of pointers