README 4.0 KB

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