[Python-checkins] r42021 - in python/branches/ssize_t: Include/intobject.h Objects/intobject.c

martin.v.loewis python-checkins at python.org
Thu Jan 12 18:01:45 CET 2006


Author: martin.v.loewis
Date: Thu Jan 12 18:01:44 2006
New Revision: 42021

Modified:
   python/branches/ssize_t/Include/intobject.h
   python/branches/ssize_t/Objects/intobject.c
Log:


Modified: python/branches/ssize_t/Include/intobject.h
==============================================================================
--- python/branches/ssize_t/Include/intobject.h	(original)
+++ python/branches/ssize_t/Include/intobject.h	Thu Jan 12 18:01:44 2006
@@ -32,7 +32,7 @@
 
 PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
 #ifdef Py_USING_UNICODE
-PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int);
+PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
 #endif
 PyAPI_FUNC(PyObject *) PyInt_FromLong(long);
 PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t);

Modified: python/branches/ssize_t/Objects/intobject.c
==============================================================================
--- python/branches/ssize_t/Objects/intobject.c	(original)
+++ python/branches/ssize_t/Objects/intobject.c	Thu Jan 12 18:01:44 2006
@@ -188,14 +188,14 @@
 Py_ssize_t
 PyInt_AsSsize_t(register PyObject *op)
 {
+	PyNumberMethods *nb;
+	PyIntObject *io;
+	Py_ssize_t val;
 	if (op && !PyInt_CheckExact(op) && PyLong_Check(op))
 		return _PyLong_AsSsize_t(op);
 #if SIZEOF_SIZE_T==SIZEOF_LONG
 	return PyInt_AsLong(op);
 #else
-	PyNumberMethods *nb;
-	PyIntObject *io;
-	Py_ssize_t val;
 
 	if (op && PyInt_Check(op))
 		return PyInt_AS_LONG((PyIntObject*) op);
@@ -216,7 +216,7 @@
 	if (!PyInt_Check(io)) {
 		if (PyLong_Check(io)) {
 			/* got a long? => retry int conversion */
-			val = PyLong_AsSsize_t((PyObject *)io);
+			val = _PyLong_AsSsize_t((PyObject *)io);
 			Py_DECREF(io);
 			if ((val == -1) && PyErr_Occurred())
 				return -1;
@@ -371,7 +371,7 @@
 
 #ifdef Py_USING_UNICODE
 PyObject *
-PyInt_FromUnicode(Py_UNICODE *s, int length, int base)
+PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
 {
 	PyObject *result;
 	char *buffer = PyMem_MALLOC(length+1);


More information about the Python-checkins mailing list