diff Python/bltinmodule.c @ 36501:7fdc639bc5b4 legacy-trunk

Merge ssize_t branch.
author Martin v. Löwis <martin@v.loewis.de>
date Wed, 15 Feb 2006 17:27:45 +0000
parents 20f75d5e79e9
children 30aef3ce2b26
line wrap: on
line diff
--- a/Python/bltinmodule.c	Wed Feb 15 06:55:57 2006 +0000
+++ b/Python/bltinmodule.c	Wed Feb 15 17:27:45 2006 +0000
@@ -405,7 +405,7 @@
 	int supplied_flags = 0;
 	PyCompilerFlags cf;
 	PyObject *result = NULL, *cmd, *tmp = NULL;
-	int length;
+	Py_ssize_t length;
 
 	if (!PyArg_ParseTuple(args, "Oss|ii:compile", &cmd, &filename,
 			      &startstr, &supplied_flags, &dont_inherit))
@@ -824,7 +824,7 @@
 
 	PyObject *func, *result;
 	sequence *seqs = NULL, *sqp;
-	int n, len;
+	Py_ssize_t n, len;
 	register int i, j;
 
 	n = PyTuple_Size(args);
@@ -1163,12 +1163,12 @@
 static PyObject *
 builtin_len(PyObject *self, PyObject *v)
 {
-	long res;
+	Py_ssize_t res;
 
 	res = PyObject_Size(v);
 	if (res < 0 && PyErr_Occurred())
 		return NULL;
-	return PyInt_FromLong(res);
+	return PyInt_FromSsize_t(res);
 }
 
 PyDoc_STRVAR(len_doc,
@@ -2346,8 +2346,8 @@
 filtertuple(PyObject *func, PyObject *tuple)
 {
 	PyObject *result;
-	register int i, j;
-	int len = PyTuple_Size(tuple);
+	Py_ssize_t i, j;
+	Py_ssize_t len = PyTuple_Size(tuple);
 
 	if (len == 0) {
 		if (PyTuple_CheckExact(tuple))
@@ -2417,9 +2417,9 @@
 filterstring(PyObject *func, PyObject *strobj)
 {
 	PyObject *result;
-	register int i, j;
-	int len = PyString_Size(strobj);
-	int outlen = len;
+	Py_ssize_t i, j;
+	Py_ssize_t len = PyString_Size(strobj);
+	Py_ssize_t outlen = len;
 
 	if (func == Py_None) {
 		/* If it's a real string we can return the original,