git: 7e5a28401279 - main - graphics/py-pygeos: Fix build with Clang 16 and remove the workaround

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 09 Jul 2023 10:36:22 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e5a28401279485c1ef8eddd533c96eb3cb3ffc7

commit 7e5a28401279485c1ef8eddd533c96eb3cb3ffc7
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-07-09 10:19:37 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-07-09 10:19:37 +0000

    graphics/py-pygeos: Fix build with Clang 16 and remove the workaround
    
    src/ufuncs.c:166:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Y_b_funcs[1] = {&Y_b_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:198:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction O_b_funcs[1] = {&O_b_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:239:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YY_b_funcs[1] = {&YY_b_func};
                                                   ^~~~~~~~~~
    src/ufuncs.c:320:50: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YY_b_p_funcs[1] = {&YY_b_p_func};
                                                     ^~~~~~~~~~~~
    src/ufuncs.c:341:55: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction is_prepared_funcs[1] = {&is_prepared_func};
                                                          ^~~~~~~~~~~~~~~~~
    src/ufuncs.c:458:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Y_Y_funcs[1] = {&Y_Y_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:507:45: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Y_funcs[1] = {&Y_func};
                                                ^~~~~~~
    src/ufuncs.c:593:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Yd_Y_funcs[1] = {&Yd_Y_func};
                                                   ^~~~~~~~~~
    src/ufuncs.c:729:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Yi_Y_funcs[1] = {&Yi_Y_func};
                                                   ^~~~~~~~~~
    src/ufuncs.c:877:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YY_Y_funcs[1] = {&YY_Y_func};
                                                   ^~~~~~~~~~
    src/ufuncs.c:981:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Y_d_funcs[1] = {&Y_d_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:1066:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction Y_i_funcs[1] = {&Y_i_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:1159:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YY_d_funcs[1] = {&YY_d_func};
                                                   ^~~~~~~~~~
    src/ufuncs.c:1200:49: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YYd_d_funcs[1] = {&YYd_d_func};
                                                    ^~~~~~~~~~~
    src/ufuncs.c:1253:49: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction YYd_Y_funcs[1] = {&YYd_Y_func};
                                                    ^~~~~~~~~~~
    src/ufuncs.c:1298:47: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction box_funcs[1] = {&box_func};
                                                  ^~~~~~~~~
    src/ufuncs.c:1389:50: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction buffer_funcs[1] = {&buffer_func};
                                                     ^~~~~~~~~~~~
    src/ufuncs.c:1451:56: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction offset_curve_funcs[1] = {&offset_curve_func};
                                                           ^~~~~~~~~~~~~~~~~~
    src/ufuncs.c:1496:48: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
    static PyUFuncGenericFunction snap_funcs[1] = {&snap_func};
                                                   ^~~~~~~~~~
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    2 warnings and 20 errors generated.
    
    Reference:      https://github.com/numpy/numpy/commit/e94cec800304a6a467cf90ce4e7d3e207770b4b4
---
 graphics/py-pygeos/Makefile            |   6 -
 graphics/py-pygeos/files/patch-clang16 | 398 +++++++++++++++++++++++++++++++++
 2 files changed, 398 insertions(+), 6 deletions(-)

diff --git a/graphics/py-pygeos/Makefile b/graphics/py-pygeos/Makefile
index 3beddab7ae46..791ed7d9f2e6 100644
--- a/graphics/py-pygeos/Makefile
+++ b/graphics/py-pygeos/Makefile
@@ -20,12 +20,6 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy>=1.13,1:math/py-numpy@${PY_FLAVOR}
 USES=		python
 USE_PYTHON=	autoplist concurrent cython pep517
 
-.include <bsd.port.options.mk>
-
-.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091
-CFLAGS+=	-Wno-error=incompatible-function-pointer-types
-.endif
-
 post-install:
 	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
 
diff --git a/graphics/py-pygeos/files/patch-clang16 b/graphics/py-pygeos/files/patch-clang16
new file mode 100644
index 000000000000..d5f1d76adc14
--- /dev/null
+++ b/graphics/py-pygeos/files/patch-clang16
@@ -0,0 +1,398 @@
+--- src/ufuncs.c.orig	2022-12-12 08:21:17 UTC
++++ src/ufuncs.c
+@@ -132,7 +132,7 @@ static void* is_ccw_data[1] = {GEOSGeom_isCCW_r};
+ 
+ typedef char FuncGEOS_Y_b(void* context, void* a);
+ static char Y_b_dtypes[2] = {NPY_OBJECT, NPY_BOOL};
+-static void Y_b_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Y_b_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Y_b* func = (FuncGEOS_Y_b*)data;
+   GEOSGeometry* in1 = NULL;
+   char ret;
+@@ -189,7 +189,7 @@ static char IsValidInput(void* context, PyObject* obj)
+ static void* is_valid_input_data[1] = {IsValidInput};
+ typedef char FuncGEOS_O_b(void* context, PyObject* obj);
+ static char O_b_dtypes[2] = {NPY_OBJECT, NPY_BOOL};
+-static void O_b_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void O_b_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_O_b* func = (FuncGEOS_O_b*)data;
+   GEOS_INIT_THREADS;
+   UNARY_LOOP { *(npy_bool*)op1 = func(ctx, *(PyObject**)ip1); }
+@@ -201,7 +201,7 @@ static PyUFuncGenericFunction O_b_funcs[1] = {&O_b_fun
+ static void* equals_data[1] = {GEOSEquals_r};
+ typedef char FuncGEOS_YY_b(void* context, void* a, void* b);
+ static char YY_b_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_BOOL};
+-static void YY_b_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YY_b_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_YY_b* func = (FuncGEOS_YY_b*)data;
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   char ret;
+@@ -273,7 +273,7 @@ static void* touches_data[1] = {touches_func_tuple};
+ static void* within_func_tuple[2] = {GEOSWithin_r, GEOSPreparedWithin_r};
+ static void* within_data[1] = {within_func_tuple};
+ static char YY_b_p_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_BOOL};
+-static void YY_b_p_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YY_b_p_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_YY_b* func = ((FuncGEOS_YY_b**)data)[0];
+   FuncGEOS_YY_b* func_prepared = ((FuncGEOS_YY_b**)data)[1];
+ 
+@@ -320,7 +320,7 @@ finish:
+ static PyUFuncGenericFunction YY_b_p_funcs[1] = {&YY_b_p_func};
+ 
+ static char is_prepared_dtypes[2] = {NPY_OBJECT, NPY_BOOL};
+-static void is_prepared_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void is_prepared_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                              void* data) {
+   GEOSGeometry* in1 = NULL;
+   GEOSPreparedGeometry* in1_prepared = NULL;
+@@ -411,7 +411,7 @@ static void* oriented_envelope_data[1] = {GEOSMinimumR
+ #endif
+ typedef void* FuncGEOS_Y_Y(void* context, void* a);
+ static char Y_Y_dtypes[2] = {NPY_OBJECT, NPY_OBJECT};
+-static void Y_Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Y_Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Y_Y* func = (FuncGEOS_Y_Y*)data;
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -479,7 +479,7 @@ static void* prepare_data[1] = {PrepareGeometryObject}
+ static void* destroy_prepared_data[1] = {DestroyPreparedGeometryObject};
+ typedef char FuncPyGEOS_Y(void* ctx, GeometryObject* geom);
+ static char Y_dtypes[1] = {NPY_OBJECT};
+-static void Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncPyGEOS_Y* func = (FuncPyGEOS_Y*)data;
+   GEOSGeometry* in1 = NULL;
+   GeometryObject* geom_obj = NULL;
+@@ -546,7 +546,7 @@ static void* segmentize_data[1] = {GEOSDensify_r};
+ 
+ typedef void* FuncGEOS_Yd_Y(void* context, void* a, double b);
+ static char Yd_Y_dtypes[3] = {NPY_OBJECT, NPY_DOUBLE, NPY_OBJECT};
+-static void Yd_Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Yd_Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Yd_Y* func = (FuncGEOS_Yd_Y*)data;
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -681,7 +681,7 @@ static void* GEOSSetSRID_r_with_clone(void* context, v
+ static void* set_srid_data[1] = {GEOSSetSRID_r_with_clone};
+ typedef void* FuncGEOS_Yi_Y(void* context, void* a, int b);
+ static char Yi_Y_dtypes[3] = {NPY_OBJECT, NPY_INT, NPY_OBJECT};
+-static void Yi_Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Yi_Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Yi_Y* func = (FuncGEOS_Yi_Y*)data;
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -817,7 +817,7 @@ static void YY_Y_func_reduce(char** args, npy_intp* di
+   }
+ }
+ 
+-static void YY_Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YY_Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   // A reduce is characterized by multiple iterations (dimension[0] > 1) that
+   // are output on the same place in memory (steps[2] == 0).
+   if ((steps[2] == 0) && (dimensions[0] > 1)) {
+@@ -952,7 +952,7 @@ static void* minimum_bounding_radius_data[1] = {GEOSMi
+ #endif
+ typedef int FuncGEOS_Y_d(void* context, void* a, double* b);
+ static char Y_d_dtypes[2] = {NPY_OBJECT, NPY_DOUBLE};
+-static void Y_d_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Y_d_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Y_d* func = (FuncGEOS_Y_d*)data;
+   GEOSGeometry* in1 = NULL;
+ 
+@@ -1029,7 +1029,7 @@ static void* get_num_coordinates_data[1] = {get_num_co
+ 
+ typedef int FuncGEOS_Y_i(void* context, void* a);
+ static char Y_i_dtypes[2] = {NPY_OBJECT, NPY_INT};
+-static void Y_i_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void Y_i_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_Y_i* func = ((FuncGEOS_Y_i**)data)[0];
+   int errcode = (int)((int**)data)[1];
+   int none_value = (int)((int**)data)[2];
+@@ -1119,7 +1119,7 @@ static int GEOSProjectNormalizedWrapped_r(void* contex
+ static void* line_locate_point_normalized_data[1] = {GEOSProjectNormalizedWrapped_r};
+ typedef int FuncGEOS_YY_d(void* context, void* a, void* b, double* c);
+ static char YY_d_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE};
+-static void YY_d_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YY_d_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_YY_d* func = (FuncGEOS_YY_d*)data;
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+ 
+@@ -1165,7 +1165,7 @@ static void* frechet_distance_densify_data[1] = {GEOSF
+ #endif
+ typedef int FuncGEOS_YYd_d(void* context, void* a, void* b, double c, double* d);
+ static char YYd_d_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE, NPY_DOUBLE};
+-static void YYd_d_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YYd_d_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_YYd_d* func = (FuncGEOS_YYd_d*)data;
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+ 
+@@ -1209,7 +1209,7 @@ static void* union_prec_data[1] = {GEOSUnionPrec_r};
+ typedef void* FuncGEOS_YYd_Y(void* context, void* a, void* b, double c);
+ static char YYd_Y_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE, NPY_OBJECT};
+ 
+-static void YYd_Y_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void YYd_Y_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   FuncGEOS_YYd_Y* func = (FuncGEOS_YYd_Y*)data;
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -1256,7 +1256,7 @@ static PyUFuncGenericFunction YYd_Y_funcs[1] = {&YYd_Y
+ /* Define functions with unique call signatures */
+ static char box_dtypes[6] = {NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE,
+                              NPY_DOUBLE, NPY_BOOL,   NPY_OBJECT};
+-static void box_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void box_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4];
+   npy_intp n = dimensions[0];
+@@ -1321,7 +1321,7 @@ static char buffer_inner(void* ctx, GEOSBufferParams* 
+ 
+ static char buffer_dtypes[8] = {NPY_OBJECT, NPY_DOUBLE, NPY_INT,  NPY_INT,
+                                 NPY_INT,    NPY_DOUBLE, NPY_BOOL, NPY_OBJECT};
+-static void buffer_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void buffer_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4],
+        *ip6 = args[5], *ip7 = args[6];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4],
+@@ -1390,7 +1390,7 @@ static PyUFuncGenericFunction buffer_funcs[1] = {&buff
+ 
+ static char offset_curve_dtypes[6] = {NPY_OBJECT, NPY_DOUBLE, NPY_INT,
+                                       NPY_INT,    NPY_DOUBLE, NPY_OBJECT};
+-static void offset_curve_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void offset_curve_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                               void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4];
+@@ -1451,7 +1451,7 @@ static void offset_curve_func(char** args, npy_intp* d
+ static PyUFuncGenericFunction offset_curve_funcs[1] = {&offset_curve_func};
+ 
+ static char snap_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE, NPY_OBJECT};
+-static void snap_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void snap_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   GEOSGeometry** geom_arr;
+ 
+@@ -1497,7 +1497,7 @@ static PyUFuncGenericFunction snap_funcs[1] = {&snap_f
+ 
+ static char clip_by_rect_dtypes[6] = {NPY_OBJECT, NPY_DOUBLE, NPY_DOUBLE,
+                                       NPY_DOUBLE, NPY_DOUBLE, NPY_OBJECT};
+-static void clip_by_rect_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void clip_by_rect_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                               void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4];
+@@ -1557,7 +1557,7 @@ static void clip_by_rect_func(char** args, npy_intp* d
+ static PyUFuncGenericFunction clip_by_rect_funcs[1] = {&clip_by_rect_func};
+ 
+ static char equals_exact_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE, NPY_BOOL};
+-static void equals_exact_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void equals_exact_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                               void* data) {
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   double in3;
+@@ -1597,7 +1597,7 @@ static PyUFuncGenericFunction equals_exact_funcs[1] = 
+ #if GEOS_SINCE_3_10_0
+ 
+ static char dwithin_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_DOUBLE, NPY_BOOL};
+-static void dwithin_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void dwithin_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   GEOSPreparedGeometry* in1_prepared = NULL;
+   double in3;
+@@ -1645,7 +1645,7 @@ static PyUFuncGenericFunction dwithin_funcs[1] = {&dwi
+ #endif  // GEOS_SINCE_3_10_0
+ 
+ static char delaunay_triangles_dtypes[4] = {NPY_OBJECT, NPY_DOUBLE, NPY_BOOL, NPY_OBJECT};
+-static void delaunay_triangles_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void delaunay_triangles_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                     void* data) {
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -1692,7 +1692,7 @@ static PyUFuncGenericFunction delaunay_triangles_funcs
+ 
+ static char voronoi_polygons_dtypes[5] = {NPY_OBJECT, NPY_DOUBLE, NPY_OBJECT, NPY_BOOL,
+                                           NPY_OBJECT};
+-static void voronoi_polygons_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void voronoi_polygons_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                   void* data) {
+   GEOSGeometry *in1 = NULL, *in3 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -1739,7 +1739,7 @@ static void voronoi_polygons_func(char** args, npy_int
+ static PyUFuncGenericFunction voronoi_polygons_funcs[1] = {&voronoi_polygons_func};
+ 
+ static char is_valid_reason_dtypes[2] = {NPY_OBJECT, NPY_OBJECT};
+-static void is_valid_reason_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void is_valid_reason_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                  void* data) {
+   char* reason;
+   GEOSGeometry* in1 = NULL;
+@@ -1777,7 +1777,7 @@ finish:
+ static PyUFuncGenericFunction is_valid_reason_funcs[1] = {&is_valid_reason_func};
+ 
+ static char relate_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_OBJECT};
+-static void relate_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void relate_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   char* pattern;
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+ 
+@@ -1818,7 +1818,7 @@ finish:
+ static PyUFuncGenericFunction relate_funcs[1] = {&relate_func};
+ 
+ static char relate_pattern_dtypes[4] = {NPY_OBJECT, NPY_OBJECT, NPY_OBJECT, NPY_BOOL};
+-static void relate_pattern_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void relate_pattern_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                 void* data) {
+   GEOSGeometry *in1 = NULL, *in2 = NULL;
+   const char* pattern = NULL;
+@@ -1878,7 +1878,7 @@ finish:
+ static PyUFuncGenericFunction relate_pattern_funcs[1] = {&relate_pattern_func};
+ 
+ static char polygonize_dtypes[2] = {NPY_OBJECT, NPY_OBJECT};
+-static void polygonize_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void polygonize_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                             void* data) {
+   GEOSGeometry* geom = NULL;
+   unsigned int n_geoms;
+@@ -1923,7 +1923,7 @@ static PyUFuncGenericFunction polygonize_funcs[1] = {&
+ 
+ static char polygonize_full_dtypes[5] = {NPY_OBJECT, NPY_OBJECT, NPY_OBJECT, NPY_OBJECT,
+                                          NPY_OBJECT};
+-static void polygonize_full_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void polygonize_full_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                  void* data) {
+   GEOSGeometry* geom = NULL;
+   GEOSGeometry* geom_copy = NULL;
+@@ -1999,7 +1999,7 @@ finish:
+ static PyUFuncGenericFunction polygonize_full_funcs[1] = {&polygonize_full_func};
+ 
+ static char shortest_line_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_OBJECT};
+-static void shortest_line_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void shortest_line_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                void* data) {
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry* in2 = NULL;
+@@ -2072,7 +2072,7 @@ static PyUFuncGenericFunction shortest_line_funcs[1] =
+ 
+ #if GEOS_SINCE_3_6_0
+ static char set_precision_dtypes[4] = {NPY_OBJECT, NPY_DOUBLE, NPY_INT, NPY_OBJECT};
+-static void set_precision_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void set_precision_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                void* data) {
+   GEOSGeometry* in1 = NULL;
+   GEOSGeometry** geom_arr;
+@@ -2140,7 +2140,7 @@ static PyUFuncGenericFunction set_precision_funcs[1] =
+ 
+ /* define double -> geometry construction functions */
+ static char points_dtypes[2] = {NPY_DOUBLE, NPY_OBJECT};
+-static void points_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void points_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   GEOSCoordSequence* coord_seq = NULL;
+   GEOSGeometry** geom_arr;
+ 
+@@ -2194,7 +2194,7 @@ finish:
+ static PyUFuncGenericFunction points_funcs[1] = {&points_func};
+ 
+ static char linestrings_dtypes[2] = {NPY_DOUBLE, NPY_OBJECT};
+-static void linestrings_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void linestrings_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                              void* data) {
+   GEOSCoordSequence* coord_seq = NULL;
+   GEOSGeometry** geom_arr;
+@@ -2234,7 +2234,7 @@ finish:
+ static PyUFuncGenericFunction linestrings_funcs[1] = {&linestrings_func};
+ 
+ static char linearrings_dtypes[2] = {NPY_DOUBLE, NPY_OBJECT};
+-static void linearrings_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void linearrings_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                              void* data) {
+   GEOSCoordSequence* coord_seq = NULL;
+   GEOSGeometry** geom_arr;
+@@ -2298,7 +2298,7 @@ finish:
+ static PyUFuncGenericFunction linearrings_funcs[1] = {&linearrings_func};
+ 
+ static char polygons_dtypes[3] = {NPY_OBJECT, NPY_OBJECT, NPY_OBJECT};
+-static void polygons_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void polygons_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                           void* data) {
+   GEOSGeometry *hole, *shell, *hole_copy, *shell_copy;
+   GEOSGeometry **holes, **geom_arr;
+@@ -2410,7 +2410,7 @@ finish:
+ static PyUFuncGenericFunction polygons_funcs[1] = {&polygons_func};
+ 
+ static char create_collection_dtypes[3] = {NPY_OBJECT, NPY_INT, NPY_OBJECT};
+-static void create_collection_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void create_collection_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                                    void* data) {
+   GEOSGeometry *g, *g_copy;
+   int n_geoms, type, actual_type, expected_type, alt_expected_type;
+@@ -2513,7 +2513,7 @@ finish:
+ static PyUFuncGenericFunction create_collection_funcs[1] = {&create_collection_func};
+ 
+ static char bounds_dtypes[2] = {NPY_OBJECT, NPY_DOUBLE};
+-static void bounds_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void bounds_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   GEOSGeometry *envelope = NULL, *in1;
+   const GEOSGeometry* ring;
+   const GEOSCoordSequence* coord_seq;
+@@ -2609,7 +2609,7 @@ static PyUFuncGenericFunction bounds_funcs[1] = {&boun
+ /* Define the object -> geom functions (O_Y) */
+ 
+ static char from_wkb_dtypes[3] = {NPY_OBJECT, NPY_UINT8, NPY_OBJECT};
+-static void from_wkb_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void from_wkb_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                           void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];
+   npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];
+@@ -2700,7 +2700,7 @@ finish:
+ static PyUFuncGenericFunction from_wkb_funcs[1] = {&from_wkb_func};
+ 
+ static char from_wkt_dtypes[3] = {NPY_OBJECT, NPY_UINT8, NPY_OBJECT};
+-static void from_wkt_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void from_wkt_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                           void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];
+   npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];
+@@ -2777,7 +2777,7 @@ finish:
+ static PyUFuncGenericFunction from_wkt_funcs[1] = {&from_wkt_func};
+ 
+ static char from_shapely_dtypes[2] = {NPY_OBJECT, NPY_OBJECT};
+-static void from_shapely_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void from_shapely_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                               void* data) {
+   GEOSGeometry *in_ptr, *ret_ptr;
+   PyObject *in1, *attr;
+@@ -2832,7 +2832,7 @@ static PyUFuncGenericFunction from_shapely_funcs[1] = 
+ 
+ static char to_wkb_dtypes[6] = {NPY_OBJECT, NPY_BOOL, NPY_INT,
+                                 NPY_INT,    NPY_BOOL, NPY_OBJECT};
+-static void to_wkb_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void to_wkb_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4],
+        *op1 = args[5];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4],
+@@ -2937,7 +2937,7 @@ static PyUFuncGenericFunction to_wkb_funcs[1] = {&to_w
+ 
+ static char to_wkt_dtypes[6] = {NPY_OBJECT, NPY_INT,  NPY_BOOL,
+                                 NPY_INT,    NPY_BOOL, NPY_OBJECT};
+-static void to_wkt_func(char** args, npy_intp* dimensions, npy_intp* steps, void* data) {
++static void to_wkt_func(char** args, const npy_intp* dimensions, const npy_intp* steps, void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *ip3 = args[2], *ip4 = args[3], *ip5 = args[4],
+        *op1 = args[5];
+   npy_intp is1 = steps[0], is2 = steps[1], is3 = steps[2], is4 = steps[3], is5 = steps[4],
+@@ -3022,7 +3022,7 @@ static PyUFuncGenericFunction to_wkt_funcs[1] = {&to_w
+ #if GEOS_SINCE_3_10_0
+ 
+ static char from_geojson_dtypes[3] = {NPY_OBJECT, NPY_UINT8, NPY_OBJECT};
+-static void from_geojson_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void from_geojson_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                               void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];
+   npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];
+@@ -3100,7 +3100,7 @@ finish:
+ static PyUFuncGenericFunction from_geojson_funcs[1] = {&from_geojson_func};
+ 
+ static char to_geojson_dtypes[3] = {NPY_OBJECT, NPY_INT, NPY_OBJECT};
+-static void to_geojson_func(char** args, npy_intp* dimensions, npy_intp* steps,
++static void to_geojson_func(char** args, const npy_intp* dimensions, const npy_intp* steps,
+                             void* data) {
+   char *ip1 = args[0], *ip2 = args[1], *op1 = args[2];
+   npy_intp is1 = steps[0], is2 = steps[1], os1 = steps[2];