Skip to content

Commit

Permalink
Fix compiler warning (-Wparentheses)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Sep 15, 2016
1 parent 6623985 commit c823087
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
endif()
elseif(CXX_COMPILER_IS_GNU_OR_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP14_FLAG} -pipe -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP14_FLAG} -pipe -Werror -Wshadow -Wparentheses")
# optional: -pedantic -Wconversion -Wall -Wextra
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTIMIZATION_FLAGS}")
# optional: -march=native (builds with the optimizations available on the build machine (only for local use!))
Expand Down
4 changes: 2 additions & 2 deletions include/mapbox/earcut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ template <typename N>
bool Earcut<N>::intersects(const Node* p1, const Node* q1, const Node* p2, const Node* q2) {
if ((equals(p1, q1) && equals(p2, q2)) ||
(equals(p1, q2) && equals(p2, q1))) return true;
return area(p1, q1, p2) > 0 != area(p1, q1, q2) > 0 &&
area(p2, q2, p1) > 0 != area(p2, q2, q1) > 0;
return (area(p1, q1, p2) > 0) != (area(p1, q1, q2) > 0) &&
(area(p2, q2, p1) > 0) != (area(p2, q2, q1) > 0);
}

// check if a polygon diagonal intersects any polygon segments
Expand Down

0 comments on commit c823087

Please sign in to comment.