py: Enable struct/binary-helper to parse q and Q sized ints.

Addresses issue #848.
This commit is contained in:
Damien George
2014-09-10 22:10:33 +01:00
parent 6eae861685
commit 953074315e
8 changed files with 51 additions and 16 deletions

View File

@@ -279,7 +279,13 @@ mp_obj_t mp_obj_new_int(mp_int_t value) {
mp_obj_t mp_obj_new_int_from_ll(long long val) {
mp_obj_int_t *o = mp_obj_int_new_mpz();
mpz_set_from_ll(&o->mpz, val);
mpz_set_from_ll(&o->mpz, val, true);
return o;
}
mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
mp_obj_int_t *o = mp_obj_int_new_mpz();
mpz_set_from_ll(&o->mpz, val, false);
return o;
}