diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-08 18:17:23 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-08 18:17:23 +0000 |
commit | 698ec21e46564ff0c2c71bf11d7eb4ef349c88d9 (patch) | |
tree | 3d0eac21ec784f970f9f5586dfbd28c66f0774e5 /py/objint.c | |
parent | 23177088d255bec6c0bf93470aeac77194aa8258 (diff) |
Make mp_obj_str_get_data return char* instead of byte*.
Can't decide which is better for string type, char or byte pointer.
Changing to char removes a few casts. Really need to do proper unicode.
Diffstat (limited to 'py/objint.c')
-rw-r--r-- | py/objint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objint.c b/py/objint.c index 1a04408af..fdcc43807 100644 --- a/py/objint.c +++ b/py/objint.c @@ -23,8 +23,8 @@ static mp_obj_t int_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_ if (MP_OBJ_IS_STR(args[0])) { // a string, parse it uint l; - const byte *s = mp_obj_str_get_data(args[0], &l); - return MP_OBJ_NEW_SMALL_INT(strtonum((const char*)s, 0)); + const char *s = mp_obj_str_get_data(args[0], &l); + return MP_OBJ_NEW_SMALL_INT(strtonum(s, 0)); } else { return MP_OBJ_NEW_SMALL_INT(mp_obj_get_int(args[0])); } @@ -34,8 +34,8 @@ static mp_obj_t int_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_ // should be a string, parse it // TODO proper error checking of argument types uint l; - const byte *s = mp_obj_str_get_data(args[0], &l); - return MP_OBJ_NEW_SMALL_INT(strtonum((const char*)s, mp_obj_get_int(args[1]))); + 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]))); } default: |