summaryrefslogtreecommitdiff
path: root/ports/unix/modffi.c
diff options
context:
space:
mode:
authorDavid Lechner <david@lechnology.com>2020-03-20 00:10:22 -0500
committerDamien George <damien.p.george@gmail.com>2020-03-30 12:04:21 +1100
commita2110bd3fca59df8b16a2b5fe4645a4af30b06ed (patch)
tree6020938ca1fa3f9034ccef522e106c5e9255b49a /ports/unix/modffi.c
parent3a0f64fc7aafe9fa39f518aec389ef5f55b40007 (diff)
all: Fix implicit casts of float/double, and signed comparison.
These were found by buiding the unix coverage variant on macOS (so clang compiler). Mostly, these are fixing implicit cast of float/double to mp_float_t which is one of those two and one mp_int_t to size_t fix for good measure.
Diffstat (limited to 'ports/unix/modffi.c')
-rw-r--r--ports/unix/modffi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/unix/modffi.c b/ports/unix/modffi.c
index 1cc10bdd4..dbebec860 100644
--- a/ports/unix/modffi.c
+++ b/ports/unix/modffi.c
@@ -167,11 +167,11 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type) {
union { ffi_arg ffi;
float flt;
} val_union = { .ffi = val };
- return mp_obj_new_float(val_union.flt);
+ return mp_obj_new_float((mp_float_t)val_union.flt);
}
case 'd': {
double *p = (double *)&val;
- return mp_obj_new_float(*p);
+ return mp_obj_new_float((mp_float_t)*p);
}
#endif
case 'O':