summaryrefslogtreecommitdiff
blob: fddcb9f6df88a65d2cde3045f44fcdd023265932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
diff --git a/include/gis.h b/include/gis.h
index 46bb06c52f..333651b938 100644
--- a/include/gis.h
+++ b/include/gis.h
@@ -23,6 +23,8 @@
 /* System include files */
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdbool.h>
+
 
 /* Grass and local include files */
 #include <grass/config.h>
@@ -51,13 +53,14 @@ static const char *GRASS_copyright __attribute__ ((unused))
 #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
 #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
 
-/* Define TRUE and FALSE for boolean comparisons */
+/* For boolean values and comparisons use the C99 type 'bool' with values 'true' */
+/* and 'false' For historical reasons 'TRUE' and 'FALSE' are still valid.        */
 #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) || (__APPLE__ && __LP64__)
diff --git a/lib/lidar/lidar.h b/lib/lidar/lidar.h
index 89a25de3bf..978894ea74 100644
--- a/lib/lidar/lidar.h
+++ b/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/raster/r.param.scale/param.h b/raster/r.param.scale/param.h
index 9c1dab4e81..2512fedaa2 100644
--- a/raster/r.param.scale/param.h
+++ b/raster/r.param.scale/param.h
@@ -18,8 +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/raster/r.surf.idw/main.h b/raster/r.surf.idw/main.h
index 33164f43cb..47028e7444 100644
--- a/raster/r.surf.idw/main.h
+++ b/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/raster3d/r3.showdspf/Ball.c b/raster3d/r3.showdspf/Ball.c
index fb3b79882f..ae3ec3933a 100644
--- a/raster3d/r3.showdspf/Ball.c
+++ b/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/raster3d/r3.showdspf/togif.c b/raster3d/r3.showdspf/togif.c
index 589f243a8d..b48236b33f 100644
--- a/raster3d/r3.showdspf/togif.c
+++ b/raster3d/r3.showdspf/togif.c
@@ -324,9 +324,6 @@ static int ditherrow(unsigned short *r, unsigned short *g, unsigned short *b,
  *
  *****************************************************************************/
 
-#define TRUE 1
-#define FALSE 0
-
 
 /************************** BumpPixel() ********************************/
 /*
diff --git a/vector/v.hull/chull.c b/vector/v.hull/chull.c
index 1ad97396fa..584af5d8ba 100644
--- a/vector/v.hull/chull.c
+++ b/vector/v.hull/chull.c
@@ -29,10 +29,6 @@
 
 #include "globals.h"
 
-/*Define Boolean type */
-typedef enum
-{ BFALSE, BTRUE } bool;
-
 /* Define vertex indices. */
 #define X   0
 #define Y   1
@@ -76,10 +72,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 +432,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 +442,7 @@ bool AddOne(tVertex p)
 
 	if (vol < 0) {
 	    f->visible = VISIBLE;
-	    vis = BTRUE;
+	    vis = true;
 	}
 	f = f->next;
     } while (f != faces);
@@ -454,7 +450,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 +466,7 @@ bool AddOne(tVertex p)
 	    e->newface = MakeConeFace(e, p);
 	e = temp;
     } while (e != edges);
-    return BTRUE;
+    return true;
 }
 
 /*---------------------------------------------------------------------