diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-22 14:35:10 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-22 14:35:10 +0000 |
commit | 5fa93b67557f21c22a41449c3266571c427f6798 (patch) | |
tree | 3e009ed9369b7aba8cf5212509a784ecd86e06a3 /py/objint_longlong.c | |
parent | 8ae1c1beacc56d440b2cc1e4bd010b100ad4fdd0 (diff) |
Second stage of qstr revamp: uPy str object can be qstr or not.
Diffstat (limited to 'py/objint_longlong.c')
-rw-r--r-- | py/objint_longlong.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/py/objint_longlong.c b/py/objint_longlong.c index fd13a038b..7eaee3bc9 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -24,8 +24,12 @@ static mp_obj_t mp_obj_new_int_from_ll(long long val); #endif void int_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { - mp_obj_int_t *self = self_in; - print(env, "%lld" SUFFIX, self->val); + if (MP_OBJ_IS_SMALL_INT(self_in)) { + print(env, "%d", (int)MP_OBJ_SMALL_INT_VALUE(self_in)); + } else { + mp_obj_int_t *self = self_in; + print(env, "%lld" SUFFIX, self->val); + } } mp_obj_t int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { |