summaryrefslogtreecommitdiff
path: root/py/objint_longlong.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-18 14:15:48 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-18 14:15:48 +0000
commit632cf5710ca49cdcc4593672650ca53092dd435c (patch)
tree3e0e9a286e0f6eadda8b3f9de91642c1c4e2d2d9 /py/objint_longlong.c
parent20006dbba9d2d84ead036fdfab7190e88b2337ce (diff)
parentd26b379eec155ddd7a4aa64057c3d0507eee79f5 (diff)
Merge branch 'master' of github.com:dpgeorge/micropython
Diffstat (limited to 'py/objint_longlong.c')
-rw-r--r--py/objint_longlong.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/py/objint_longlong.c b/py/objint_longlong.c
index c940ce1ac..24d693761 100644
--- a/py/objint_longlong.c
+++ b/py/objint_longlong.c
@@ -120,9 +120,17 @@ mp_obj_t mp_obj_new_int_from_long_str(const char *s) {
return o;
}
-machine_int_t mp_obj_int_get_int(mp_obj_t self_in) {
+machine_int_t mp_obj_int_get(mp_obj_t self_in) {
+ if (MP_OBJ_IS_SMALL_INT(self_in)) {
+ return MP_OBJ_SMALL_INT_VALUE(self_in);
+ }
mp_obj_int_t *self = self_in;
return self->val;
}
+machine_int_t mp_obj_int_get_checked(mp_obj_t self_in) {
+ // TODO: Check overflow
+ return mp_obj_int_get(self_in);
+}
+
#endif