[Checkins] SVN: ZODB/branches/nikhil_n-py25/src/persistent/cPersistence.c make C API work with Python 2.5

nikhil n nikhil.n.n at gmail.com
Mon May 14 15:41:20 EDT 2007


Log message for revision 75756:
  make C API work with Python 2.5

Changed:
  U   ZODB/branches/nikhil_n-py25/src/persistent/cPersistence.c

-=-
Modified: ZODB/branches/nikhil_n-py25/src/persistent/cPersistence.c
===================================================================
--- ZODB/branches/nikhil_n-py25/src/persistent/cPersistence.c	2007-05-14 19:40:58 UTC (rev 75755)
+++ ZODB/branches/nikhil_n-py25/src/persistent/cPersistence.c	2007-05-14 19:41:19 UTC (rev 75756)
@@ -206,7 +206,7 @@
 	meth = PyObject_GetAttr((PyObject *)self->jar, s_register);
 	if (meth == NULL)
 	    return -1;
-	arg = PyTuple_New(1);
+	arg = PyTuple_New((Py_ssize_t)1);
 	if (arg == NULL) {
 	    Py_DECREF(meth);
 	    return -1;
@@ -309,7 +309,7 @@
     if (!state)
 	return copy;
 
-    while (PyDict_Next(state, &pos, &key, &value)) {
+    while ((int)PyDict_Next(state, &pos, &key, &value)) {
 	if (key && PyString_Check(key)) {
 	    ckey = PyString_AS_STRING(key);
 	    if (*ckey == '_' &&
@@ -421,7 +421,7 @@
 	return -1;
     }
 
-    while (PyDict_Next(dict, &pos, &key, &value)) {
+    while ((int)PyDict_Next(dict, &pos, &key, &value)) {
 	if (PyObject_SetAttr(self, key, value) < 0)
 	    return -1;
     }
@@ -493,7 +493,7 @@
 pickle___reduce__(PyObject *self)
 {
     PyObject *args=NULL, *bargs=NULL, *state=NULL, *getnewargs=NULL;
-    int l, i;
+    Py_ssize_t l, i;
 
     getnewargs = PyObject_GetAttr(self, py___getnewargs__);
     if (getnewargs) {
@@ -510,7 +510,7 @@
 	l = 0;
     }
 
-    args = PyTuple_New(l+1);
+    args = PyTuple_New((Py_ssize_t)(l+1));
     if (args == NULL)
 	goto end;
 
@@ -963,7 +963,7 @@
 static PyObject *
 Per_get_serial(cPersistentObject *self)
 {
-    return PyString_FromStringAndSize(self->serial, 8);
+    return PyString_FromStringAndSize(self->serial, (Py_ssize_t)8);
 }
 
 static int



More information about the Checkins mailing list