#2 Support for 64-bit machines

closed-accepted
nobody
None
5
2006-02-26
2004-12-09
No

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.

Discussion

  • David M. Cooke

    David M. Cooke - 2004-12-09

    Patch to 1.0a to fix 64-bit problems

     
  • Alex Martelli

    Alex Martelli - 2006-02-26

    Logged In: YES
    user_id=60314

    Accepted and inserted in 1.02 -- thanks!

     
  • Alex Martelli

    Alex Martelli - 2006-02-26
    • status: open --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks