From 00a4da93e8bb443b234b6a2cd7607d7abe2941e4 Mon Sep 17 00:00:00 2001 From: mux <freelancer.c@gmail.com> Date: Mon, 27 Jan 2014 10:21:42 +0200 Subject: [PATCH] Fix implicit double conversion warning --- py/objcomplex.c | 4 ++-- py/objfloat.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py/objcomplex.c b/py/objcomplex.c index af148a278..24762e8b1 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -24,9 +24,9 @@ mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag); void complex_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_complex_t *o = o_in; if (o->real == 0) { - print(env, "%.8gj", o->imag); + print(env, "%.8gj", (double) o->imag); } else { - print(env, "(%.8g+%.8gj)", o->real, o->imag); + print(env, "(%.8g+%.8gj)", (double) o->real, (double) o->imag); } } diff --git a/py/objfloat.c b/py/objfloat.c index 9f1f478ca..69fd65e19 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -21,7 +21,7 @@ mp_obj_t mp_obj_new_float(mp_float_t value); static void float_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_float_t *o = o_in; - print(env, "%.8g", o->value); + print(env, "%.8g", (double) o->value); } static mp_obj_t float_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { -- GitLab