diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 01:28:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 01:28:17 (GMT) |
commit | f7b8cb605d38342399de52cb865889e8a4daf81f (patch) | |
tree | dfd1258d100ba6c0a9773854ceae0ed92de8bf65 /Modules/_io | |
parent | 0058b8603f65279d5e777b0c85b05565c5e98682 (diff) | |
download | cpython-f7b8cb605d38342399de52cb865889e8a4daf81f.zip cpython-f7b8cb605d38342399de52cb865889e8a4daf81f.tar.gz cpython-f7b8cb605d38342399de52cb865889e8a4daf81f.tar.bz2 |
_io.textio: fix character type, use Py_UCS4 instead of Py_UNICODE
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/textio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 9c06ec8..880a5f0 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -347,7 +347,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self, memchr(in_str, '\n', PyUnicode_KIND_SIZE(kind, len)) != NULL) { Py_ssize_t i = 0; for (;;) { - Py_UNICODE c; + Py_UCS4 c; /* Fast loop for non-control characters */ while (PyUnicode_READ(kind, in_str, i) > '\n') i++; @@ -1570,7 +1570,7 @@ textiowrapper_read(textio *self, PyObject *args) } -/* NOTE: `end` must point to the real end of the Py_UNICODE storage, +/* NOTE: `end` must point to the real end of the Py_UCS4 storage, that is to the NUL character. Otherwise the function will produce incorrect results. */ static char * @@ -1614,7 +1614,7 @@ _PyIO_find_line_ending( for (;;) { Py_UCS4 ch; /* Fast path for non-control chars. The loop always ends - since the Py_UNICODE storage is NUL-terminated. */ + since the Unicode string is NUL-terminated. */ while (PyUnicode_READ(kind, s, 0) > '\r') s += size; if (s >= end) { |