Skip to content
Snippets Groups Projects
Commit 0178aa9a authored by Damien George's avatar Damien George
Browse files

py, unix: Allow to compile with -Wdouble-promotion.

Ref issue #699.
parent b58da942
No related branches found
No related tags found
No related merge requests found
...@@ -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 ...@@ -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 '%': case '%':
flags |= PF_FLAG_ADD_PERCENT; 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; break;
#endif #endif
......
...@@ -52,7 +52,7 @@ void msec_sleep_tv(struct timeval *tv) { ...@@ -52,7 +52,7 @@ void msec_sleep_tv(struct timeval *tv) {
#endif #endif
#if defined(MP_CLOCKS_PER_SEC) #if defined(MP_CLOCKS_PER_SEC)
#define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0) #define CLOCK_DIV (MP_CLOCKS_PER_SEC / 1000.0F)
#else #else
#error Unsupported clock() implementation #error Unsupported clock() implementation
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment