Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings from extensions #1315

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions fiona/crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,6 @@ cdef class CRS:
def __copy__(self):
return pickle.loads(pickle.dumps(self))

def __hash__(self):
return hash(self.to_wkt())

def __str__(self):
return self.to_string()

Expand Down
9 changes: 5 additions & 4 deletions fiona/ogrext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ cdef void gdal_flush_cache(void *cogr_ds):
GDALFlushCache(cogr_ds)


cdef void* gdal_open_vector(char* path_c, int mode, drivers, options) except NULL:
cdef void* gdal_open_vector(const char* path_c, int mode, drivers, options) except NULL:
cdef void* cogr_ds = NULL
cdef char **drvs = NULL
cdef void* drv = NULL
Expand Down Expand Up @@ -1039,7 +1039,7 @@ cdef class Session:
else:
obj = self.cogr_ds

cdef char *value = NULL
cdef const char *value = NULL
value = GDALGetMetadataItem(obj, name, domain)
if value == NULL:
return None
Expand All @@ -1055,7 +1055,7 @@ cdef class WritingSession(Session):
def start(self, collection, **kwargs):
cdef OGRSpatialReferenceH cogr_srs = NULL
cdef char **options = NULL
cdef const char *path_c = NULL
cdef char *path_c = NULL
cdef const char *driver_c = NULL
cdef const char *name_c = NULL
cdef const char *proj_c = NULL
Expand Down Expand Up @@ -1104,6 +1104,7 @@ cdef class WritingSession(Session):
driver_c = driver_b
cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver_c))

cogr_ds = NULL
if not CPLCheckForFile(path_c, NULL):
log.debug("File doesn't exist. Creating a new one...")
with Env(GDAL_VALIDATE_CREATION_OPTIONS="NO"):
Expand Down Expand Up @@ -2153,7 +2154,7 @@ def _get_metadata_item(driver, metadata_item):
str or None
Metadata item
"""
cdef char* metadata_c = NULL
cdef const char* metadata_c = NULL
cdef void *cogr_driver

if get_gdal_version_tuple() < (2, ):
Expand Down