Skip to content

Commit

Permalink
lib/shapelib: sync upstream with shapelib 1.6.0 and GDAL 3.9.2 (#4395)
Browse files Browse the repository at this point in the history
* fix win runner (-Wincompatible-pointer-types warnings)

* remove patch of http://trac.osgeo.org/gdal/ticket/809
  • Loading branch information
nilason authored Sep 29, 2024
1 parent 0ea5e37 commit 16c87b1
Show file tree
Hide file tree
Showing 6 changed files with 933 additions and 915 deletions.
44 changes: 3 additions & 41 deletions lib/external/shapelib/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Update history of SHAPELIB copy

* files `shpopen.c`, `shapefil.h`, `dbfopen.c`
* files `shpopen.c`, `shapefil.h`, `dbfopen.c`, `shapefil_private.h`
from GDAL [ogr/ogrsf_frmts/shape/](https://github.com/OSGeo/gdal/tree/master/ogr/ogrsf_frmts/shape)
* file `safileio.c`
from [SHAPELIB](http://download.osgeo.org/shapelib/)

## Last update

* taken from GDAL 3.9.2 and SHAPELIB 1.6.0 (Sep 2024)
* taken from GDAL 3.5.3 and SHAPELIB 1.5.0 (Dec 2022)
* taken from GDAL 2.1.2 and SHAPELIB 1.3.0 (Thu Nov 24 10:45:41 CET 2016)
* taken from GDAL 1.5.1-SVN (Sun Mar 30 11:20:43 CEST 2008)
Expand All @@ -15,44 +16,5 @@

## Summary of fixes

* dbfopen.c
around line 1229: GDAL bug [ticket-#809](http://trac.osgeo.org/gdal/ticket/809)

* safileio.c
SHP_CVSID: ISO C does not allow extra ‘;’ outside of a function

## Full fix

```diff
diff --git a/lib/external/shapelib/dbfopen.c b/lib/external/shapelib/dbfopen.c
index 5380e3e20b..5151148d33 100644
--- a/lib/external/shapelib/dbfopen.c
+++ b/lib/external/shapelib/dbfopen.c
@@ -1226,9 +1226,10 @@ DBFGetFieldInfo( DBFHandle psDBF, int iField, char * pszFieldName,
else if( psDBF->pachFieldType[iField] == 'N'
|| psDBF->pachFieldType[iField] == 'F' )
{
- if( psDBF->panFieldDecimals[iField] > 0
- || psDBF->panFieldSize[iField] >= 10 )
+ if( psDBF->panFieldDecimals[iField] > 0 ) {
+ /* || psDBF->panFieldSize[iField] >= 10 ) */ /* GDAL bug #809 */
return( FTDouble );
+ }
else
return( FTInteger );
}
diff --git a/lib/external/shapelib/safileio.c b/lib/external/shapelib/safileio.c
index 289d347eaf..7a614a5806 100644
--- a/lib/external/shapelib/safileio.c
+++ b/lib/external/shapelib/safileio.c
@@ -74,7 +74,7 @@
#include <string.h>
#include <stdio.h>

-SHP_CVSID("$Id: safileio.c,v 1.6 2018-06-15 19:56:32 erouault Exp $");
+SHP_CVSID("$Id: safileio.c,v 1.6 2018-06-15 19:56:32 erouault Exp $")

#ifdef SHPAPI_UTF8_HOOKS
# ifdef SHPAPI_WINDOWS

```
[shapelib commit 316ff87](https://github.com/OSGeo/shapelib/commit/316ff872566ea0d91d6b62fe01bfe39931db39aa#diff-f068bc465ca1a32e1b9c214d4eb9504ef9e0f3c4cabc1aa4bab8aa41e2248cc6R153)
Loading

0 comments on commit 16c87b1

Please sign in to comment.