[Python-checkins] commit of r41766 - in python/branches/ssize_t: Modules/_elementtree.c Modules/arraymodule.c Modules/collectionsmodule.c Modules/datetimemodule.c Modules/mmapmodule.c Modules/stropmodule.c Objects/listobject.c Python/ceval.c

neal.norwitz python-checkins at python.org
Mon Dec 19 01:09:07 CET 2005


Author: neal.norwitz
Date: Mon Dec 19 01:08:57 2005
New Revision: 41766

Modified:
   python/branches/ssize_t/Modules/_elementtree.c
   python/branches/ssize_t/Modules/arraymodule.c
   python/branches/ssize_t/Modules/collectionsmodule.c
   python/branches/ssize_t/Modules/datetimemodule.c
   python/branches/ssize_t/Modules/mmapmodule.c
   python/branches/ssize_t/Modules/stropmodule.c
   python/branches/ssize_t/Objects/listobject.c
   python/branches/ssize_t/Python/ceval.c
Log:
Get rid of compiler warnings on AMD64

Modified: python/branches/ssize_t/Modules/_elementtree.c
==============================================================================
--- python/branches/ssize_t/Modules/_elementtree.c	(original)
+++ python/branches/ssize_t/Modules/_elementtree.c	Mon Dec 19 01:08:57 2005
@@ -1228,7 +1228,7 @@
 }
 
 static int
-element_setitem(ElementObject* self, int index, PyObject* item)
+element_setitem(ElementObject* self, size_t index, PyObject* item)
 {
     int i;
     PyObject* old;
@@ -1371,10 +1371,10 @@
     (inquiry) element_length,
     0, /* sq_concat */
     0, /* sq_repeat */
-    (intargfunc) element_getitem,
-    (intintargfunc) element_getslice,
-    (intobjargproc) element_setitem,
-    (intintobjargproc) element_setslice,
+    (ssizeargfunc) element_getitem,
+    (ssizessizeargfunc) element_getslice,
+    (sizeobjargproc) element_setitem,
+    (ssizessizeobjargproc) element_setslice,
 };
 
 statichere PyTypeObject Element_Type = {

Modified: python/branches/ssize_t/Modules/arraymodule.c
==============================================================================
--- python/branches/ssize_t/Modules/arraymodule.c	(original)
+++ python/branches/ssize_t/Modules/arraymodule.c	Mon Dec 19 01:08:57 2005
@@ -1706,7 +1706,7 @@
 
 			if (av->ob_size != slicelength) {
 				PyErr_Format(PyExc_ValueError,
-            "attempt to assign array of size %d to extended slice of size %d",
+            "attempt to assign array of size %ld to extended slice of size %ld",
 					     av->ob_size, slicelength);
 				return -1;
 			}

Modified: python/branches/ssize_t/Modules/collectionsmodule.c
==============================================================================
--- python/branches/ssize_t/Modules/collectionsmodule.c	(original)
+++ python/branches/ssize_t/Modules/collectionsmodule.c	Mon Dec 19 01:08:57 2005
@@ -779,9 +779,9 @@
 	(inquiry)deque_len,		/* sq_length */
 	0,				/* sq_concat */
 	0,				/* sq_repeat */
-	(intargfunc)deque_item,		/* sq_item */
+	(ssizeargfunc)deque_item,	/* sq_item */
 	0,				/* sq_slice */
-	(intobjargproc)deque_ass_item,	/* sq_ass_item */
+	(sizeobjargproc)deque_ass_item,	/* sq_ass_item */
 };
 
 /* deque object ********************************************************/

Modified: python/branches/ssize_t/Modules/datetimemodule.c
==============================================================================
--- python/branches/ssize_t/Modules/datetimemodule.c	(original)
+++ python/branches/ssize_t/Modules/datetimemodule.c	Mon Dec 19 01:08:57 2005
@@ -596,7 +596,7 @@
  */
 
 static PyObject *
-time_alloc(PyTypeObject *type, int aware)
+time_alloc(PyTypeObject *type, Py_ssize_t aware)
 {
 	PyObject *self;
 
@@ -611,7 +611,7 @@
 }
 
 static PyObject *
-datetime_alloc(PyTypeObject *type, int aware)
+datetime_alloc(PyTypeObject *type, Py_ssize_t aware)
 {
 	PyObject *self;
 

Modified: python/branches/ssize_t/Modules/mmapmodule.c
==============================================================================
--- python/branches/ssize_t/Modules/mmapmodule.c	(original)
+++ python/branches/ssize_t/Modules/mmapmodule.c	Mon Dec 19 01:08:57 2005
@@ -756,11 +756,11 @@
 static PySequenceMethods mmap_as_sequence = {
 	(inquiry)mmap_length,		       /*sq_length*/
 	(binaryfunc)mmap_concat,	       /*sq_concat*/
-	(intargfunc)mmap_repeat,	       /*sq_repeat*/
-	(intargfunc)mmap_item,		       /*sq_item*/
-	(intintargfunc)mmap_slice,	       /*sq_slice*/
-	(intobjargproc)mmap_ass_item,	       /*sq_ass_item*/
-	(intintobjargproc)mmap_ass_slice,      /*sq_ass_slice*/
+	(ssizeargfunc)mmap_repeat,	       /*sq_repeat*/
+	(ssizeargfunc)mmap_item,	       /*sq_item*/
+	(ssizessizeargfunc)mmap_slice,	       /*sq_slice*/
+	(sizeobjargproc)mmap_ass_item,	       /*sq_ass_item*/
+	(ssizessizeobjargproc)mmap_ass_slice,  /*sq_ass_slice*/
 };
 
 static PyBufferProcs mmap_as_buffer = {

Modified: python/branches/ssize_t/Modules/stropmodule.c
==============================================================================
--- python/branches/ssize_t/Modules/stropmodule.c	(original)
+++ python/branches/ssize_t/Modules/stropmodule.c	Mon Dec 19 01:08:57 2005
@@ -170,7 +170,7 @@
 	int i, reslen = 0, slen = 0, sz = 100;
 	PyObject *res = NULL;
 	char* p = NULL;
-	intargfunc getitemfunc;
+	ssizeargfunc getitemfunc;
 
 	WARN;
 	if (!PyArg_ParseTuple(args, "O|t#:join", &seq, &sep, &seplen))

Modified: python/branches/ssize_t/Objects/listobject.c
==============================================================================
--- python/branches/ssize_t/Objects/listobject.c	(original)
+++ python/branches/ssize_t/Objects/listobject.c	Mon Dec 19 01:08:57 2005
@@ -2442,7 +2442,7 @@
 	(ssizessizeobjargproc)list_ass_slice,	/* sq_ass_slice */
 	(objobjproc)list_contains,		/* sq_contains */
 	(binaryfunc)list_inplace_concat,	/* sq_inplace_concat */
-	(intargfunc)list_inplace_repeat,	/* sq_inplace_repeat */
+	(ssizeargfunc)list_inplace_repeat,	/* sq_inplace_repeat */
 };
 
 PyDoc_STRVAR(list_doc,
@@ -2603,7 +2603,7 @@
 			if (PySequence_Fast_GET_SIZE(seq) != slicelength) {
 				/* XXX can we use %zd here? */
 				PyErr_Format(PyExc_ValueError,
-            "attempt to assign sequence of size %d to extended slice of size %d",
+            "attempt to assign sequence of size %d to extended slice of size %ld",
 					     (int)PySequence_Fast_GET_SIZE(seq),
 					     slicelength);
 				Py_DECREF(seq);

Modified: python/branches/ssize_t/Python/ceval.c
==============================================================================
--- python/branches/ssize_t/Python/ceval.c	(original)
+++ python/branches/ssize_t/Python/ceval.c	Mon Dec 19 01:08:57 2005
@@ -3927,7 +3927,7 @@
 	PySequenceMethods *sq = tp->tp_as_sequence;
 
 	if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
-		int ilow = 0, ihigh = INT_MAX;
+		Py_ssize_t ilow = 0, ihigh = INT_MAX;
 		if (!_PyEval_SliceIndex(v, &ilow))
 			return NULL;
 		if (!_PyEval_SliceIndex(w, &ihigh))
@@ -3954,7 +3954,7 @@
 	PySequenceMethods *sq = tp->tp_as_sequence;
 
 	if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
-		int ilow = 0, ihigh = INT_MAX;
+		Py_ssize_t ilow = 0, ihigh = INT_MAX;
 		if (!_PyEval_SliceIndex(v, &ilow))
 			return -1;
 		if (!_PyEval_SliceIndex(w, &ihigh))


More information about the Python-checkins mailing list