From fc245d1ca4367f9876ac32c7e08e169da7db79b9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 4 Apr 2017 16:45:49 +1000 Subject: py/objint: Consolidate mp_obj_new_int_from_float to one implementation. This reduces code duplication and allows to make mp_classify_fp_as_int static, which reduces code size. --- py/objint.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'py/objint.h') diff --git a/py/objint.h b/py/objint.h index 7205761ad2..da56c18624 100644 --- a/py/objint.h +++ b/py/objint.h @@ -41,18 +41,13 @@ typedef struct _mp_obj_int_t { extern const mp_obj_int_t mp_maxsize_obj; #if MICROPY_PY_BUILTINS_FLOAT -typedef enum { - MP_FP_CLASS_FIT_SMALLINT, - MP_FP_CLASS_FIT_LONGINT, - MP_FP_CLASS_OVERFLOW -} mp_fp_as_int_class_t; - -mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val); mp_float_t mp_obj_int_as_float_impl(mp_obj_t self_in); -#endif // MICROPY_PY_BUILTINS_FLOAT +#endif size_t mp_int_format_size(size_t num_bits, int base, const char *prefix, char comma); +mp_obj_int_t *mp_obj_int_new_mpz(void); + void mp_obj_int_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind); char *mp_obj_int_formatted(char **buf, size_t *buf_size, size_t *fmt_size, mp_const_obj_t self_in, int base, const char *prefix, char base_char, char comma); -- cgit v1.2.3