fixed module related warnings
This commit is contained in:
parent
74263a7d7a
commit
44f9a58cf1
@ -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
|
||||
@ -46,7 +35,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
|
||||
@ -83,7 +72,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;
|
||||
@ -132,7 +121,7 @@ static PyMethodDef ClusterFileReader_methods[] = {
|
||||
{"read", (PyCFunction) ClusterFileReader_read, METH_VARARGS,
|
||||
"Read clusters"
|
||||
},
|
||||
{NULL} /* Sentinel */
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
||||
@ -155,12 +144,21 @@ static PyTypeObject ClusterFileReaderType = {
|
||||
static char module_docstring[] =
|
||||
"C functions to read cluster files";
|
||||
|
||||
// This is the module itself
|
||||
// Methods in the module itself
|
||||
static PyMethodDef module_methods[] = {
|
||||
{NULL, NULL, 0, NULL}};
|
||||
|
||||
static struct PyModuleDef creader_def = {PyModuleDef_HEAD_INIT, "creader",
|
||||
module_docstring, -1, module_methods};
|
||||
static struct PyModuleDef creader_def = {
|
||||
PyModuleDef_HEAD_INIT, "creader",
|
||||
module_docstring,
|
||||
-1,
|
||||
module_methods,
|
||||
NULL, //m_slots
|
||||
NULL, //m_traverse
|
||||
NULL, //m_clear
|
||||
NULL //m_free
|
||||
};
|
||||
|
||||
|
||||
PyMODINIT_FUNC PyInit_creader(void) {
|
||||
PyObject *m;
|
||||
|
Reference in New Issue
Block a user