[Git][debian-gis-team/shapelib][upstream] New upstream version 1.6.1

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Wed Aug 14 14:22:19 BST 2024



Bas Couwenberg pushed to branch upstream at Debian GIS Project / shapelib


Commits:
4724428d by Bas Couwenberg at 2024-08-14T14:59:53+02:00
New upstream version 1.6.1
- - - - -


10 changed files:

- contrib/tests/shpproj.sh
- shpdump.c
- shprewind.c
- shptest.c
- shptreedump.c
- tests/test1.sh
- tests/test2.sh
- tests/test3.sh
- web/dbf_api.html
- web/shp_api.html


Changes:

=====================================
contrib/tests/shpproj.sh
=====================================
@@ -1,6 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
-readonly SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
+set -eu
+
+readonly SCRIPTDIR=$(dirname "$0")
 
 "${SHPCREATE:-$top_builddir/shpcreate}" "test" point
 
@@ -19,8 +21,19 @@ readonly SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
 
 "${SHPDUMP:-$top_builddir/shpdump}" -precision 8 "test" > "test.out"
 
+supports_strip_trailing_cr() {
+	diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr'
+}
+
+run_diff() {
+	if supports_strip_trailing_cr; then
+		diff --strip-trailing-cr "$SCRIPTDIR/expect.out" "test.out"
+	else
+		diff "$SCRIPTDIR/expect.out" "test.out"
+	fi
+}
 
-if result=$(diff --strip-trailing-cr "$SCRIPTDIR/expect.out" "test.out"); then
+if result=$(run_diff); then
 	echo "******* Test Succeeded *********"
 	exit 0
 else


=====================================
shpdump.c
=====================================
@@ -175,9 +175,5 @@ int main(int argc, char **argv)
         printf("%d object has invalid ring orderings.\n", nInvalidCount);
     }
 
-#ifdef USE_DBMALLOC
-    malloc_dump(2);
-#endif
-
     exit(0);
 }


=====================================
shprewind.c
=====================================
@@ -53,6 +53,7 @@ int main(int argc, char **argv)
 
     if (hSHPOut == NULL)
     {
+        SHPClose(hSHP);
         printf("Unable to create:%s\n", argv[2]);
         exit(1);
     }


=====================================
shptest.c
=====================================
@@ -249,9 +249,5 @@ int main(int argc, char **argv)
         exit(10);
     }
 
-#ifdef USE_DBMALLOC
-    malloc_dump(2);
-#endif
-
     exit(0);
 }


=====================================
shptreedump.c
=====================================
@@ -201,10 +201,6 @@ int main(int argc, char **argv)
 
     SHPClose(hSHP);
 
-#ifdef USE_DBMALLOC
-    malloc_dump(2);
-#endif
-
     exit(0);
 }
 


=====================================
tests/test1.sh
=====================================
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 set -eu
 
-readonly SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
+readonly SCRIPTDIR=$(dirname "$0")
 readonly EXPECT="${1:-$SCRIPTDIR/expect1.out}"
 readonly EG_DATA="${2:-$SCRIPTDIR/shape_eg_data}"
 
@@ -34,7 +34,19 @@ echo -------------------------------------------------------------------------
 } > s1.out
 
 
-if result=$(diff --strip-trailing-cr "$EXPECT" "s1.out"); then
+supports_strip_trailing_cr() {
+	diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr'
+}
+
+run_diff() {
+	if supports_strip_trailing_cr; then
+		diff --strip-trailing-cr "$EXPECT" "s1.out"
+	else
+		diff "$EXPECT" "s1.out"
+	fi
+}
+
+if result=$(run_diff); then
 	echo "******* Stream 1 Succeeded *********"
 	exit 0
 else


=====================================
tests/test2.sh
=====================================
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
-readonly SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
+readonly SCRIPTDIR=$(dirname "$0")
 readonly EXPECT="${1:-$SCRIPTDIR/expect2.out}"
 
 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13; do
@@ -12,7 +12,20 @@ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13; do
   "${SHPDUMP:-./shpdump}" test${i}.shp
 done > "s2.out"
 
-if result=$(diff --strip-trailing-cr "$EXPECT" "s2.out"); then
+
+supports_strip_trailing_cr() {
+	diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr'
+}
+
+run_diff() {
+	if supports_strip_trailing_cr; then
+		diff --strip-trailing-cr "$EXPECT" "s2.out"
+	else
+		diff "$EXPECT" "s2.out"
+	fi
+}
+
+if result=$(run_diff); then
 	echo "******* Stream 2 Succeeded *********"
 	exit 0
 else


=====================================
tests/test3.sh
=====================================
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 #
 #	Use example programs to create a very simple dataset that
@@ -7,7 +7,7 @@
 
 set -eu
 
-readonly SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
+readonly SCRIPTDIR=$(dirname "$0")
 readonly EXPECT="${1:-$SCRIPTDIR/expect3.out}"
 
 {
@@ -27,7 +27,20 @@ readonly EXPECT="${1:-$SCRIPTDIR/expect3.out}"
 "${DBFDUMP:-./dbfdump}" test.dbf
 } > s3.out
 
-if result=$(diff --strip-trailing-cr "$EXPECT" "s3.out"); then
+
+supports_strip_trailing_cr() {
+	diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr'
+}
+
+run_diff() {
+	if supports_strip_trailing_cr; then
+		diff --strip-trailing-cr "$EXPECT" "s3.out"
+	else
+		diff "$EXPECT" "s3.out"
+	fi
+}
+
+if result=$(run_diff); then
 	echo "******* Stream 3 Succeeded *********"
 	exit 0
 else


=====================================
web/dbf_api.html
=====================================
@@ -54,7 +54,7 @@ DBFHandle DBFCreate( const char * pszDBFFile );
 <h2>DBFGetFieldCount()</h2>
 
 <pre>
-int DBFGetFieldCount( DBFHandle hDBF );
+int DBFGetFieldCount( const DBFHandle hDBF );
 
   hDBF:		The access handle for the file to be queried, as returned
                 by DBFOpen(), or DBFCreate().
@@ -68,7 +68,7 @@ int DBFGetFieldCount( DBFHandle hDBF );
 <h2>DBFGetRecordCount()</h2>
 
 <pre>
-int DBFGetRecordCount( DBFHandle hDBF );
+int DBFGetRecordCount( const DBFHandle hDBF );
 
   hDBF:		The access handle for the file to be queried, as returned by
 		DBFOpen(), or DBFCreate().
@@ -83,7 +83,7 @@ int DBFGetRecordCount( DBFHandle hDBF );
 <h2>DBFGetFieldIndex()</h2>
 
 <pre>
-int DBFGetFieldIndex( DBFHandle hDBF, const char *pszFieldName );
+int DBFGetFieldIndex( const DBFHandle hDBF, const char *pszFieldName );
 
   hDBF:		The access handle for the file to be queried, as returned by
 		DBFOpen(), or DBFCreate().
@@ -99,7 +99,8 @@ int DBFGetFieldIndex( DBFHandle hDBF, const char *pszFieldName );
 <h2>DBFGetFieldInfo()</h2>
 
 <pre>
-DBFFieldType DBFGetFieldInfo( DBFHandle hDBF, int iField, char * pszFieldName,
+DBFFieldType DBFGetFieldInfo( const  DBFHandle hDBF, int iField,
+                              char * pszFieldName,
                               int * pnWidth, int * pnDecimals );
 
   hDBF:		The access handle for the file to be queried, as returned by
@@ -127,16 +128,16 @@ DBFFieldType DBFGetFieldInfo( DBFHandle hDBF, int iField, char * pszFieldName,
   The DBFGetFieldInfo() returns the type of the requested field, which is
   one of the DBFFieldType enumerated values.  As well, the field name, and
   field width information can optionally be returned.  The field type returned
-  does not correspond one to one with the xBase field types.  For instance
-  the xBase field type for Date will just be returned as being FTInteger.  <p>
+  does not correspond one to one with the xBase field types.  <p>
 
 <pre>
     typedef enum {
-      FTString,			/* fixed length string field 		*/
-      FTInteger,		/* numeric field with no decimals 	*/
-      FTDouble,			/* numeric field with decimals 		*/
-      FTLogical,		/* logical field.                       */
-      FTInvalid                 /* not a recognised field type 		*/
+      FTString,			/* fixed length string field        */
+      FTInteger,		/* numeric field with no decimals   */
+      FTDouble,			/* numeric field with decimals      */
+      FTLogical,		/* logical field                    */
+      FTDate,			/* date field                       */
+      FTInvalid			/* not a recognised field type      */
     } DBFFieldType;
 </pre>
 
@@ -251,7 +252,7 @@ const char *DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
 <h2>DBFIsAttributeNULL()</h2>
 
 <pre>
-int DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
+int DBFIsAttributeNULL( const DBFHandle hDBF, int iShape, int iField );
 
   hDBF:		The access handle for the file to be queried, as returned by
 		DBFOpen(), or DBFCreate().
@@ -382,7 +383,7 @@ void DBFClose( DBFHandle hDBF );
 <h2>DBFIsRecordDeleted()</h2>
 
 <pre>
-int DBFIsRecordDeleted( DBFHandle hDBF, int iShape );
+int DBFIsRecordDeleted( const DBFHandle hDBF, int iShape );
 
   hDBF:		The access handle for the file to be checked.
   iShape:       The record index to check.
@@ -410,7 +411,7 @@ int DBFMarkRecordDeleted( DBFHandle hDBF, int iShape, int bIsDeleted );
 <h2>DBFGetNativeFieldType()</h2>
 
 <pre>
-char DBFGetNativeFieldType( DBFHandle hDBF, int iField );
+char DBFGetNativeFieldType( const DBFHandle hDBF, int iField );
 
   hDBF:		The access handle for the file.
   iField:       The field index to query.


=====================================
web/shp_api.html
=====================================
@@ -82,6 +82,9 @@ should be disposed of with SHPDestroyObject().<p>
     double	dfYMax;
     double	dfZMax;
     double	dfMMax;
+
+    int bMeasureIsUsed;
+    int bFastModeReadObject;
   } SHPObject;
 </pre>
 
@@ -113,7 +116,7 @@ SHPHandle SHPOpen( const char * pszShapeFile, const char * pszAccess );
 <h2>SHPGetInfo()</h2>
 
 <pre>
-void SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
+void SHPGetInfo( const SHPHandle hSHP, int * pnEntities, int * pnShapeType,
                  double * padfMinBound, double * padfMaxBound );
 
   hSHP:			The handle previously returned by SHPOpen()
@@ -143,7 +146,7 @@ void SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
 <h2>SHPReadObject()</h2>
 
 <pre>
-SHPObject *SHPReadObject( SHPHandle hSHP, int iShape );
+SHPObject *SHPReadObject( const SHPHandle hSHP, int iShape );
 
   hSHP:			The handle previously returned by SHPOpen()
 			or SHPCreate().
@@ -210,7 +213,8 @@ SHPHandle SHPCreate( const char * pszShapeFile, int nShapeType );
 <pre>
 SHPObject *
      SHPCreateSimpleObject( int nSHPType, int nVertices,
-			    double *padfX, double * padfY, double *padfZ, );
+			    const double *padfX, const double * padfY,
+			    const double *padfZ );
 
   nSHPType:		The SHPT_ type of the object to be created, such
                         as SHPT_POINT, or SHPT_POLYGON.
@@ -250,9 +254,10 @@ SHPObject *
 <pre>
 SHPObject *
      SHPCreateObject( int nSHPType, int iShape,
-                      int nParts, int * panPartStart, int * panPartType,
-                      int nVertices, double *padfX, double * padfY,
-                      double *padfZ, double *padfM );
+                      int nParts, const int * panPartStart,
+                      const int * panPartType,
+                      int nVertices, const double *padfX, const double * padfY,
+                      const double *padfZ, const double *padfM );
 
   nSHPType:		The SHPT_ type of the object to be created, such
                         as SHPT_POINT, or SHPT_POLYGON.
@@ -321,7 +326,7 @@ void SHPComputeExtents( SHPObject * psObject );
 <h2>SHPWriteObject()</h2>
 
 <pre>
-int SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject *psObject );
+int SHPWriteObject( SHPHandle hSHP, int iShape, const SHPObject *psObject );
 
   hSHP:			The handle previously returned by SHPOpen("r+")
 			or SHPCreate().



View it on GitLab: https://salsa.debian.org/debian-gis-team/shapelib/-/commit/4724428d3911828d53a98fdcb0bf96f830d5c03b

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/shapelib/-/commit/4724428d3911828d53a98fdcb0bf96f830d5c03b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240814/fe727f35/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list