diff options
author | Damien George <damien.p.george@gmail.com> | 2016-03-14 22:34:03 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-03-14 22:34:03 +0000 |
commit | dddb98db8b7544db0248843ad2450a7177adac4a (patch) | |
tree | 50c3b5e017dffb41cd10edd223e9503a43db0fd3 /py/parsenum.h | |
parent | 99fc0d120a139a1525384663552b568fab6215e2 (diff) |
py/parsenum: Use size_t to count bytes, and int for type of base arg.
size_t is the proper type to count number of bytes in a string. The base
argument does not need to be a full mp_uint_t, int is enough.
Diffstat (limited to 'py/parsenum.h')
-rw-r--r-- | py/parsenum.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/py/parsenum.h b/py/parsenum.h index 26aac49bc..f140cfc85 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -30,10 +30,8 @@ #include "py/lexer.h" #include "py/obj.h" -mp_uint_t mp_parse_num_base(const char *str, mp_uint_t len, mp_uint_t *base); - // these functions raise a SyntaxError if lex!=NULL, else a ValueError -mp_obj_t mp_parse_num_integer(const char *restrict str, mp_uint_t len, mp_uint_t base, mp_lexer_t *lex); -mp_obj_t mp_parse_num_decimal(const char *str, mp_uint_t len, bool allow_imag, bool force_complex, mp_lexer_t *lex); +mp_obj_t mp_parse_num_integer(const char *restrict str, size_t len, int base, mp_lexer_t *lex); +mp_obj_t mp_parse_num_decimal(const char *str, size_t len, bool allow_imag, bool force_complex, mp_lexer_t *lex); #endif // __MICROPY_INCLUDED_PY_PARSENUM_H__ |