Richard Fish <rfish@users.sourceforge.net>:

Fix the .binary() method of mpz objects for 64-bit systems.

[Also removed a lot of trailing whitespace elsewhere in the file. --FLD]

This closes SF patch #103547.
This commit is contained in:
Fred Drake 2001-02-12 16:48:13 +00:00
parent 26d813e42c
commit c17b3cfec1
1 changed files with 39 additions and 33 deletions

View File

@ -1477,6 +1477,12 @@ mpz_binary(mpzobject *self, PyObject *args)
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
if (sizeof(ldigit) == 8 && BITS_PER_MP_LIMB == 64) {
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
*cp++ = (unsigned char)((ldigit >>= 8) & 0xFF);
}
}
while (strobjp->ob_size && !*--cp)