diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2012-04-21 00:06:19 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-04-21 10:29:10 -0600 |
commit | 1dba433756be0139d0b9ec591678c456fd54bdc2 (patch) | |
tree | aedb67914eafa9208364fcba1769fdf89190d6f5 | |
parent | 32775060950bd0eac622642a3dafb4d758f7e627 (diff) | |
download | numpy-1dba433756be0139d0b9ec591678c456fd54bdc2.tar.gz |
STY: Remove unused functions.
MyPyUnicode_Resize and MyPyUnicode_New are no longer used, so remove them.
-rw-r--r-- | numpy/core/src/multiarray/ucsnarrow.c | 40 | ||||
-rw-r--r-- | numpy/core/src/multiarray/ucsnarrow.h | 6 |
2 files changed, 0 insertions, 46 deletions
diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c index eea57c05e..55eb6c37c 100644 --- a/numpy/core/src/multiarray/ucsnarrow.c +++ b/numpy/core/src/multiarray/ucsnarrow.c @@ -170,43 +170,3 @@ fail: } return NULL; } - -NPY_NO_EXPORT PyObject * -MyPyUnicode_New(int length) -{ - PyUnicodeObject *unicode; - unicode = PyObject_New(PyUnicodeObject, &PyUnicode_Type); - if (unicode == NULL) return NULL; - unicode->str = PyMem_NEW(Py_UNICODE, length+1); - if (!unicode->str) { - _Py_ForgetReference((PyObject *)unicode); - PyObject_Del(unicode); - return PyErr_NoMemory(); - } - unicode->str[0] = 0; - unicode->str[length] = 0; - unicode->length = length; - unicode->hash = -1; - unicode->defenc = NULL; -#if defined(NPY_PY3K) - unicode->state = 0; /* Not interned */ -#endif - return (PyObject *)unicode; -} - -NPY_NO_EXPORT int -MyPyUnicode_Resize(PyUnicodeObject *uni, int length) -{ - void *oldstr; - - oldstr = uni->str; - PyMem_RESIZE(uni->str, Py_UNICODE, length+1); - if (!uni->str) { - uni->str = oldstr; - PyErr_NoMemory(); - return -1; - } - uni->str[length] = 0; - uni->length = length; - return 0; -} diff --git a/numpy/core/src/multiarray/ucsnarrow.h b/numpy/core/src/multiarray/ucsnarrow.h index b750d7cb4..fe31a5e25 100644 --- a/numpy/core/src/multiarray/ucsnarrow.h +++ b/numpy/core/src/multiarray/ucsnarrow.h @@ -7,12 +7,6 @@ PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, npy_ucs4 *ucs4, int ucs4length); NPY_NO_EXPORT int PyUCS2Buffer_AsUCS4(Py_UNICODE *ucs2, npy_ucs4 *ucs4, int ucs2len, int ucs4len); -NPY_NO_EXPORT PyObject * -MyPyUnicode_New(int length); - -NPY_NO_EXPORT int -MyPyUnicode_Resize(PyUnicodeObject *uni, int length); - NPY_NO_EXPORT PyUnicodeObject * PyUnicode_FromUCS4(char *src, Py_ssize_t size, int swap, int align); |