diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 20:14:31 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2010-12-03 20:14:31 (GMT) |
commit | 4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9 (patch) | |
tree | c8f1fef715f8d158e58f17cab14af65455de1d77 /Modules/_ctypes | |
parent | c4df7845143f9afe0d20f4421a41904f3cbb991a (diff) | |
download | cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.zip cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.gz cpython-4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9.tar.bz2 |
Merge branches/pep-0384.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 6 | ||||
-rw-r--r-- | Modules/_ctypes/cfield.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c074574..ed7c66a 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1155,7 +1155,7 @@ WCharArray_set_value(CDataObject *self, PyObject *value) result = -1; goto done; } - result = PyUnicode_AsWideChar((PyUnicodeObject *)value, + result = PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, self->b_size/sizeof(wchar_t)); if (result >= 0 && (size_t)result < self->b_size/sizeof(wchar_t)) @@ -4174,7 +4174,7 @@ Array_subscript(PyObject *_self, PyObject *item) PyObject *np; Py_ssize_t start, stop, step, slicelen, cur, i; - if (PySlice_GetIndicesEx((PySliceObject *)item, + if (PySlice_GetIndicesEx(item, self->b_length, &start, &stop, &step, &slicelen) < 0) { return NULL; @@ -4308,7 +4308,7 @@ Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value) else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelen, otherlen, i, cur; - if (PySlice_GetIndicesEx((PySliceObject *)item, + if (PySlice_GetIndicesEx(item, self->b_length, &start, &stop, &step, &slicelen) < 0) { return -1; diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index d2fa005..ccaa3c9 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1214,7 +1214,7 @@ u_set(void *ptr, PyObject *value, Py_ssize_t size) } else Py_INCREF(value); - len = PyUnicode_AsWideChar((PyUnicodeObject *)value, chars, 2); + len = PyUnicode_AsWideChar(value, chars, 2); if (len != 1) { Py_DECREF(value); PyErr_SetString(PyExc_TypeError, @@ -1292,7 +1292,7 @@ U_set(void *ptr, PyObject *value, Py_ssize_t length) } else if (size < length-1) /* copy terminating NUL character if there is space */ size += 1; - PyUnicode_AsWideChar((PyUnicodeObject *)value, (wchar_t *)ptr, size); + PyUnicode_AsWideChar(value, (wchar_t *)ptr, size); return value; } |