[Zodb-checkins] SVN: ZODB/branches/nikhil_n-py25/src/BTrees/SetTemplate.c make C API work with Python 2.5

nikhil n nikhil.n.n at gmail.com
Mon May 14 15:38:16 EDT 2007


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

Changed:
  U   ZODB/branches/nikhil_n-py25/src/BTrees/SetTemplate.c

-=-
Modified: ZODB/branches/nikhil_n-py25/src/BTrees/SetTemplate.c
===================================================================
--- ZODB/branches/nikhil_n-py25/src/BTrees/SetTemplate.c	2007-05-14 19:37:21 UTC (rev 75751)
+++ ZODB/branches/nikhil_n-py25/src/BTrees/SetTemplate.c	2007-05-14 19:38:15 UTC (rev 75752)
@@ -108,7 +108,7 @@
   UNLESS (PyArg_ParseTuple(args, "O|O", &items, &next))
     return -1;
 
-  if ((l=PyTuple_Size(items)) < 0) return -1;
+  if ((l=(int)PyTuple_Size(items)) < 0) return -1;
 
   for (i=self->len; --i >= 0; )
     {
@@ -232,7 +232,7 @@
 
   if (!format)
       format = PyString_FromString(MOD_NAME_PREFIX "Set(%s)");
-  UNLESS (t = PyTuple_New(1)) return NULL;
+  UNLESS (t = PyTuple_New((Py_ssize_t)1)) return NULL;
   UNLESS (r = bucket_keys(self, NULL, NULL)) goto err;
   PyTuple_SET_ITEM(t, 0, r);
   r = t;
@@ -274,13 +274,13 @@
 }
 
 static PySequenceMethods set_as_sequence = {
-	(inquiry)set_length,		/* sq_length */
+	(lenfunc)set_length,		/* sq_length */
 	(binaryfunc)0,                  /* sq_concat */
-	(intargfunc)0,                  /* sq_repeat */
-	(intargfunc)set_item,           /* sq_item */
-	(intintargfunc)0,               /* sq_slice */
-	(intobjargproc)0,               /* sq_ass_item */
-	(intintobjargproc)0,            /* sq_ass_slice */
+	(ssizeargfunc)0,                  /* sq_repeat */
+	(ssizeargfunc)set_item,           /* sq_item */
+	(ssizessizeargfunc)0,               /* sq_slice */
+	(ssizeobjargproc)0,               /* sq_ass_item */
+	(ssizessizeobjargproc)0,            /* sq_ass_slice */
         (objobjproc)bucket_contains,    /* sq_contains */
         0,                              /* sq_inplace_concat */
         0,                              /* sq_inplace_repeat */
@@ -311,7 +311,7 @@
 	    Py_TPFLAGS_BASETYPE, 	/* tp_flags */
     0,					/* tp_doc */
     (traverseproc)bucket_traverse,	/* tp_traverse */
-    (inquiry)bucket_tp_clear,		/* tp_clear */
+    (lenfunc)bucket_tp_clear,		/* tp_clear */
     0,					/* tp_richcompare */
     0,					/* tp_weaklistoffset */
     (getiterfunc)Bucket_getiter,	/* tp_iter */



More information about the Zodb-checkins mailing list