From 1111d9b650405b6db5048a2a6a1e8569292f4b75 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 5 Jun 2021 19:29:48 -0700 Subject: [PATCH] use a stronger return type for INTERSECT --- lib/pathplan/visibility.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pathplan/visibility.c b/lib/pathplan/visibility.c index 8aec164aa..3ceaf6db6 100644 --- a/lib/pathplan/visibility.c +++ b/lib/pathplan/visibility.c @@ -98,7 +98,7 @@ static bool inBetween(Ppoint_t a, Ppoint_t b, Ppoint_t c) * Also note that we are computing w_abq twice in a tour of a polygon, * once for each edge of which it is a vertex. */ -static int intersect1(Ppoint_t a, Ppoint_t b, Ppoint_t q, Ppoint_t n, +static bool intersect1(Ppoint_t a, Ppoint_t b, Ppoint_t q, Ppoint_t n, Ppoint_t p) { int w_abq; @@ -128,7 +128,7 @@ static int intersect1(Ppoint_t a, Ppoint_t b, Ppoint_t q, Ppoint_t n, * More specifically, returns true iff c or d lies on (a,b) or the two * segments intersect as open sets. */ -static int intersect(Ppoint_t a, Ppoint_t b, Ppoint_t c, Ppoint_t d) +static bool intersect(Ppoint_t a, Ppoint_t b, Ppoint_t c, Ppoint_t d) { int a_abc; int a_abd; @@ -137,11 +137,11 @@ static int intersect(Ppoint_t a, Ppoint_t b, Ppoint_t c, Ppoint_t d) a_abc = wind(a, b, c); if (a_abc == 0 && inBetween(a, b, c)) { - return 1; + return true; } a_abd = wind(a, b, d); if (a_abd == 0 && inBetween(a, b, d)) { - return 1; + return true; } a_cda = wind(c, d, a); a_cdb = wind(c, d, b); -- 2.40.0