@@ -106,7 +106,7 @@ typedef struct PyArrayMethod_Context_tag {
106
106
struct PyArrayMethodObject_tag * method ;
107
107
108
108
/* Operand descriptors, filled in by resolve_descriptors */
109
- PyArray_Descr * * descriptors ;
109
+ PyArray_Descr * const * descriptors ;
110
110
/* Structure may grow (this is harmless for DType authors) */
111
111
} PyArrayMethod_Context ;
112
112
@@ -159,9 +159,9 @@ typedef NPY_CASTING (PyArrayMethod_ResolveDescriptors)(
159
159
/* "method" is currently opaque (necessary e.g. to wrap Python) */
160
160
struct PyArrayMethodObject_tag * method ,
161
161
/* DTypes the method was created for */
162
- PyArray_DTypeMeta * * dtypes ,
162
+ PyArray_DTypeMeta * const * dtypes ,
163
163
/* Input descriptors (instances). Outputs may be NULL. */
164
- PyArray_Descr * * given_descrs ,
164
+ PyArray_Descr * const * given_descrs ,
165
165
/* Exact loop descriptors to use, must not hold references on error */
166
166
PyArray_Descr * * loop_descrs ,
167
167
npy_intp * view_offset );
@@ -177,9 +177,9 @@ typedef NPY_CASTING (PyArrayMethod_ResolveDescriptors)(
177
177
*/
178
178
typedef NPY_CASTING (PyArrayMethod_ResolveDescriptorsWithScalar )(
179
179
struct PyArrayMethodObject_tag * method ,
180
- PyArray_DTypeMeta * * dtypes ,
180
+ PyArray_DTypeMeta * const * dtypes ,
181
181
/* Unlike above, these can have any DType and we may allow NULL. */
182
- PyArray_Descr * * given_descrs ,
182
+ PyArray_Descr * const * given_descrs ,
183
183
/*
184
184
* Input scalars or NULL. Only ever passed for python scalars.
185
185
* WARNING: In some cases, a loop may be explicitly selected and the
@@ -227,7 +227,7 @@ typedef int (PyArrayMethod_GetLoop)(
227
227
*/
228
228
typedef int (PyArrayMethod_GetReductionInitial )(
229
229
PyArrayMethod_Context * context , npy_bool reduction_is_empty ,
230
- char * initial );
230
+ void * initial );
231
231
232
232
/*
233
233
* The following functions are only used by the wrapping array method defined
@@ -256,8 +256,8 @@ typedef int (PyArrayMethod_GetReductionInitial)(
256
256
* `resolve_descriptors`, so that it can be filled there if not NULL.)
257
257
*/
258
258
typedef int (PyArrayMethod_TranslateGivenDescriptors )(int nin , int nout ,
259
- PyArray_DTypeMeta * wrapped_dtypes [],
260
- PyArray_Descr * given_descrs [], PyArray_Descr * new_descrs []);
259
+ PyArray_DTypeMeta * const wrapped_dtypes [],
260
+ PyArray_Descr * const given_descrs [], PyArray_Descr * new_descrs []);
261
261
262
262
/**
263
263
* The function to convert the actual loop descriptors (as returned by the
@@ -278,7 +278,7 @@ typedef int (PyArrayMethod_TranslateGivenDescriptors)(int nin, int nout,
278
278
* @returns 0 on success, -1 on failure.
279
279
*/
280
280
typedef int (PyArrayMethod_TranslateLoopDescriptors )(int nin , int nout ,
281
- PyArray_DTypeMeta * new_dtypes [], PyArray_Descr * given_descrs [],
281
+ PyArray_DTypeMeta * const new_dtypes [], PyArray_Descr * const given_descrs [],
282
282
PyArray_Descr * original_descrs [], PyArray_Descr * loop_descrs []);
283
283
284
284
@@ -303,7 +303,7 @@ typedef int (PyArrayMethod_TranslateLoopDescriptors)(int nin, int nout,
303
303
*
304
304
*/
305
305
typedef int (PyArrayMethod_TraverseLoop )(
306
- void * traverse_context , PyArray_Descr * descr , char * data ,
306
+ void * traverse_context , const PyArray_Descr * descr , char * data ,
307
307
npy_intp size , npy_intp stride , NpyAuxData * auxdata );
308
308
309
309
@@ -317,7 +317,7 @@ typedef int (PyArrayMethod_TraverseLoop)(
317
317
*
318
318
*/
319
319
typedef int (PyArrayMethod_GetTraverseLoop )(
320
- void * traverse_context , PyArray_Descr * descr ,
320
+ void * traverse_context , const PyArray_Descr * descr ,
321
321
int aligned , npy_intp fixed_stride ,
322
322
PyArrayMethod_TraverseLoop * * out_loop , NpyAuxData * * out_auxdata ,
323
323
NPY_ARRAYMETHOD_FLAGS * flags );
@@ -334,7 +334,7 @@ typedef int (PyArrayMethod_GetTraverseLoop)(
334
334
* (There are potential use-cases, these are currently unsupported.)
335
335
*/
336
336
typedef int (PyArrayMethod_PromoterFunction )(PyObject * ufunc ,
337
- PyArray_DTypeMeta * op_dtypes [], PyArray_DTypeMeta * signature [],
337
+ PyArray_DTypeMeta * const op_dtypes [], PyArray_DTypeMeta * const signature [],
338
338
PyArray_DTypeMeta * new_op_dtypes []);
339
339
340
340
/*
0 commit comments