summaryrefslogtreecommitdiff
path: root/py/objint.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-22 18:12:43 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-22 18:12:43 +0000
commit20773971186151b53426bd607908546598036a16 (patch)
treec74ee3ac2f07061a820355bac0bea075e0177fa8 /py/objint.c
parent2613ffde431594f3fe0562042c32105623fbe4dc (diff)
py: Put number parsing code together in parsenum.c.
Diffstat (limited to 'py/objint.c')
-rw-r--r--py/objint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objint.c b/py/objint.c
index 82bab9ea1..0caaab649 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -5,10 +5,10 @@
#include "nlr.h"
#include "misc.h"
-#include "strtonum.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
+#include "parsenum.h"
#include "objint.h"
// This dispatcher function is expected to be independent of the implementation
@@ -25,7 +25,7 @@ STATIC mp_obj_t int_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_
// a string, parse it
uint l;
const char *s = mp_obj_str_get_data(args[0], &l);
- return MP_OBJ_NEW_SMALL_INT(mp_strtonum(s, 0));
+ return mp_parse_num_integer(s, l, 0);
} else {
return MP_OBJ_NEW_SMALL_INT(mp_obj_get_int(args[0]));
}
@@ -36,7 +36,7 @@ STATIC mp_obj_t int_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_
// TODO proper error checking of argument types
uint l;
const char *s = mp_obj_str_get_data(args[0], &l);
- return MP_OBJ_NEW_SMALL_INT(mp_strtonum(s, mp_obj_get_int(args[1])));
+ return mp_parse_num_integer(s, l, mp_obj_get_int(args[1]));
}
default: