Commits

Anonymous committed f48afaa

updated stmodule and sinemodule to use newer numpy capi

  • Participants
  • Parent commits 108ff99

Comments (0)

Files changed (2)

stockwell/sinemodule.c

 static PyObject *sine_taper_wrap(PyObject *self, PyObject *args)
 {
 	int k, N;
-	int dim[1];
+	npy_intp dim[1];
 	PyArrayObject *r;
 
 	if (!PyArg_ParseTuple(args, "ii", &k, &N)) {
 	}
 
 	dim[0] = N;
-	r = (PyArrayObject *)PyArray_FromDims(1, dim, PyArray_DOUBLE);
+	r = (PyArrayObject *)PyArray_SimpleNew(1, dim, PyArray_DOUBLE);
 	if (r == NULL) {
 		return NULL;
 	}

stockwell/stmodule.c

 
 static PyObject *st_wrap(PyObject *self, PyObject *args)
 {
-	int n, dim[2];
+  int n;
+  npy_intp dim[2];
 	int lo = 0;
 	int hi = 0;
 	PyObject *o;
 
 	dim[0] = hi - lo + 1;
 	dim[1] = n;
-	r = (PyArrayObject *)PyArray_FromDims(2, dim, PyArray_CDOUBLE);
+	r = (PyArrayObject *)PyArray_SimpleNew(2, dim, PyArray_CDOUBLE);
 	if (r == NULL) {
 		Py_DECREF(a);
 		return NULL;
 
 static PyObject *ist_wrap(PyObject *self, PyObject *args)
 {
-	int n, m, dim[1];
+  int n, m;
+  npy_intp dim[1];
 	int lo = 0;
 	int hi = 0;
 	PyObject *o;
 	}
 
 	dim[0] = m;
-	r = (PyArrayObject *)PyArray_FromDims(1, dim, PyArray_DOUBLE);
+	r = (PyArrayObject *)PyArray_SimpleNew(1, dim, PyArray_DOUBLE);
 	if (r == NULL) {
 		Py_DECREF(a);
 		return NULL;
 
 static PyObject *hilbert_wrap(PyObject *self, PyObject *args)
 {
-	int n, dim[1];
+  int n;
+  npy_intp  dim[1];
 	PyObject *o;
 	PyArrayObject *a, *r;
 
 	n = a->dimensions[0];
 
 	dim[0] = n;
-	r = (PyArrayObject *)PyArray_FromDims(1, dim, PyArray_CDOUBLE);
+	r = (PyArrayObject *)PyArray_SimpleNew(1, dim, PyArray_CDOUBLE);
 	if (r == NULL) {
 		Py_DECREF(a);
 		return NULL;
 	{ NULL, NULL, 0, NULL }
 };
 
-void initst()
+void initst(void)
 {
 	Py_InitModule("st", Methods);
 	import_array();