diff options
| author | mattip <matti.picus@gmail.com> | 2018-04-30 09:53:41 +0300 |
|---|---|---|
| committer | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2018-07-17 17:04:59 -0400 |
| commit | 84f6df82f2fbb7e5ce0cd82976b671a180ed3b84 (patch) | |
| tree | 3f56f00118fbac45310888325b8c8469caaa7cee /numpy | |
| parent | 75006e943e9346b8fd0cdc0ba55f9a0893f91309 (diff) | |
| download | numpy-84f6df82f2fbb7e5ce0cd82976b671a180ed3b84.tar.gz | |
ENH: convert reserved field to version, set new version to 1
So that we can keep track of expansions of the PyUFuncObject.
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/include/numpy/ufuncobject.h | 6 | ||||
| -rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h index a191e5766..7fe5e9f82 100644 --- a/numpy/core/include/numpy/ufuncobject.h +++ b/numpy/core/include/numpy/ufuncobject.h @@ -130,8 +130,8 @@ typedef struct _tagPyUFuncObject { /* The number of elements in 'functions' and 'data' */ int ntypes; - /* Used to be unused field 'check_return' */ - int reserved1; + /* Used to be unused field 'check_return', repurposed in 1.16 */ + int version; /* The name of the ufunc */ const char *name; @@ -210,6 +210,8 @@ typedef struct _tagPyUFuncObject { */ npy_uint32 iter_flags; + /* New in version 1 and above */ + /* * sizes of frozen core dimensions, or -1 if unset */ diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 47a4d876b..e7031557e 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -4654,7 +4654,7 @@ PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data, } PyObject_Init((PyObject *)ufunc, &PyUFunc_Type); - ufunc->reserved1 = 0; + ufunc->version = 1; /* NumPy 1.16 and up */ ufunc->reserved2 = NULL; ufunc->nin = nin; |
