Index: src/persistent/cPickleCache.c =================================================================== --- src/persistent/cPickleCache.c (revision 80887) +++ src/persistent/cPickleCache.c (working copy) @@ -378,7 +378,7 @@ cc_invalidate(ccobject *self, PyObject *inv) { PyObject *key, *v; - int i = 0; + Py_ssize_t i = 0; if (PyDict_Check(inv)) { @@ -448,7 +448,7 @@ cc_klass_items(ccobject *self) { PyObject *l,*k,*v; - int p = 0; + Py_ssize_t p = 0; l = PyList_New(0); if (l == NULL) @@ -477,7 +477,7 @@ cc_debug_info(ccobject *self) { PyObject *l,*k,*v; - int p = 0; + Py_ssize_t p = 0; l = PyList_New(0); if (l == NULL) @@ -707,7 +707,7 @@ static int cc_clear(ccobject *self) { - int pos = 0; + Py_ssize_t pos = 0; PyObject *k, *v; /* Clearing the cache is delicate. Index: src/persistent/cPersistence.c =================================================================== --- src/persistent/cPersistence.c (revision 80887) +++ src/persistent/cPersistence.c (working copy) @@ -300,7 +300,7 @@ { PyObject *copy, *key, *value; char *ckey; - int pos = 0; + Py_ssize_t pos = 0; copy = PyDict_New(); if (!copy) @@ -414,7 +414,7 @@ pickle_setattrs_from_dict(PyObject *self, PyObject *dict) { PyObject *key, *value; - int pos = 0; + Py_ssize_t pos = 0; if (!PyDict_Check(dict)) { PyErr_SetString(PyExc_TypeError, "Expected dictionary"); Index: src/persistent/cPersistence.h =================================================================== --- src/persistent/cPersistence.h (revision 80887) +++ src/persistent/cPersistence.h (working copy) @@ -16,6 +16,14 @@ #define CPERSISTENCE_H #include "Python.h" + +/* Make use of Py_ssize_t possibble with python versions < 2.5. Gerald Klix(2007-16-10) */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif + #include "ring.h" #define CACHE_HEAD \