[Python-checkins] r43146 - python/trunk/Objects/abstract.c

neal.norwitz python-checkins at python.org
Mon Mar 20 02:55:26 CET 2006


Author: neal.norwitz
Date: Mon Mar 20 02:55:26 2006
New Revision: 43146
Modified:
 python/trunk/Objects/abstract.c
Log:
Update function name to reflect params and stop casting to long to avoid losing data
Modified: python/trunk/Objects/abstract.c
==============================================================================
--- python/trunk/Objects/abstract.c	(original)
+++ python/trunk/Objects/abstract.c	Mon Mar 20 02:55:26 2006
@@ -1248,13 +1248,13 @@
 }
 
 static PyObject *
-sliceobj_from_intint(Py_ssize_t i, Py_ssize_t j)
+sliceobj_from_ssizet_ssizet(Py_ssize_t i, Py_ssize_t j)
 {
 	PyObject *start, *end, *slice;
-	start = PyInt_FromLong((long)i);
+	start = PyInt_FromSsize_t(i);
 	if (!start)
 		return NULL;
-	end = PyInt_FromLong((long)j);
+	end = PyInt_FromSsize_t(j);
 	if (!end) {
 		Py_DECREF(start);
 		return NULL;
@@ -1289,7 +1289,7 @@
 		return m->sq_slice(s, i1, i2);
 	} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_subscript) {
 		PyObject *res;
-		PyObject *slice = sliceobj_from_intint(i1, i2);
+		PyObject *slice = sliceobj_from_ssizet_ssizet(i1, i2);
 		if (!slice)
 			return NULL;
 		res = mp->mp_subscript(s, slice);
@@ -1381,7 +1381,7 @@
 		return m->sq_ass_slice(s, i1, i2, o);
 	} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_ass_subscript) {
 		int res;
-		PyObject *slice = sliceobj_from_intint(i1, i2);
+		PyObject *slice = sliceobj_from_ssizet_ssizet(i1, i2);
 		if (!slice)
 			return -1;
 		res = mp->mp_ass_subscript(s, slice, o);


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /