Skip to content

Commit 550f7d7

Browse files
committed
MAINT: Add a few more const to function parameters (safe)
1 parent 87f1fcb commit 550f7d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/source/reference/c-api/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,7 @@ Data Type Promotion and Inspection
33873387
----------------------------------
33883388
33893389
.. c:function:: PyArray_DTypeMeta *PyArray_CommonDType( \
3390-
PyArray_DTypeMeta *dtype1, PyArray_DTypeMeta *dtype2)
3390+
const PyArray_DTypeMeta *dtype1, const PyArray_DTypeMeta *dtype2)
33913391
33923392
This function defines the common DType operator. Note that the common DType
33933393
will not be ``object`` (unless one of the DTypes is ``object``). Similar to
@@ -3414,7 +3414,7 @@ Data Type Promotion and Inspection
34143414
For example promoting ``float16`` with any other float, integer, or unsigned
34153415
integer again gives a floating point number.
34163416
3417-
.. c:function:: PyArray_Descr *PyArray_GetDefaultDescr(PyArray_DTypeMeta *DType)
3417+
.. c:function:: PyArray_Descr *PyArray_GetDefaultDescr(const PyArray_DTypeMeta *DType)
34183418
34193419
Given a DType class, returns the default instance (descriptor). This checks
34203420
for a ``singleton`` first and only calls the ``default_descr`` function if

numpy/_core/src/multiarray/stringdtype/static_string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ NpyString_free_allocator(npy_string_allocator *allocator)
286286
* allocator mutex is held, as doing so may cause deadlocks.
287287
*/
288288
NPY_NO_EXPORT npy_string_allocator *
289-
NpyString_acquire_allocator(PyArray_StringDTypeObject *descr)
289+
NpyString_acquire_allocator(const PyArray_StringDTypeObject *descr)
290290
{
291291
if (!PyThread_acquire_lock(descr->allocator->allocator_lock, NOWAIT_LOCK)) {
292292
PyThread_acquire_lock(descr->allocator->allocator_lock, WAIT_LOCK);

0 commit comments

Comments
 (0)