Fix some Py_ssize_t issues

This commit is contained in:
Neal Norwitz 2006-06-12 02:06:42 +00:00
parent c7074386b4
commit 047f3c7ffa
3 changed files with 10 additions and 9 deletions

View file

@ -932,12 +932,13 @@ AsObj(PyObject *value)
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(value)) {
Py_UNICODE *inbuf = PyUnicode_AS_UNICODE(value);
int size = PyUnicode_GET_SIZE(value);
Py_ssize_t size = PyUnicode_GET_SIZE(value);
/* This #ifdef assumes that Tcl uses UCS-2.
See TCL_UTF_MAX test above. */
#if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3
Tcl_UniChar *outbuf;
int i;
Py_ssize_t i;
assert(size < size * sizeof(Tcl_UniChar));
outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar));
if (!outbuf) {
PyErr_NoMemory();