gdal-3.3.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From b86314c7f3b8aea961d380dbb836087b3990d7af Mon Sep 17 00:00:00 2001
  2. From: nilason <n_larsson@yahoo.com>
  3. Date: Thu, 6 May 2021 22:27:48 +0200
  4. Subject: [PATCH] v.hull: use standard C boolean type
  5. Fixes #1563
  6. ---
  7. vector/v.hull/chull.c | 21 +++++++++------------
  8. 1 file changed, 9 insertions(+), 12 deletions(-)
  9. diff --git a/vector/v.hull/chull.c b/vector/v.hull/chull.c
  10. index 1ad97396fa..41b627c50f 100644
  11. --- a/vector/v.hull/chull.c
  12. +++ b/vector/v.hull/chull.c
  13. @@ -22,6 +22,7 @@
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <math.h>
  17. +#include <stdbool.h>
  18. #include <grass/gis.h>
  19. #include <grass/vector.h>
  20. @@ -29,10 +30,6 @@
  21. #include "globals.h"
  22. -/*Define Boolean type */
  23. -typedef enum
  24. -{ BFALSE, BTRUE } bool;
  25. -
  26. /* Define vertex indices. */
  27. #define X 0
  28. #define Y 1
  29. @@ -76,10 +73,10 @@ struct tFaceStructure
  30. };
  31. /* Define flags */
  32. -#define ONHULL BTRUE
  33. -#define REMOVED BTRUE
  34. -#define VISIBLE BTRUE
  35. -#define PROCESSED BTRUE
  36. +#define ONHULL true
  37. +#define REMOVED true
  38. +#define VISIBLE true
  39. +#define PROCESSED true
  40. /* Global variable definitions */
  41. tVertex vertices = NULL;
  42. @@ -436,7 +433,7 @@ bool AddOne(tVertex p)
  43. tFace f;
  44. tEdge e, temp;
  45. long int vol;
  46. - bool vis = BFALSE;
  47. + bool vis = false;
  48. /* Mark faces visible from p. */
  49. @@ -446,7 +443,7 @@ bool AddOne(tVertex p)
  50. if (vol < 0) {
  51. f->visible = VISIBLE;
  52. - vis = BTRUE;
  53. + vis = true;
  54. }
  55. f = f->next;
  56. } while (f != faces);
  57. @@ -454,7 +451,7 @@ bool AddOne(tVertex p)
  58. /* If no faces are visible from p, then p is inside the hull. */
  59. if (!vis) {
  60. p->onhull = !ONHULL;
  61. - return BFALSE;
  62. + return false;
  63. }
  64. /* Mark edges in interior of visible region for deletion.
  65. @@ -470,7 +467,7 @@ bool AddOne(tVertex p)
  66. e->newface = MakeConeFace(e, p);
  67. e = temp;
  68. } while (e != edges);
  69. - return BTRUE;
  70. + return true;
  71. }
  72. /*---------------------------------------------------------------------