Skip to content

Commit 12eddf0

Browse files
committed
Fix const correctness issues
This avoids lots of C compiler warnings.
1 parent 3afa29c commit 12eddf0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/basemap/src/_geoslib.pyx

+9-9
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ cdef extern from "geos_c.h":
104104
GEOSGeometry *GEOSGetExteriorRing(GEOSGeometry* g)
105105
# Return NULL on exception.
106106
# Geometry must be a LineString, LinearRing or Point.
107-
GEOSCoordSequence *GEOSGeom_getCoordSeq(GEOSGeometry* g)
108-
int GEOSCoordSeq_getSize(GEOSCoordSequence *s, unsigned int *size)
107+
GEOSCoordSequence *GEOSGeom_getCoordSeq(const GEOSGeometry* g)
108+
int GEOSCoordSeq_getSize(const GEOSCoordSequence *s, unsigned int *size)
109109

110110
# Cython 3: Next cdef needs "noexcept" declaration unless
111111
# the compiler directive "legacy_implicit_noexcept" is used
@@ -175,7 +175,7 @@ cdef class BaseGeometry:
175175
cdef GEOSGeometry *g1
176176
cdef GEOSGeometry *g2
177177
cdef GEOSGeometry *g3
178-
cdef GEOSGeometry *gout
178+
cdef const GEOSGeometry *gout
179179
cdef int numgeoms, i, typeid
180180
g1 = self._geom
181181
g2 = geom._geom
@@ -207,7 +207,7 @@ cdef class BaseGeometry:
207207
def simplify(self, tol):
208208
cdef GEOSGeometry *g1
209209
cdef GEOSGeometry *g3
210-
cdef GEOSGeometry *gout
210+
cdef const GEOSGeometry *gout
211211
cdef double tolerance
212212
cdef int numgeoms, i, typeid
213213
g1 = self._geom
@@ -240,7 +240,7 @@ cdef class BaseGeometry:
240240
def fix(self):
241241
cdef GEOSGeometry *g1
242242
cdef GEOSGeometry *g3
243-
cdef GEOSGeometry *gout
243+
cdef const GEOSGeometry *gout
244244
cdef int numgeoms, i, typeid
245245
g1 = self._geom
246246
g3 = GEOSBuffer(g1, 0., 0)
@@ -284,7 +284,7 @@ cdef class BaseGeometry:
284284
cdef GEOSGeometry *g1
285285
cdef GEOSGeometry *g2
286286
cdef GEOSGeometry *g3
287-
cdef GEOSGeometry *gout
287+
cdef const GEOSGeometry *gout
288288
cdef char answer
289289
cdef int numgeoms, i, typeid
290290
g1 = self._geom
@@ -438,9 +438,9 @@ cdef class Point(BaseGeometry):
438438
self._npts = 1
439439
self.boundary = b
440440

441-
cdef _get_coords(GEOSGeometry *geom):
442-
cdef GEOSCoordSequence *cs
443-
cdef GEOSGeometry *lr
441+
cdef _get_coords(const GEOSGeometry *geom):
442+
cdef const GEOSCoordSequence *cs
443+
cdef const GEOSGeometry *lr
444444
cdef unsigned int i, M
445445
cdef double dx, dy
446446
cdef ndarray b

0 commit comments

Comments
 (0)