diff options
Diffstat (limited to 'numpy/fft/fftpack_litemodule.c')
-rw-r--r-- | numpy/fft/fftpack_litemodule.c | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/numpy/fft/fftpack_litemodule.c b/numpy/fft/fftpack_litemodule.c index 95da3194f..7b37ce9b7 100644 --- a/numpy/fft/fftpack_litemodule.c +++ b/numpy/fft/fftpack_litemodule.c @@ -1,16 +1,14 @@ #define NPY_NO_DEPRECATED_API NPY_API_VERSION -#include "fftpack.h" #include "Python.h" #include "numpy/arrayobject.h" +#include "fftpack.h" static PyObject *ErrorObject; -/* ----------------------------------------------------- */ +static const char fftpack_cfftf__doc__[] = ""; -static char fftpack_cfftf__doc__[] = ""; - -PyObject * +static PyObject * fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args) { PyObject *op1, *op2; @@ -47,7 +45,7 @@ fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args) Py_BEGIN_ALLOW_THREADS; NPY_SIGINT_ON; for (i = 0; i < nrepeats; i++) { - cfftf(npts, dptr, wsave); + npy_cfftf(npts, dptr, wsave); dptr += npts*2; } NPY_SIGINT_OFF; @@ -61,9 +59,9 @@ fail: return NULL; } -static char fftpack_cfftb__doc__[] = ""; +static const char fftpack_cfftb__doc__[] = ""; -PyObject * +static PyObject * fftpack_cfftb(PyObject *NPY_UNUSED(self), PyObject *args) { PyObject *op1, *op2; @@ -100,7 +98,7 @@ fftpack_cfftb(PyObject *NPY_UNUSED(self), PyObject *args) Py_BEGIN_ALLOW_THREADS; NPY_SIGINT_ON; for (i = 0; i < nrepeats; i++) { - cfftb(npts, dptr, wsave); + npy_cfftb(npts, dptr, wsave); dptr += npts*2; } NPY_SIGINT_OFF; @@ -114,7 +112,7 @@ fail: return NULL; } -static char fftpack_cffti__doc__[] =""; +static const char fftpack_cffti__doc__[] = ""; static PyObject * fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args) @@ -126,7 +124,7 @@ fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args) if (!PyArg_ParseTuple(args, "l", &n)) { return NULL; } - /*Magic size needed by cffti*/ + /*Magic size needed by npy_cffti*/ dim = 4*n + 15; /*Create a 1 dimensional array of dimensions of type double*/ op = (PyArrayObject *)PyArray_SimpleNew(1, &dim, NPY_DOUBLE); @@ -136,16 +134,16 @@ fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args) Py_BEGIN_ALLOW_THREADS; NPY_SIGINT_ON; - cffti(n, (double *)PyArray_DATA((PyArrayObject*)op)); + npy_cffti(n, (double *)PyArray_DATA((PyArrayObject*)op)); NPY_SIGINT_OFF; Py_END_ALLOW_THREADS; return (PyObject *)op; } -static char fftpack_rfftf__doc__[] =""; +static const char fftpack_rfftf__doc__[] = ""; -PyObject * +static PyObject * fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args) { PyObject *op1, *op2; @@ -187,12 +185,11 @@ fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args) rptr = (double *)PyArray_DATA(ret); dptr = (double *)PyArray_DATA(data); - Py_BEGIN_ALLOW_THREADS; NPY_SIGINT_ON; for (i = 0; i < nrepeats; i++) { memcpy((char *)(rptr+1), dptr, npts*sizeof(double)); - rfftf(npts, rptr+1, wsave); + npy_rfftf(npts, rptr+1, wsave); rptr[0] = rptr[1]; rptr[1] = 0.0; rptr += rstep; @@ -211,10 +208,9 @@ fail: return NULL; } -static char fftpack_rfftb__doc__[] =""; +static const char fftpack_rfftb__doc__[] = ""; - -PyObject * +static PyObject * fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args) { PyObject *op1, *op2; @@ -257,7 +253,7 @@ fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args) for (i = 0; i < nrepeats; i++) { memcpy((char *)(rptr + 1), (dptr + 2), (npts - 1)*sizeof(double)); rptr[0] = dptr[0]; - rfftb(npts, rptr, wsave); + npy_rfftb(npts, rptr, wsave); rptr += npts; dptr += npts*2; } @@ -274,8 +270,7 @@ fail: return NULL; } - -static char fftpack_rffti__doc__[] =""; +static const char fftpack_rffti__doc__[] = ""; static PyObject * fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args) @@ -287,7 +282,7 @@ fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args) if (!PyArg_ParseTuple(args, "l", &n)) { return NULL; } - /*Magic size needed by rffti*/ + /*Magic size needed by npy_rffti*/ dim = 2*n + 15; /*Create a 1 dimensional array of dimensions of type double*/ op = (PyArrayObject *)PyArray_SimpleNew(1, &dim, NPY_DOUBLE); @@ -296,7 +291,7 @@ fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args) } Py_BEGIN_ALLOW_THREADS; NPY_SIGINT_ON; - rffti(n, (double *)PyArray_DATA((PyArrayObject*)op)); + npy_rffti(n, (double *)PyArray_DATA((PyArrayObject*)op)); NPY_SIGINT_OFF; Py_END_ALLOW_THREADS; @@ -316,11 +311,6 @@ static struct PyMethodDef fftpack_methods[] = { {NULL, NULL, 0, NULL} /* sentinel */ }; - -/* Initialization function for the module (*must* be called initfftpack) */ - -static char fftpack_module_documentation[] = "" ; - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, @@ -349,6 +339,8 @@ initfftpack_lite(void) #if PY_MAJOR_VERSION >= 3 m = PyModule_Create(&moduledef); #else + static const char fftpack_module_documentation[] = ""; + m = Py_InitModule4("fftpack_lite", fftpack_methods, fftpack_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); |