diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
commit | 18e165558b24d29e7e0ca501842b9236589b012a (patch) | |
tree | 841678b5dc1aff3aa48701fee33a6ba7be00a72b /Python/modsupport.c | |
parent | 44829297348d9121a03fc7df2fac557b583cc7fa (diff) | |
download | cpython-18e165558b24d29e7e0ca501842b9236589b012a.zip cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2 |
Merge ssize_t branch.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r-- | Python/modsupport.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c index 7241936..f92fc34 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -313,6 +313,11 @@ do_mkvalue(const char **p_format, va_list *p_va) return PyInt_FromLong(n); } + case 'n': +#if SIZEOF_SIZE_T!=SIZEOF_LONG + return PyLong_FromSsize_t(va_arg(*p_va, Py_Ssize_t)); +#endif + /* Fall through from 'n' to 'l' if Py_ssize_t is long */ case 'l': return PyInt_FromLong(va_arg(*p_va, long)); @@ -371,7 +376,7 @@ do_mkvalue(const char **p_format, va_list *p_va) case 'c': { char p[1]; - p[0] = va_arg(*p_va, int); + p[0] = (char)va_arg(*p_va, int); return PyString_FromStringAndSize(p, 1); } |