diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-12 21:56:35 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-12 21:56:35 +0000 |
commit | 0178aa9a113dc224820fd638dc353dfe5ea6bee2 (patch) | |
tree | ab292120a2eefb020304c62baf7d8854bddb165d /py/objstr.c | |
parent | b58da9420cdd0cca1e79be32f24088345cf66946 (diff) | |
download | micropython-0178aa9a113dc224820fd638dc353dfe5ea6bee2.tar.gz micropython-0178aa9a113dc224820fd638dc353dfe5ea6bee2.zip |
py, unix: Allow to compile with -Wdouble-promotion.
Ref issue #699.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c index 01ed3a2d3b..879d1853d9 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1206,7 +1206,13 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa case '%': flags |= PF_FLAG_ADD_PERCENT; - pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * 100.0F, 'f', flags, fill, width, precision); + #if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT + #define F100 100.0F + #else + #define F100 100.0 + #endif + pfenv_print_float(&pfenv_vstr, mp_obj_get_float(arg) * F100, 'f', flags, fill, width, precision); + #undef F100 break; #endif |