git: d322c20cf5c9 - 2021Q3 - databases/grass7: unbreak after gdal 3.3 update

Loïc Bartoletti lbartoletti at FreeBSD.org
Tue Jul 20 06:33:41 UTC 2021


The branch 2021Q3 has been updated by lbartoletti:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d322c20cf5c964522a9159f5db8d073e8d86d721

commit d322c20cf5c964522a9159f5db8d073e8d86d721
Author:     Loïc Bartoletti <lbartoletti at FreeBSD.org>
AuthorDate: 2021-07-04 16:08:38 +0000
Commit:     Loïc Bartoletti <lbartoletti at FreeBSD.org>
CommitDate: 2021-07-20 06:15:15 +0000

    databases/grass7: unbreak after gdal 3.3 update
    
    GDAL 3.3.0 introduces the use of standard C bool type.
    Redefining bool locally, as in vector/v.hull/chull.c causes failure.
    
    Obtained from:  https://github.com/OSGeo/grass/pull/1567
    
    (cherry picked from commit 562f7a0402ea5aa193f618ed6da3775a631f249a)
---
 databases/grass7/files/patch-include_gis.h         | 24 ++++++++
 databases/grass7/files/patch-lib_lidar_lidar.h     | 12 ++++
 .../grass7/files/patch-raster3d_r3.showdspf_Ball.c | 11 ++++
 .../files/patch-raster3d_r3.showdspf_togif.c       | 12 ++++
 .../files/patch-raster_r.param.scale_param.h       | 12 ++++
 .../grass7/files/patch-raster_r.surf.idw_main.h    | 11 ++++
 databases/grass7/files/patch-vector_v.hull_chull.c | 72 ++++++++++++++++++++++
 7 files changed, 154 insertions(+)

diff --git a/databases/grass7/files/patch-include_gis.h b/databases/grass7/files/patch-include_gis.h
new file mode 100644
index 000000000000..636a03516418
--- /dev/null
+++ b/databases/grass7/files/patch-include_gis.h
@@ -0,0 +1,24 @@
+--- include/gis.h.orig	2021-07-04 15:25:28 UTC
++++ include/gis.h
+@@ -23,6 +23,7 @@
+ /* System include files */
+ #include <stdio.h>
+ #include <stdarg.h>
++#include <stdbool.h>
+ 
+ /* Grass and local include files */
+ #include <grass/config.h>
+@@ -53,11 +54,11 @@ static const char *GRASS_copyright __attribute__ ((unu
+ 
+ /* Define TRUE and FALSE for boolean comparisons */
+ #ifndef TRUE
+-#define TRUE 1
++#define TRUE true
+ #endif
+ 
+ #ifndef FALSE
+-#define FALSE 0
++#define FALSE false
+ #endif
+ 
+ #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
diff --git a/databases/grass7/files/patch-lib_lidar_lidar.h b/databases/grass7/files/patch-lib_lidar_lidar.h
new file mode 100644
index 000000000000..c7273df39c5c
--- /dev/null
+++ b/databases/grass7/files/patch-lib_lidar_lidar.h
@@ -0,0 +1,12 @@
+--- lib/lidar/lidar.h.orig	2021-07-04 15:30:31 UTC
++++ lib/lidar/lidar.h
+@@ -62,9 +62,6 @@
+     /* INTERPOLATOR */
+ #define P_BILINEAR 		1
+ #define P_BICUBIC 		0
+-    /* Boolean definitions */
+-#define TRUE 			1
+-#define FALSE 			0
+ 
+ /*----------------------------------------------------------------------------------------------------------*/
+     /*STRUCTS DECLARATION */
diff --git a/databases/grass7/files/patch-raster3d_r3.showdspf_Ball.c b/databases/grass7/files/patch-raster3d_r3.showdspf_Ball.c
new file mode 100644
index 000000000000..222cb30d38b3
--- /dev/null
+++ b/databases/grass7/files/patch-raster3d_r3.showdspf_Ball.c
@@ -0,0 +1,11 @@
+--- raster3d/r3.showdspf/Ball.c.orig	2021-07-04 15:32:42 UTC
++++ raster3d/r3.showdspf/Ball.c
+@@ -7,8 +7,6 @@
+ #include "Ball.h"
+ #include "BallMath.h"
+ #include <stdio.h>
+-#define TRUE 1
+-#define FALSE 0
+ 
+ HMatrix mId = { {1, 0, 0, 0}
+ , {0, 1, 0, 0}
diff --git a/databases/grass7/files/patch-raster3d_r3.showdspf_togif.c b/databases/grass7/files/patch-raster3d_r3.showdspf_togif.c
new file mode 100644
index 000000000000..fd625bb0d9b4
--- /dev/null
+++ b/databases/grass7/files/patch-raster3d_r3.showdspf_togif.c
@@ -0,0 +1,12 @@
+--- raster3d/r3.showdspf/togif.c.orig	2021-07-04 15:33:18 UTC
++++ raster3d/r3.showdspf/togif.c
+@@ -324,9 +324,6 @@ static int ditherrow(unsigned short *r, unsigned short
+  *
+  *****************************************************************************/
+ 
+-#define TRUE 1
+-#define FALSE 0
+-
+ 
+ /************************** BumpPixel() ********************************/
+ /*
diff --git a/databases/grass7/files/patch-raster_r.param.scale_param.h b/databases/grass7/files/patch-raster_r.param.scale_param.h
new file mode 100644
index 000000000000..b05811d6eb20
--- /dev/null
+++ b/databases/grass7/files/patch-raster_r.param.scale_param.h
@@ -0,0 +1,12 @@
+--- raster/r.param.scale/param.h.orig	2021-07-04 15:31:09 UTC
++++ raster/r.param.scale/param.h
+@@ -18,9 +18,6 @@
+ 				/* 'blank' edge around raster.          */
+ #define MAX_WSIZE 499		/* Maximum dimensions of window.        */
+ 				/* Some useful labels.                  */
+-#define TRUE 1
+-#define FALSE 0
+-
+ #define RAD2DEG M_R2D
+ #define DEG2RAD M_D2R
+ 
diff --git a/databases/grass7/files/patch-raster_r.surf.idw_main.h b/databases/grass7/files/patch-raster_r.surf.idw_main.h
new file mode 100644
index 000000000000..0b3e29895afd
--- /dev/null
+++ b/databases/grass7/files/patch-raster_r.surf.idw_main.h
@@ -0,0 +1,11 @@
+--- raster/r.surf.idw/main.h.orig	2021-07-04 15:31:52 UTC
++++ raster/r.surf.idw/main.h
+@@ -1,8 +1,6 @@
+ #include <grass/raster.h>
+ 
+ #define         SHORT           short
+-#define         TRUE    1
+-#define         FALSE   0
+ 
+ #define MELEMENT        struct Melement
+ MELEMENT {
diff --git a/databases/grass7/files/patch-vector_v.hull_chull.c b/databases/grass7/files/patch-vector_v.hull_chull.c
new file mode 100644
index 000000000000..a89e4f3228f8
--- /dev/null
+++ b/databases/grass7/files/patch-vector_v.hull_chull.c
@@ -0,0 +1,72 @@
+--- vector/v.hull/chull.c.orig	2021-07-04 15:27:24 UTC
++++ vector/v.hull/chull.c
+@@ -22,6 +22,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
++#include <stdbool.h>
+ 
+ #include <grass/gis.h>
+ #include <grass/vector.h>
+@@ -29,10 +30,6 @@
+ 
+ #include "globals.h"
+ 
+-/*Define Boolean type */
+-typedef enum
+-{ BFALSE, BTRUE } bool;
+-
+ /* Define vertex indices. */
+ #define X   0
+ #define Y   1
+@@ -76,10 +73,10 @@ struct tFaceStructure
+ };
+ 
+ /* Define flags */
+-#define ONHULL   	BTRUE
+-#define REMOVED  	BTRUE
+-#define VISIBLE  	BTRUE
+-#define PROCESSED	BTRUE
++#define ONHULL   	true
++#define REMOVED  	true
++#define VISIBLE  	true
++#define PROCESSED	true
+ 
+ /* Global variable definitions */
+ tVertex vertices = NULL;
+@@ -436,7 +433,7 @@ bool AddOne(tVertex p)
+     tFace f;
+     tEdge e, temp;
+     long int vol;
+-    bool vis = BFALSE;
++    bool vis = false;
+ 
+ 
+     /* Mark faces visible from p. */
+@@ -446,7 +443,7 @@ bool AddOne(tVertex p)
+ 
+ 	if (vol < 0) {
+ 	    f->visible = VISIBLE;
+-	    vis = BTRUE;
++	    vis = true;
+ 	}
+ 	f = f->next;
+     } while (f != faces);
+@@ -454,7 +451,7 @@ bool AddOne(tVertex p)
+     /* If no faces are visible from p, then p is inside the hull. */
+     if (!vis) {
+ 	p->onhull = !ONHULL;
+-	return BFALSE;
++	return false;
+     }
+ 
+     /* Mark edges in interior of visible region for deletion.
+@@ -470,7 +467,7 @@ bool AddOne(tVertex p)
+ 	    e->newface = MakeConeFace(e, p);
+ 	e = temp;
+     } while (e != edges);
+-    return BTRUE;
++    return true;
+ }
+ 
+ /*---------------------------------------------------------------------


More information about the dev-commits-ports-branches mailing list