summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/binary.c8
-rw-r--r--py/objarray.c2
-rw-r--r--py/parsenum.c2
3 files changed, 6 insertions, 6 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) {
diff --git a/py/objarray.c b/py/objarray.c
index 4947f75905..20232040ed 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -445,7 +445,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
}
#endif
if (len_adj > 0) {
- if ((size_t)len_adj > o->free) {
+ if (len_adj > o->free) {
// TODO: alloc policy; at the moment we go conservative
o->items = m_renew(byte, o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz);
o->free = len_adj;
diff --git a/py/parsenum.c b/py/parsenum.c
index e665da7d8c..234248c9de 100644
--- a/py/parsenum.c
+++ b/py/parsenum.c
@@ -220,7 +220,7 @@ mp_obj_t mp_parse_num_decimal(const char *str, size_t len, bool allow_imag, bool
if (str + 2 < top && (str[1] | 0x20) == 'n' && (str[2] | 0x20) == 'f') {
// inf
str += 3;
- dec_val = (mp_float_t)INFINITY;
+ dec_val = INFINITY;
if (str + 4 < top && (str[0] | 0x20) == 'i' && (str[1] | 0x20) == 'n' && (str[2] | 0x20) == 'i' && (str[3] | 0x20) == 't' && (str[4] | 0x20) == 'y') {
// infinity
str += 5;