From 3cc284d9c1838d7a5679ef75003bb1be96f7a411 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 10 Jan 2015 21:21:29 -0300 Subject: [PATCH] poly2d (p2d_contains_point): use "bool" instead of "int" --- poly2d/p2d_contains_point.c | 6 ++++-- poly2d/poly2d.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/poly2d/p2d_contains_point.c b/poly2d/p2d_contains_point.c index d6bd8a3..1a1f24d 100644 --- a/poly2d/p2d_contains_point.c +++ b/poly2d/p2d_contains_point.c @@ -34,13 +34,15 @@ */ +#include + #include "poly2d.h" -int p2d_contains_point(const struct p2d *p, const struct v2d *v) +bool p2d_contains_point(const struct p2d *p, const struct v2d *v) { const struct v2d *j, *i; - int in = 0; + bool in = 0; j = p->v; do { diff --git a/poly2d/poly2d.h b/poly2d/poly2d.h index 023ec51..9cc8e9e 100644 --- a/poly2d/poly2d.h +++ b/poly2d/poly2d.h @@ -1,8 +1,8 @@ /* * poly2d.h - The public face of the 2D Polygon library * - * Written 2012, 2013 by Werner Almesberger - * Copyright 2012, 2013 Werner Almesberger + * Written 2012, 2013, 2015 by Werner Almesberger + * Copyright 2012, 2013, 2015 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,7 +147,7 @@ void p2d_free_all(struct p2d *p); * Returns non-zero if the point is inside or on the simple polygon. */ -int p2d_contains_point(const struct p2d *p, const struct v2d *v); +bool p2d_contains_point(const struct p2d *p, const struct v2d *v); /* * Returns: