diff --git a/src/creader_module.c b/src/creader_module.c index b5445b3..ef382d5 100644 --- a/src/creader_module.c +++ b/src/creader_module.c @@ -8,17 +8,6 @@ -PyDoc_STRVAR(read_doc, "Read clusters from open file.\n\n" - "Parameters\n" - "----------\n" - "n: max number of clusters\n" - - "Returns\n" - "----------\n" - "Array of clusters read\n\n"); - - - // Create a custom numpy data type that should reflect // our cluster data type. // TODO! Update with the actual cluster data type @@ -59,7 +48,7 @@ typedef struct { // raises python exception if something goes wrong // returned object should mean file is open and ready to read static int ClusterFileReader_init(ClusterFileReader *self, PyObject *args, - PyObject *kwds) { + PyObject * Py_UNUSED(kwds)) { self->fp = NULL; // Parse file name @@ -96,7 +85,7 @@ ClusterFileReader_dealloc(ClusterFileReader *self) // read method static PyObject * ClusterFileReader_read(ClusterFileReader *self, PyObject *args, - PyObject *kwds) + PyObject * Py_UNUSED(kwds)) { const int ndim = 1; @@ -147,7 +136,7 @@ ClusterFileReader_read(ClusterFileReader *self, PyObject *args, // read method static PyObject * ClusterFileReader_clusterize(ClusterFileReader *self, PyObject *args, - PyObject *kwds) + PyObject * Py_UNUSED(kwds)) { @@ -229,7 +218,7 @@ static PyMethodDef ClusterFileReader_methods[] = { {"clusterize", (PyCFunction) ClusterFileReader_clusterize, METH_VARARGS, "Analyze clusters" }, - {NULL} /* Sentinel */ + {NULL, NULL, 0, NULL} /* Sentinel */ }; @@ -252,15 +241,18 @@ static PyTypeObject ClusterFileReaderType = { static char module_docstring[] = "C functions to read cluster files"; -/* // This is the module itself */ -/* static PyMethodDef module_methods[] = { */ -/* {"read", (PyCFunction)read, METH_VARARGS, add_doc}, {"decode", (PyCFunction)decode, METH_VARARGS, decode_doc}, */ -/* {NULL, NULL, 0, NULL}}; */ +static struct PyModuleDef creader_def = { + PyModuleDef_HEAD_INIT, "creader", + module_docstring, + -1, + ClusterFileReader_methods, + NULL, //m_slots + NULL, //m_traverse + NULL, //m_clear + NULL //m_free +}; -static struct PyModuleDef creader_def = {PyModuleDef_HEAD_INIT, "creader", - module_docstring, -1, ClusterFileReader_methods}; - PyMODINIT_FUNC PyInit_creader(void) { PyObject *m; if (PyType_Ready(&ClusterFileReaderType) < 0)