| 1 | Update history of SHAPELIB copy:
|
|---|
| 2 |
|
|---|
| 3 | * files shpopen.c,shapefil.h,dbfopen.c:
|
|---|
| 4 | from ogr/ogrsf_frmts/shape/
|
|---|
| 5 | * file safileio.c
|
|---|
| 6 | from SHAPELIB itself (http://download.osgeo.org/shapelib/)
|
|---|
| 7 |
|
|---|
| 8 | Last update
|
|---|
| 9 | * taken from GDAL 2.1.2 and SHAPELIB 1.3.0 (Thu Nov 24 10:45:41 CET 2016)
|
|---|
| 10 | * taken from GDAL 1.5.1-SVN (Sun Mar 30 11:20:43 CEST 2008)
|
|---|
| 11 | * taken from GDAL 1.5.0-CVS (Wed Sep 5 13:48:48 CEST 2007)
|
|---|
| 12 | * taken from GDAL 1.3.2-CVS (Sat Jun 17 22:08:04 CEST 2006)
|
|---|
| 13 |
|
|---|
| 14 | Additional fixes:
|
|---|
| 15 | * dbfopen.c
|
|---|
| 16 | around line 1270: GDAL bug #809 (http://trac.osgeo.org/gdal/ticket/809)
|
|---|
| 17 | remove CPLsnprintf
|
|---|
| 18 | remove CPL_IGNORE_RET_VAL_INT
|
|---|
| 19 | for WIN32, define snprintf as in shpopen.c
|
|---|
| 20 |
|
|---|
| 21 | * shpopen.c
|
|---|
| 22 | define CPL_UNUSED
|
|---|
| 23 |
|
|---|
| 24 | * safileio.c
|
|---|
| 25 | SHP_CVSID: ISO C does not allow extra ‘;’ outside of a function
|
|---|
| 26 |
|
|---|
| 27 | * Use <grass/shapefil.h> etc rather than "shapefil.h"
|
|---|
| 28 | in shpopen.c, dbfopen.c, and safileio.c
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | full fix for dbf_open.c
|
|---|
| 32 | -->
|
|---|
| 33 | diff -up shapelib_gdal/dbfopen.c shapelib/dbfopen.c
|
|---|
| 34 | --- shapelib_gdal/dbfopen.c 2016-10-24 13:00:32.000000000 +0200
|
|---|
| 35 | +++ shapelib/dbfopen.c 2016-11-24 11:34:23.996675393 +0100
|
|---|
| 36 | @@ -157,7 +157,7 @@
|
|---|
| 37 | * Treat all blank numeric fields as null too.
|
|---|
| 38 | */
|
|---|
| 39 |
|
|---|
| 40 | -#include "shapefil.h"
|
|---|
| 41 | +#include <grass/shapefil.h>
|
|---|
| 42 |
|
|---|
| 43 | #include <math.h>
|
|---|
| 44 | #include <stdlib.h>
|
|---|
| 45 | @@ -170,6 +170,12 @@
|
|---|
| 46 | #define CPLsprintf sprintf
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | +#if defined(WIN32) || defined(_WIN32)
|
|---|
| 50 | +# ifndef snprintf
|
|---|
| 51 | +# define snprintf _snprintf
|
|---|
| 52 | +# endif
|
|---|
| 53 | +#endif
|
|---|
| 54 | +
|
|---|
| 55 | SHP_CVSID("$Id: README 69892 2016-11-24 10:41:11Z mmetz $")
|
|---|
| 56 |
|
|---|
| 57 | #ifndef FALSE
|
|---|
| 58 | @@ -177,8 +183,6 @@ SHP_CVSID("$Id: dbfopen.c,v 1.89 2011-07
|
|---|
| 59 | # define TRUE 1
|
|---|
| 60 | #endif
|
|---|
| 61 |
|
|---|
| 62 | -CPL_INLINE static void CPL_IGNORE_RET_VAL_INT(CPL_UNUSED int unused) {}
|
|---|
| 63 | -
|
|---|
| 64 | /************************************************************************/
|
|---|
| 65 | /* SfRealloc() */
|
|---|
| 66 | /* */
|
|---|
| 67 | @@ -616,7 +620,7 @@ DBFClose(DBFHandle psDBF)
|
|---|
| 68 | if( psDBF->bNoHeader )
|
|---|
| 69 | DBFWriteHeader( psDBF );
|
|---|
| 70 |
|
|---|
| 71 | - CPL_IGNORE_RET_VAL_INT(DBFFlushRecord( psDBF ));
|
|---|
| 72 | + DBFFlushRecord( psDBF );
|
|---|
| 73 |
|
|---|
| 74 | /* -------------------------------------------------------------------- */
|
|---|
| 75 | /* Update last access date, and number of records if we have */
|
|---|
| 76 | @@ -1273,8 +1277,8 @@ DBFGetFieldInfo( DBFHandle psDBF, int iF
|
|---|
| 77 | else if( psDBF->pachFieldType[iField] == 'N'
|
|---|
| 78 | || psDBF->pachFieldType[iField] == 'F' )
|
|---|
| 79 | {
|
|---|
| 80 | - if( psDBF->panFieldDecimals[iField] > 0
|
|---|
| 81 | - || psDBF->panFieldSize[iField] >= 10 )
|
|---|
| 82 | + if( psDBF->panFieldDecimals[iField] > 0 )
|
|---|
| 83 | +/* || psDBF->panFieldSize[iField] >= 10 ) */ /* GDAL bug #809 */
|
|---|
| 84 | return( FTDouble );
|
|---|
| 85 | else
|
|---|
| 86 | return( FTInteger );
|
|---|
| 87 | @@ -1364,7 +1368,7 @@ static int DBFWriteAttribute(DBFHandle p
|
|---|
| 88 |
|
|---|
| 89 | snprintf( szFormat, sizeof(szFormat), "%%%d.%df",
|
|---|
| 90 | nWidth, psDBF->panFieldDecimals[iField] );
|
|---|
| 91 | - CPLsnprintf(szSField, sizeof(szSField), szFormat, *((double *) pValue) );
|
|---|
| 92 | + snprintf(szSField, sizeof(szSField), szFormat, *((double *) pValue) );
|
|---|
| 93 | if( (int) strlen(szSField) > psDBF->panFieldSize[iField] )
|
|---|
| 94 | {
|
|---|
| 95 | szSField[psDBF->panFieldSize[iField]] = '\0';
|
|---|
| 96 | <--
|
|---|
| 97 |
|
|---|
| 98 | full fix for shpopen.c
|
|---|
| 99 | -->
|
|---|
| 100 | diff -up shapelib_gdal/shpopen.c shapelib/shpopen.c
|
|---|
| 101 | --- shapelib_gdal/shpopen.c 2016-10-24 13:00:32.000000000 +0200
|
|---|
| 102 | +++ shapelib/shpopen.c 2016-11-24 10:25:58.460964573 +0100
|
|---|
| 103 | @@ -265,7 +265,7 @@
|
|---|
| 104 | *
|
|---|
| 105 | */
|
|---|
| 106 |
|
|---|
| 107 | -#include "shapefil.h"
|
|---|
| 108 | +#include <grass/shapefil.h>
|
|---|
| 109 |
|
|---|
| 110 | #include <math.h>
|
|---|
| 111 | #include <limits.h>
|
|---|
| 112 | @@ -276,6 +276,10 @@
|
|---|
| 113 |
|
|---|
| 114 | SHP_CVSID("$Id: README 69892 2016-11-24 10:41:11Z mmetz $")
|
|---|
| 115 |
|
|---|
| 116 | +#ifndef CPL_UNUSED
|
|---|
| 117 | +#define CPL_UNUSED
|
|---|
| 118 | +#endif
|
|---|
| 119 | +
|
|---|
| 120 | typedef unsigned char uchar;
|
|---|
| 121 |
|
|---|
| 122 | #if UINT_MAX == 65535
|
|---|
| 123 | <--
|
|---|
| 124 |
|
|---|
| 125 | full fix for safileio.c
|
|---|
| 126 | -->
|
|---|
| 127 | diff -up shapelib_gdal/safileio.c shapelib/safileio.c
|
|---|
| 128 | --- shapelib_gdal/safileio.c 2008-01-16 21:05:14.000000000 +0100
|
|---|
| 129 | +++ shapelib/safileio.c 2016-11-24 10:25:42.734991066 +0100
|
|---|
| 130 | @@ -56,7 +56,7 @@
|
|---|
| 131 | *
|
|---|
| 132 | */
|
|---|
| 133 |
|
|---|
| 134 | -#include "shapefil.h"
|
|---|
| 135 | +#include <grass/shapefil.h>
|
|---|
| 136 |
|
|---|
| 137 | #include <math.h>
|
|---|
| 138 | #include <limits.h>
|
|---|
| 139 | @@ -65,7 +65,7 @@
|
|---|
| 140 | #include <string.h>
|
|---|
| 141 | #include <stdio.h>
|
|---|
| 142 |
|
|---|
| 143 | -SHP_CVSID("$Id: README 69892 2016-11-24 10:41:11Z mmetz $");
|
|---|
| 144 | +SHP_CVSID("$Id: README 69892 2016-11-24 10:41:11Z mmetz $")
|
|---|
| 145 |
|
|---|
| 146 | #ifdef SHPAPI_UTF8_HOOKS
|
|---|
| 147 | # ifdef SHPAPI_WINDOWS
|
|---|
| 148 | <--
|
|---|
| 149 |
|
|---|