From d103ac1d6325a075be3fafe812858584435f3144 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 12 May 2019 00:10:53 -0400 Subject: Handle truth values; speed up smallint checks --- py/objint.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'py/objint.h') diff --git a/py/objint.h b/py/objint.h index 654404ac9..e8c9bc3e0 100644 --- a/py/objint.h +++ b/py/objint.h @@ -53,7 +53,12 @@ char *mp_obj_int_formatted(char **buf, size_t *buf_size, size_t *fmt_size, mp_co int base, const char *prefix, char base_char, char comma); char *mp_obj_int_formatted_impl(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); +#if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE void mp_obj_int_buffer_overflow_check(mp_obj_t self_in, size_t nbytes, bool is_signed); +#endif + +void mp_small_int_buffer_overflow_check(mp_int_t val, size_t nbytes, bool is_signed); + mp_int_t mp_obj_int_hash(mp_obj_t self_in); mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf); void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t len, byte *buf); -- cgit v1.2.3