Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warning (-Wparentheses) #46

Merged
merged 1 commit into from
Sep 15, 2016
Merged

Conversation

brunoabinader
Copy link
Member

Captured this while building Mapbox GL native GLFW test application on Ubuntu 16.04 i686:

../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp: In constructor ‘mapbox::detail::Earcut<N>::ObjectPool<T, Alloc>::ObjectPool(std::size_t)’:
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:93:43: warning: declaration of ‘blockSize’ shadows a member of ‘mapbox::detail::Earcut<N>::ObjectPool<T, Alloc>’ [-Wshadow]
         ObjectPool(std::size_t blockSize) {
                                           ^
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:121:33: note: shadowed declaration is here
         std::size_t blockSize = 1;
                                 ^
In file included from ../../../src/mbgl/renderer/fill_bucket.cpp:11:0:
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp: In instantiation of ‘bool mapbox::detail::Earcut<N>::intersects(const mapbox::detail::Earcut<N>::Node*, const mapbox::detail::Earcut<N>::Node*, const mapbox::detail::Earcut<N>::Node*, const mapbox::detail::Earcut<N>::Node*) [with N = unsigned int]’:
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:373:40:   required from ‘mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::cureLocalIntersections(mapbox::detail::Earcut<N>::Node*) [with N = unsigned int]’
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:290:45:   required from ‘void mapbox::detail::Earcut<N>::earcutLinked(mapbox::detail::Earcut<N>::Node*, int) [with N = unsigned int]’
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:176:17:   required from ‘void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = mbgl::GeometryCollection; N = unsigned int]’
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:769:11:   required from ‘std::vector<_RealType> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = mbgl::GeometryCollection]’
../../../src/mbgl/renderer/fill_bucket.cpp:75:63:   required from here
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:669:33: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
     return area(p1, q1, p2) > 0 != area(p1, q1, q2) > 0 &&
                                 ^
../../../mason_packages/headers/earcut/0.11/include/mapbox/earcut.hpp:670:33: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
            area(p2, q2, p1) > 0 != area(p2, q2, q1) > 0;
                                 ^

Shadow declaration is fixed in e02a44d - this adds the parentheses fix.

/cc @mourner

@mourner mourner merged commit 8d353b4 into master Sep 15, 2016
@mourner mourner deleted the warning-parentheses branch September 15, 2016 15:47
@mourner mourner mentioned this pull request Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants