summaryrefslogtreecommitdiffstatshomepage
path: root/py/objint.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-22 17:49:15 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-22 17:49:15 +0000
commit2613ffde431594f3fe0562042c32105623fbe4dc (patch)
tree7b12ffbe18867132e665b66a44f6f72bfcc72e6f /py/objint.c
parent0379b55ab036921eaee96f07385d2329d8de97fd (diff)
downloadmicropython-2613ffde431594f3fe0562042c32105623fbe4dc.tar.gz
micropython-2613ffde431594f3fe0562042c32105623fbe4dc.zip
py: Rename strtonum to mp_strtonum.
strtonum clashes with BSD function of same name, and our version is different so warrants a unique name. Addresses Issue #305.
Diffstat (limited to 'py/objint.c')
-rw-r--r--py/objint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/objint.c b/py/objint.c
index 775e5644d0..82bab9ea18 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -5,6 +5,7 @@
#include "nlr.h"
#include "misc.h"
+#include "strtonum.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
@@ -24,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(strtonum(s, 0));
+ return MP_OBJ_NEW_SMALL_INT(mp_strtonum(s, 0));
} else {
return MP_OBJ_NEW_SMALL_INT(mp_obj_get_int(args[0]));
}
@@ -35,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(strtonum(s, mp_obj_get_int(args[1])));
+ return MP_OBJ_NEW_SMALL_INT(mp_strtonum(s, mp_obj_get_int(args[1])));
}
default: