poly2d (p2d_contains_point): use "bool" instead of "int"

This commit is contained in:
Werner Almesberger 2015-01-10 21:21:29 -03:00
parent cba417fc37
commit 3cc284d9c1
2 changed files with 7 additions and 5 deletions

View File

@ -34,13 +34,15 @@
*/
#include <stdbool.h>
#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 {

View File

@ -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: