diff options
author | David Cournapeau <cournape@gmail.com> | 2008-10-08 13:35:27 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-10-08 13:35:27 +0000 |
commit | a62ee5a3683a995d49a1b93d205fe936cc6de6d1 (patch) | |
tree | 55833be488ff0afb4659365586a8e6dddde35509 /numpy | |
parent | 0f3fbf1eab50c35199908a0532de82c0b4917024 (diff) | |
download | numpy-a62ee5a3683a995d49a1b93d205fe936cc6de6d1.tar.gz |
Fix missing initializers warnings.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/arraymethods.c | 2 | ||||
-rw-r--r-- | numpy/core/src/arrayobject.c | 211 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 2 | ||||
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 2 | ||||
-rw-r--r-- | numpy/core/src/scalartypes.inc.src | 374 | ||||
-rw-r--r-- | numpy/core/src/ufuncobject.c | 53 | ||||
-rw-r--r-- | numpy/core/src/umathmodule.c.src | 2 |
7 files changed, 537 insertions, 109 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 7615fcfb9..7cf409173 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -2021,7 +2021,7 @@ static PyMethodDef array_methods[] = { METH_VARARGS | METH_KEYWORDS, NULL}, {"view", (PyCFunction)array_view, METH_VARARGS | METH_KEYWORDS, NULL}, - {NULL, NULL} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; #undef _ARET diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 3cc30ba2b..32d49eaf2 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -6880,69 +6880,69 @@ array_finalize_get(PyArrayObject *NPY_UNUSED(self)) static PyGetSetDef array_getsetlist[] = { {"ndim", (getter)array_ndim_get, - NULL, NULL}, + NULL, NULL, NULL}, {"flags", (getter)array_flags_get, - NULL, NULL}, + NULL, NULL, NULL}, {"shape", (getter)array_shape_get, (setter)array_shape_set, - NULL}, + NULL, NULL}, {"strides", (getter)array_strides_get, (setter)array_strides_set, - NULL}, + NULL, NULL}, {"data", (getter)array_data_get, (setter)array_data_set, - NULL}, + NULL, NULL}, {"itemsize", (getter)array_itemsize_get, - NULL, NULL}, + NULL, NULL, NULL}, {"size", (getter)array_size_get, - NULL, NULL}, + NULL, NULL, NULL}, {"nbytes", (getter)array_nbytes_get, - NULL, NULL}, + NULL, NULL, NULL}, {"base", (getter)array_base_get, - NULL, NULL}, + NULL, NULL, NULL}, {"dtype", (getter)array_descr_get, (setter)array_descr_set, - NULL}, + NULL, NULL}, {"real", (getter)array_real_get, (setter)array_real_set, - NULL}, + NULL, NULL}, {"imag", (getter)array_imag_get, (setter)array_imag_set, - NULL}, + NULL, NULL}, {"flat", (getter)array_flat_get, (setter)array_flat_set, - NULL}, + NULL, NULL}, {"ctypes", (getter)array_ctypes_get, - NULL, NULL}, + NULL, NULL, NULL}, {"T", (getter)array_transpose_get, - NULL, NULL}, + NULL, NULL, NULL}, {"__array_interface__", (getter)array_interface_get, - NULL, NULL}, + NULL, NULL, NULL}, {"__array_struct__", (getter)array_struct_get, - NULL, NULL}, + NULL, NULL, NULL}, {"__array_priority__", (getter)array_priority_get, - NULL, NULL}, + NULL, NULL, NULL}, {"__array_finalize__", (getter)array_finalize_get, - NULL, NULL}, - {NULL, NULL, NULL, NULL}, /* Sentinel */ + NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL}, /* Sentinel */ }; /****************** end of attribute get and set routines *******************/ @@ -7017,7 +7017,17 @@ static PyTypeObject PyArray_Type = { 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; /* The rest of this code is to build the right kind of array from a python */ @@ -10019,7 +10029,7 @@ static PyMethodDef iter_methods[] = { /* to get array */ {"__array__", (PyCFunction)iter_array, 1, NULL}, {"copy", (PyCFunction)iter_copy, 1, NULL}, - {NULL, NULL} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; static PyObject * @@ -10038,7 +10048,7 @@ iter_richcompare(PyArrayIterObject *self, PyObject *other, int cmp_op) static PyMemberDef iter_members[] = { {"base", T_OBJECT, offsetof(PyArrayIterObject, ao), RO, NULL}, {"index", T_INT, offsetof(PyArrayIterObject, index), RO, NULL}, - {NULL}, + {NULL, 0, 0, 0, NULL}, }; static PyObject * @@ -10062,9 +10072,8 @@ iter_coords_get(PyArrayIterObject *self) static PyGetSetDef iter_getsets[] = { {"coords", (getter)iter_coords_get, - NULL, - NULL}, - {NULL, NULL, NULL, NULL}, + NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL}, }; static PyTypeObject PyArrayIter_Type = { @@ -10100,6 +10109,30 @@ static PyTypeObject PyArrayIter_Type = { iter_methods, /* tp_methods */ iter_members, /* tp_members */ iter_getsets, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; @@ -10783,7 +10816,17 @@ static PyTypeObject PyArrayMapIter_Type = { 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; @@ -11046,24 +11089,24 @@ arraymultiter_iters_get(PyArrayMultiIterObject *self) static PyGetSetDef arraymultiter_getsetlist[] = { {"size", (getter)arraymultiter_size_get, - NULL, NULL}, + NULL, NULL, NULL}, {"index", (getter)arraymultiter_index_get, - NULL, NULL}, + NULL, NULL, NULL}, {"shape", (getter)arraymultiter_shape_get, - NULL, NULL}, + NULL, NULL, NULL}, {"iters", (getter)arraymultiter_iters_get, - NULL, NULL}, - {NULL, NULL, NULL, NULL}, + NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL}, }; static PyMemberDef arraymultiter_members[] = { {"numiter", T_INT, offsetof(PyArrayMultiIterObject, numiter), RO, NULL}, {"nd", T_INT, offsetof(PyArrayMultiIterObject, nd), RO, NULL}, - {NULL}, + {NULL, 0, 0, 0, NULL}, }; static PyObject * @@ -11078,7 +11121,7 @@ arraymultiter_reset(PyArrayMultiIterObject *self, PyObject *args) static PyMethodDef arraymultiter_methods[] = { {"reset", (PyCFunction) arraymultiter_reset, METH_VARARGS, NULL}, - {NULL, NULL}, + {NULL, NULL, 0, NULL}, }; static PyTypeObject PyArrayMultiIter_Type = { @@ -11128,7 +11171,17 @@ static PyTypeObject PyArrayMultiIter_Type = { 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; /*NUMPY_API*/ @@ -11226,7 +11279,7 @@ static PyMemberDef arraydescr_members[] = { {"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL}, {"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL}, {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL}, - {NULL}, + {NULL, 0, 0, 0, NULL}, }; static PyObject * @@ -11490,39 +11543,39 @@ arraydescr_names_set(PyArray_Descr *self, PyObject *val) static PyGetSetDef arraydescr_getsets[] = { {"subdtype", (getter)arraydescr_subdescr_get, - NULL, NULL}, + NULL, NULL, NULL}, {"descr", (getter)arraydescr_protocol_descr_get, - NULL, NULL}, + NULL, NULL, NULL}, {"str", (getter)arraydescr_protocol_typestr_get, - NULL, NULL}, + NULL, NULL, NULL}, {"name", (getter)arraydescr_typename_get, - NULL, NULL}, + NULL, NULL, NULL}, {"base", (getter)arraydescr_base_get, - NULL, NULL}, + NULL, NULL, NULL}, {"shape", (getter)arraydescr_shape_get, - NULL, NULL}, + NULL, NULL, NULL}, {"isbuiltin", (getter)arraydescr_isbuiltin_get, - NULL, NULL}, + NULL, NULL, NULL}, {"isnative", (getter)arraydescr_isnative_get, - NULL, NULL}, + NULL, NULL, NULL}, {"fields", (getter)arraydescr_fields_get, - NULL, NULL}, + NULL, NULL, NULL}, {"names", (getter)arraydescr_names_get, (setter)arraydescr_names_set, - NULL}, + NULL, NULL}, {"hasobject", (getter)arraydescr_hasobject_get, - NULL, NULL}, - {NULL, NULL, NULL, NULL}, + NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL}, }; static PyObject * @@ -11896,7 +11949,7 @@ static PyMethodDef arraydescr_methods[] = { NULL}, {"newbyteorder", (PyCFunction)arraydescr_newbyteorder, METH_VARARGS, NULL}, - {NULL, NULL} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; static PyObject * @@ -12130,6 +12183,12 @@ static PySequenceMethods descr_as_sequence = { descr_length, (binaryfunc)NULL, descr_repeat, + NULL, NULL, + NULL, /* sq_ass_item */ + NULL, /* ssizessizeobjargproc sq_ass_slice */ + 0, /* sq_contains */ + 0, /* sq_inplace_concat */ + 0, /* sq_inplace_repeat */ }; static PyMappingMethods descr_as_mapping = { @@ -12188,7 +12247,17 @@ static PyTypeObject PyArrayDescr_Type = { 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; @@ -12350,60 +12419,60 @@ static PyGetSetDef arrayflags_getsets[] = { {"contiguous", (getter)arrayflags_contiguous_get, NULL, - ""}, + "", NULL}, {"c_contiguous", (getter)arrayflags_contiguous_get, NULL, - ""}, + "", NULL}, {"f_contiguous", (getter)arrayflags_fortran_get, NULL, - ""}, + "", NULL}, {"fortran", (getter)arrayflags_fortran_get, NULL, - ""}, + "", NULL}, {"updateifcopy", (getter)arrayflags_updateifcopy_get, (setter)arrayflags_updateifcopy_set, - ""}, + "", NULL}, {"owndata", (getter)arrayflags_owndata_get, NULL, - ""}, + "", NULL}, {"aligned", (getter)arrayflags_aligned_get, (setter)arrayflags_aligned_set, - ""}, + "", NULL}, {"writeable", (getter)arrayflags_writeable_get, (setter)arrayflags_writeable_set, - ""}, + "", NULL}, {"fnc", (getter)arrayflags_fnc_get, NULL, - ""}, + "", NULL}, {"forc", (getter)arrayflags_forc_get, NULL, - ""}, + "", NULL}, {"behaved", (getter)arrayflags_behaved_get, NULL, - ""}, + "", NULL}, {"carray", (getter)arrayflags_carray_get, NULL, - ""}, + "", NULL}, {"farray", (getter)arrayflags_farray_get, NULL, - ""}, + "", NULL}, {"num", (getter)arrayflags_num_get, NULL, - ""}, - {NULL, NULL, NULL, NULL}, + "", NULL}, + {NULL, NULL, NULL, NULL, NULL}, }; static PyObject * @@ -12618,5 +12687,15 @@ static PyTypeObject PyArrayFlags_Type = { 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 214cd6ccd..4f25ef374 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -7531,7 +7531,7 @@ static struct PyMethodDef array_module_methods[] = { METH_VARARGS | METH_KEYWORDS, NULL}, {"test_interrupt", (PyCFunction)test_interrupt, METH_VARARGS, NULL}, - {NULL, NULL, 0} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; #include "__multiarray_api.c" diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index 913e73dce..dd86678a3 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -1268,7 +1268,7 @@ static struct PyMethodDef methods[] = { METH_VARARGS, doc_usepythonmath}, {"use_scalarmath", (PyCFunction) use_scalarmath, METH_VARARGS, doc_usescalarmath}, - {NULL, NULL, 0} + {NULL, NULL, 0, NULL} }; PyMODINIT_FUNC initscalarmath(void) { diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src index b215a438b..5ca83e59b 100644 --- a/numpy/core/src/scalartypes.inc.src +++ b/numpy/core/src/scalartypes.inc.src @@ -24,6 +24,59 @@ static PyTypeObject Py@NAME@ArrType_Type = { 0, /*ob_size*/ "numpy.@name@", /*tp_name*/ sizeof(PyObject), /*tp_basicsize*/ + 0, /* tp_itemsize */ + /* methods */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; /**end repeat**/ @@ -1019,72 +1072,89 @@ static PyGetSetDef gentype_getsets[] = { {"ndim", (getter)gentype_ndim_get, (setter) 0, - "number of array dimensions"}, + "number of array dimensions", + NULL}, {"flags", (getter)gentype_flags_get, (setter)0, - "integer value of flags"}, + "integer value of flags", + NULL}, {"shape", (getter)gentype_shape_get, (setter)0, - "tuple of array dimensions"}, + "tuple of array dimensions", + NULL}, {"strides", (getter)gentype_shape_get, (setter) 0, - "tuple of bytes steps in each dimension"}, + "tuple of bytes steps in each dimension", + NULL}, {"data", (getter)gentype_data_get, (setter) 0, - "pointer to start of data"}, + "pointer to start of data", + NULL}, {"itemsize", (getter)gentype_itemsize_get, (setter)0, - "length of one element in bytes"}, + "length of one element in bytes", + NULL}, {"size", (getter)gentype_size_get, (setter)0, - "number of elements in the gentype"}, + "number of elements in the gentype", + NULL}, {"nbytes", (getter)gentype_itemsize_get, (setter)0, - "length of item in bytes"}, + "length of item in bytes", + NULL}, {"base", (getter)gentype_base_get, (setter)0, - "base object"}, + "base object", + NULL}, {"dtype", (getter)gentype_typedescr_get, NULL, - "get array data-descriptor"}, + "get array data-descriptor", + NULL}, {"real", (getter)gentype_real_get, (setter)0, - "real part of scalar"}, + "real part of scalar", + NULL}, {"imag", (getter)gentype_imag_get, (setter)0, - "imaginary part of scalar"}, + "imaginary part of scalar", + NULL}, {"flat", (getter)gentype_flat_get, (setter)0, - "a 1-d view of scalar"}, + "a 1-d view of scalar", + NULL}, {"T", (getter)gentype_transpose_get, (setter)0, - "transpose"}, + "transpose", + NULL}, {"__array_interface__", (getter)gentype_interface_get, NULL, - "Array protocol: Python side"}, + "Array protocol: Python side", + NULL}, {"__array_struct__", (getter)gentype_struct_get, NULL, - "Array protocol: struct"}, + "Array protocol: struct", + NULL}, {"__array_priority__", (getter)gentype_priority_get, NULL, - "Array priority."}, - {NULL, NULL, NULL, NULL} /* Sentinel */ + "Array priority.", + NULL}, + {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; @@ -1574,7 +1644,7 @@ static PyMethodDef gentype_methods[] = { {"newbyteorder", (PyCFunction)gentype_newbyteorder, METH_VARARGS, NULL}, - {NULL, NULL} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; @@ -1582,12 +1652,14 @@ static PyGetSetDef voidtype_getsets[] = { {"flags", (getter)voidtype_flags_get, (setter)0, - "integer value of flags"}, + "integer value of flags", + NULL}, {"dtype", (getter)voidtype_dtypedescr_get, (setter)0, - "dtype object"}, - {NULL, NULL} + "dtype object", + NULL}, + {NULL, NULL, NULL, NULL, NULL} }; static PyMethodDef voidtype_methods[] = { @@ -1597,7 +1669,7 @@ static PyMethodDef voidtype_methods[] = { {"setfield", (PyCFunction)voidtype_setfield, METH_VARARGS | METH_KEYWORDS, NULL}, - {NULL, NULL} + {NULL, NULL, 0, NULL} }; /************* As_mapping functions for void array scalar ************/ @@ -1757,15 +1829,19 @@ static PySequenceMethods voidtype_as_sequence = { 0, /*sq_repeat*/ (ssizeargfunc)voidtype_item, /*sq_item*/ 0, /*sq_slice*/ - (ssizeobjargproc)voidtype_ass_item /*sq_ass_item*/ + (ssizeobjargproc)voidtype_ass_item, /*sq_ass_item*/ #else (inquiry)voidtype_length, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ (intargfunc)voidtype_item, /*sq_item*/ 0, /*sq_slice*/ - (intobjargproc)voidtype_ass_item /*sq_ass_item*/ + (intobjargproc)voidtype_ass_item, /*sq_ass_item*/ #endif + 0, /* ssq_ass_slice */ + 0, /* sq_contains */ + 0, /* sq_inplace_concat */ + 0, /* sq_inplace_repeat */ }; @@ -1844,6 +1920,59 @@ static PyTypeObject PyGenericArrType_Type = { 0, /*ob_size*/ "numpy.generic", /*tp_name*/ sizeof(PyObject), /*tp_basicsize*/ + 0, /* tp_itemsize */ + /* methods */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; static void @@ -2097,6 +2226,32 @@ static PyNumberMethods bool_arrtype_as_number = { (binaryfunc)bool_arrtype_and, /* nb_and */ (binaryfunc)bool_arrtype_xor, /* nb_xor */ (binaryfunc)bool_arrtype_or, /* nb_or */ + 0, /* nb_coerce */ + 0, /* nb_int */ + 0, /* nb_long */ + 0, /* nb_float */ + 0, /* nb_oct */ + 0, /* nb_hex */ + /* Added in release 2.0 */ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply */ + 0, /* nb_inplace_divide */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + /* Added in release 2.2 */ + /* The following require the Py_TPFLAGS_HAVE_CLASS flag */ + 0, /* nb_floor_divide */ + 0, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ + /* Added in release 2.5 */ + 0, /* nb_index */ }; static PyObject * @@ -2494,6 +2649,40 @@ static PyTypeObject PyObjectArrType_Type = { (setattrofunc)object_arrtype_setattro, /* tp_setattro */ &object_arrtype_as_buffer, /* tp_as_buffer */ 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; @@ -2554,6 +2743,57 @@ static PyTypeObject Py@NAME@ArrType_Type = { 0, /*ob_size*/ "numpy.@name@@ex@", /*tp_name*/ sizeof(Py@NAME@ScalarObject), /*tp_basicsize*/ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; /**end repeat**/ @@ -2584,6 +2824,57 @@ static PyTypeObject Py@NAME@ArrType_Type = { 0, /*ob_size*/ "numpy.@name@" _THIS_SIZE, /*tp_name*/ sizeof(Py@NAME@ScalarObject), /*tp_basicsize*/ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; #undef _THIS_SIZE @@ -2647,6 +2938,39 @@ static PyTypeObject Py@NAME@ArrType_Type = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ "Composed of two " _THIS_SIZE2 " bit floats", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; #undef _THIS_SIZE1 #undef _THIS_SIZE2 diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index d646dd6b9..eb48a3946 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -4034,13 +4034,13 @@ ufunc_reduceat(PyUFuncObject *self, PyObject *args, PyObject *kwds) static struct PyMethodDef ufunc_methods[] = { - {"reduce", (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS }, + {"reduce", (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS, NULL }, {"accumulate", (PyCFunction)ufunc_accumulate, - METH_VARARGS | METH_KEYWORDS }, + METH_VARARGS | METH_KEYWORDS, NULL }, {"reduceat", (PyCFunction)ufunc_reduceat, - METH_VARARGS | METH_KEYWORDS }, - {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS }, - {NULL, NULL} /* sentinel */ + METH_VARARGS | METH_KEYWORDS, NULL }, + {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS, NULL}, + {NULL, NULL, 0, NULL} /* sentinel */ }; @@ -4193,15 +4193,15 @@ ufunc_get_identity(PyUFuncObject *self) /* static char *Ufunctype__doc__ = NULL; */ static PyGetSetDef ufunc_getset[] = { - {"__doc__", (getter)ufunc_get_doc, NULL, "documentation string"}, - {"nin", (getter)ufunc_get_nin, NULL, "number of inputs"}, - {"nout", (getter)ufunc_get_nout, NULL, "number of outputs"}, - {"nargs", (getter)ufunc_get_nargs, NULL, "number of arguments"}, - {"ntypes", (getter)ufunc_get_ntypes, NULL, "number of types"}, - {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output"}, - {"__name__", (getter)ufunc_get_name, NULL, "function name"}, - {"identity", (getter)ufunc_get_identity, NULL, "identity value"}, - {NULL, NULL, NULL, NULL}, /* Sentinel */ + {"__doc__", (getter)ufunc_get_doc, NULL, "documentation string", NULL}, + {"nin", (getter)ufunc_get_nin, NULL, "number of inputs", NULL}, + {"nout", (getter)ufunc_get_nout, NULL, "number of outputs", NULL}, + {"nargs", (getter)ufunc_get_nargs, NULL, "number of arguments", NULL}, + {"ntypes", (getter)ufunc_get_ntypes, NULL, "number of types", NULL}, + {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output", NULL}, + {"__name__", (getter)ufunc_get_name, NULL, "function name", NULL}, + {"identity", (getter)ufunc_get_identity, NULL, "identity value", NULL}, + {NULL, NULL, NULL, NULL, NULL}, /* Sentinel */ }; static PyTypeObject PyUFunc_Type = { @@ -4237,6 +4237,31 @@ static PyTypeObject PyUFunc_Type = { ufunc_methods, /* tp_methods */ 0, /* tp_members */ ufunc_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + +#ifdef COUNT_ALLOCS + /* these must be last and never explicitly initialized */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* *tp_next */ +#endif }; /* End of code for ufunc objects */ diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src index c7dfa24ef..881268490 100644 --- a/numpy/core/src/umathmodule.c.src +++ b/numpy/core/src/umathmodule.c.src @@ -1586,7 +1586,7 @@ static struct PyMethodDef methods[] = { METH_VARARGS, NULL}, {"geterrobj", (PyCFunction) ufunc_geterr, METH_VARARGS, NULL}, - {NULL, NULL, 0} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; PyMODINIT_FUNC initumath(void) { |