]> granicus.if.org Git - python/commitdiff
Fix two problems that emerged when the testsuite was run with an x64 build: PyLong_F...
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Mon, 7 May 2007 18:30:48 +0000 (18:30 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Mon, 7 May 2007 18:30:48 +0000 (18:30 +0000)
Modules/itertoolsmodule.c
Objects/longobject.c

index 70f787f784b2b6660bab88e5d79bb51027a4fbe7..31f20c710c732431edd1c034aa93463558b9799d 100644 (file)
@@ -2073,9 +2073,9 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 static PyObject *
 count_next(countobject *lz)
 {
-        if (lz->cnt == LONG_MAX) {
+        if (lz->cnt == PY_SSIZE_T_MAX) {
                 PyErr_SetString(PyExc_OverflowError,
-                        "cannot count beyond LONG_MAX");                
+                        "cannot count beyond PY_SSIZE_T_MAX");                
                 return NULL;         
         }
        return PyInt_FromSsize_t(lz->cnt++);
index 7bf04d294154ad13315c95304db1b7139559230c..e51517f3c8935e0152314bbab63aadfe37bd044d 100644 (file)
@@ -893,7 +893,7 @@ _PyLong_FromSsize_t(Py_ssize_t ival)
        int one = 1;
        return _PyLong_FromByteArray(
                        (unsigned char *)&bytes,
-                       SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 0);
+                       SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 1);
 }
 
 /* Create a new long int object from a C size_t. */