Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 41587:15b810e21fe9
Get rid of all #ifdef Py_USING_UNICODE (it is always present now).
(With the help of unifdef from freshmeat.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 03 May 2007 17:49:24 +0000 |
| parents | 06145fbc7ab9 |
| children | bab8a9c7f49e |
line wrap: on
line diff
--- a/Modules/arraymodule.c Thu May 03 17:22:56 2007 +0000 +++ b/Modules/arraymodule.c Thu May 03 17:49:24 2007 +0000 @@ -170,7 +170,6 @@ return 0; } -#ifdef Py_USING_UNICODE static PyObject * u_getitem(arrayobject *ap, Py_ssize_t i) { @@ -194,7 +193,6 @@ ((Py_UNICODE *)ap->ob_item)[i] = p[0]; return 0; } -#endif static PyObject * h_getitem(arrayobject *ap, Py_ssize_t i) @@ -394,9 +392,7 @@ {'c', sizeof(char), c_getitem, c_setitem}, {'b', sizeof(char), b_getitem, b_setitem}, {'B', sizeof(char), BB_getitem, BB_setitem}, -#ifdef Py_USING_UNICODE {'u', sizeof(Py_UNICODE), u_getitem, u_setitem}, -#endif {'h', sizeof(short), h_getitem, h_setitem}, {'H', sizeof(short), HH_getitem, HH_setitem}, {'i', sizeof(int), i_getitem, i_setitem}, @@ -1430,7 +1426,6 @@ -#ifdef Py_USING_UNICODE static PyObject * array_fromunicode(arrayobject *self, PyObject *args) { @@ -1491,7 +1486,6 @@ array.tostring().decode() to obtain a unicode string from\n\ an array of some other type."); -#endif /* Py_USING_UNICODE */ static PyObject * @@ -1536,10 +1530,8 @@ fromlist_doc}, {"fromstring", (PyCFunction)array_fromstring, METH_VARARGS, fromstring_doc}, -#ifdef Py_USING_UNICODE {"fromunicode", (PyCFunction)array_fromunicode, METH_VARARGS, fromunicode_doc}, -#endif {"index", (PyCFunction)array_index, METH_O, index_doc}, {"insert", (PyCFunction)array_insert, METH_VARARGS, @@ -1562,10 +1554,8 @@ tolist_doc}, {"tostring", (PyCFunction)array_tostring, METH_NOARGS, tostring_doc}, -#ifdef Py_USING_UNICODE {"tounicode", (PyCFunction)array_tounicode, METH_NOARGS, tounicode_doc}, -#endif {"write", (PyCFunction)array_tofile, METH_O, tofile_doc}, {NULL, NULL} /* sentinel */ @@ -1587,10 +1577,8 @@ if (typecode == 'c') v = array_tostring(a, NULL); -#ifdef Py_USING_UNICODE else if (typecode == 'u') v = array_tounicode(a, NULL); -#endif else v = array_tolist(a, NULL); t = PyObject_Repr(v); @@ -1899,7 +1887,6 @@ return NULL; } Py_DECREF(v); -#ifdef Py_USING_UNICODE } else if (initial != NULL && PyUnicode_Check(initial)) { Py_ssize_t n = PyUnicode_GET_DATA_SIZE(initial); if (n > 0) { @@ -1916,7 +1903,6 @@ memcpy(item, PyUnicode_AS_DATA(initial), n); self->allocated = self->ob_size; } -#endif } if (it != NULL) { if (array_iter_extend((arrayobject *)a, it) == -1) {
