GMPY 1.0a doesn't work on my 64-bit Athlon (running
Debian Linux): it segfaults, or returns improper results.
There are several places where Py_BuildValue is called
with an "i" (C int) or "l" (C long) argument, but the
passed variable is of the other type, which caused (at
best) improper results, and at worst, dumping core.
This patch fixes those, along with several other
int/long mixups, and a few code cleanups for 64-bitness.
Also, I've updated the unittests to use much larger
numbers when testing for conversion to an integer. The
previous results expected the results to be a Python
long (with the L suffix), but they were small enough
that they would fit into a Python int (w/o the L) on a
machine with sizeof(int)=8.
With this patch, the tests pass for Python 2.1, 2.2,
2.3, and 2.4 on my 64-bit Linux box, and on 2.3 and 2.4
in a 32-bit chroot on the same machine, and on a
framework-build of 2.4 under OS X on my iBook.
Log in to post a comment.