From 9b344cccc888416f718b0dbe0730bb0b2699c5c3 Mon Sep 17 00:00:00 2001 From: Grigory Kirillov Date: Thu, 16 Oct 2025 00:19:44 +0300 Subject: [PATCH] Fix some compilation warnings --- Source/geom.c | 2 +- Source/mesh.c | 2 ++ Source/priorityq.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/geom.c b/Source/geom.c index 886edcf..220cd27 100755 --- a/Source/geom.c +++ b/Source/geom.c @@ -197,7 +197,7 @@ double Interpolate( double a, double x, double b, double y) #endif -#define Swap(a,b) if (1) { TESSvertex *t = a; a = b; b = t; } else +#define Swap(a,b) do { TESSvertex *t = a; a = b; b = t; } while (0) void tesedgeIntersect( TESSvertex *o1, TESSvertex *d1, TESSvertex *o2, TESSvertex *d2, diff --git a/Source/mesh.c b/Source/mesh.c index 763feca..2ce746b 100755 --- a/Source/mesh.c +++ b/Source/mesh.c @@ -750,6 +750,8 @@ int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace ) void tessMeshFlipEdge( TESSmesh *mesh, TESShalfEdge *edge ) { + TESS_NOTUSED(mesh); + TESShalfEdge *a0 = edge; TESShalfEdge *a1 = a0->Lnext; TESShalfEdge *a2 = a1->Lnext; diff --git a/Source/priorityq.c b/Source/priorityq.c index 62a6654..02a6988 100755 --- a/Source/priorityq.c +++ b/Source/priorityq.c @@ -334,7 +334,7 @@ void pqDeletePriorityQ( TESSalloc* alloc, PriorityQ *pq ) #define LT(x,y) (! LEQ(y,x)) #define GT(x,y) (! LEQ(x,y)) -#define Swap(a,b) if(1){PQkey *tmp = *a; *a = *b; *b = tmp;}else +#define Swap(a,b) do { PQkey *tmp = *a; *a = *b; *b = tmp; } while (0) /* really tessPqSortInit */ int pqInit( TESSalloc* alloc, PriorityQ *pq )