On Tue, Jun 11, 2019 at 04:52:28PM -0700, g...@osgeo.org wrote:

[...]

> commit f378ac5348002ce611a360eaf59a8bb281ecfa7b
> Author: Daniel Baston <dbas...@gmail.com>
> Date:   Mon Jun 10 15:09:56 2019 -0400
> 
>     Avoid relying on numeric ordering of Location
> 

[...]

>  
> -        max_loc = std::max(max_loc, loc);
> -        if (max_loc == geom::Location::EXTERIOR) {
> -            found = true;
> +        if (outermost_loc == Location::UNDEF || outermost_loc == 
> Location::INTERIOR) {
> +            outermost_loc = loc;
> +        } else if (Location::EXTERIOR) {
> +            outermost_loc = loc;
> +            done = true;
>          }
>      }

The final "else if" condition will always be true (or false, depending
on the value of Location::EXTERIOR constant). I'm concerned that no
test failed with that bug in place, so if there's anything you can do
to trigger such bug it'd be great to add a test for it.

NOTE: my compiler (gcc 7.3.0) did catch it:

  .../src/geom/prep/PreparedPolygonPredicate.cpp:101:38: warning: enum constant 
in boolean context [-Wint-in-bool-context]
          } else if (Location::EXTERIOR) {
                     ^

--strk;

_______________________________________________
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to