diff options
author | Brian Curtin <brian.curtin@gmail.com> | 2010-08-17 20:49:09 (GMT) |
---|---|---|
committer | Brian Curtin <brian.curtin@gmail.com> | 2010-08-17 20:49:09 (GMT) |
commit | 852823d731a6370c078016f3825044eec74fbb4f (patch) | |
tree | 13c18a2a2481dedae9cc035ebf21a30dda5ffc98 /PC/_subprocess.c | |
parent | abb3351785f0e526a8f5170a5ad08ae9d4638a0a (diff) | |
download | cpython-852823d731a6370c078016f3825044eec74fbb4f.zip cpython-852823d731a6370c078016f3825044eec74fbb4f.tar.gz cpython-852823d731a6370c078016f3825044eec74fbb4f.tar.bz2 |
Cleanup and correct a few ints to be Py_ssize_t.
Diffstat (limited to 'PC/_subprocess.c')
-rw-r--r-- | PC/_subprocess.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/PC/_subprocess.c b/PC/_subprocess.c index 5132a5e..2338f30 100644 --- a/PC/_subprocess.c +++ b/PC/_subprocess.c @@ -329,7 +329,8 @@ gethandle(PyObject* obj, char* name) static PyObject* getenvironment(PyObject* environment) { - int i, envsize; + int i; + Py_ssize_t envsize; PyObject* out = NULL; PyObject* keys; PyObject* values; @@ -356,7 +357,7 @@ getenvironment(PyObject* environment) p = PyUnicode_AS_UNICODE(out); for (i = 0; i < envsize; i++) { - int ksize, vsize, totalsize; + Py_ssize_t ksize, vsize, totalsize; PyObject* key = PyList_GET_ITEM(keys, i); PyObject* value = PyList_GET_ITEM(values, i); @@ -370,7 +371,7 @@ getenvironment(PyObject* environment) totalsize = (p - PyUnicode_AS_UNICODE(out)) + ksize + 1 + vsize + 1 + 1; if (totalsize > PyUnicode_GET_SIZE(out)) { - int offset = p - PyUnicode_AS_UNICODE(out); + Py_ssize_t offset = p - PyUnicode_AS_UNICODE(out); PyUnicode_Resize(&out, totalsize + 1024); p = PyUnicode_AS_UNICODE(out) + offset; } |