[geometry] Ticket #8405 -> silenced various warnings using MSVC /W4

[SVN r83780]
This commit is contained in:
Barend Gehrels
2013-04-06 21:28:38 +00:00
parent b25aeb298a
commit 7fce3396e2
10 changed files with 31 additions and 14 deletions

View File

@@ -131,13 +131,13 @@ struct correct_ring
{
// check if closed, if not, close it
bool const disjoint = geometry::disjoint(*boost::begin(r), *(boost::end(r) - 1));
closure_selector const s = geometry::closure<Ring>::value;
closure_selector /*const*/ s = geometry::closure<Ring>::value;
if (disjoint && (s == closed))
{
geometry::append(r, *boost::begin(r));
}
if (! disjoint && geometry::closure<Ring>::value != closed)
if (! disjoint && s != closed)
{
// Open it by removing last point
geometry::traits::resize<Ring>::apply(r, boost::size(r) - 1);

View File

@@ -14,12 +14,11 @@
#include <map>
#include <boost/array.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
@@ -138,6 +137,11 @@ class get_turns_in_sections
// About first condition: will be optimized by compiler (static)
// It checks if it is areal (box,ring,(multi)polygon
int const n = int(section.range_count);
boost::ignore_unused_variable_warning(n);
boost::ignore_unused_variable_warning(index1);
boost::ignore_unused_variable_warning(index2);
return boost::is_same
<
typename tag_cast
@@ -162,6 +166,8 @@ public :
Turns& turns,
InterruptPolicy& interrupt_policy)
{
boost::ignore_unused_variable_warning(interrupt_policy);
cview_type1 cview1(range_by_section(geometry1, sec1));
cview_type2 cview2(range_by_section(geometry2, sec2));
view_type1 view1(cview1);
@@ -599,6 +605,8 @@ private:
Turns& turns,
InterruptPolicy& interrupt_policy)
{
boost::ignore_unused_variable_warning(interrupt_policy);
// Depending on code some relations can be left out
typedef typename boost::range_value<Turns>::type turn_info;

View File

@@ -15,6 +15,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DISTANCE_HPP
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
@@ -55,6 +56,7 @@ struct point_to_point
static inline typename return_type<Strategy>::type apply(P1 const& p1,
P2 const& p2, Strategy const& strategy)
{
boost::ignore_unused_variable_warning(strategy);
return strategy.apply(p1, p2);
}
};

View File

@@ -16,6 +16,7 @@
#include <iterator>
#include <boost/concept_check.hpp>
#include <boost/range.hpp>
#include <boost/mpl/fold.hpp>
@@ -84,6 +85,7 @@ struct range_length
static inline return_type apply(
Range const& range, Strategy const& strategy)
{
boost::ignore_unused_variable_warning(strategy);
typedef typename closeable_view<Range const, Closure>::type view_type;
typedef typename boost::range_iterator
<

View File

@@ -48,7 +48,7 @@ struct range_count
std::size_t n = boost::size(range);
if (add_for_open && n > 0)
{
closure_selector const s = geometry::closure<Range>::value;
closure_selector /*const*/ s = geometry::closure<Range>::value;
if (s == open)
{

View File

@@ -17,6 +17,7 @@
#include <cstddef>
#include <boost/concept_check.hpp>
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
@@ -65,6 +66,7 @@ struct point_in_ring
static inline int apply(Point const& point, Ring const& ring,
Strategy const& strategy)
{
boost::ignore_unused_variable_warning(strategy);
if (int(boost::size(ring))
< core_detail::closure::minimum_ring_size<Closure>::value)
{
@@ -180,6 +182,7 @@ struct within<Point, Box, point_tag, box_tag>
template <typename Strategy>
static inline bool apply(Point const& point, Box const& box, Strategy const& strategy)
{
boost::ignore_unused_variable_warning(strategy);
return strategy.apply(point, box);
}
};
@@ -191,6 +194,7 @@ struct within<Box1, Box2, box_tag, box_tag>
static inline bool apply(Box1 const& box1, Box2 const& box2, Strategy const& strategy)
{
assert_dimension_equal<Box1, Box2>();
boost::ignore_unused_variable_warning(strategy);
return strategy.apply(box1, box2);
}
};

View File

@@ -57,7 +57,7 @@ struct svg_box
{
template <typename Char, typename Traits>
static inline void apply(std::basic_ostream<Char, Traits>& os,
Box const& box, std::string const& style, int size)
Box const& box, std::string const& style, int )
{
// Prevent invisible boxes, making them >=1, using "max"
BOOST_USING_STD_MAX();
@@ -86,7 +86,7 @@ struct svg_range
{
template <typename Char, typename Traits>
static inline void apply(std::basic_ostream<Char, Traits>& os,
Range const& range, std::string const& style, int size)
Range const& range, std::string const& style, int )
{
typedef typename boost::range_iterator<Range const>::type iterator;
@@ -114,7 +114,7 @@ struct svg_poly
{
template <typename Char, typename Traits>
static inline void apply(std::basic_ostream<Char, Traits>& os,
Polygon const& polygon, std::string const& style, int size)
Polygon const& polygon, std::string const& style, int )
{
typedef typename geometry::ring_type<Polygon>::type ring_type;
typedef typename boost::range_iterator<ring_type const>::type iterator_type;

View File

@@ -46,8 +46,8 @@ struct segments_intersection_points
static inline return_type segments_intersect(side_info const&,
R const& r,
coordinate_type const& dx1, coordinate_type const& dy1,
coordinate_type const& dx2, coordinate_type const& dy2,
S1 const& s1, S2 const& s2)
coordinate_type const& , coordinate_type const& ,
S1 const& s1, S2 const& )
{
typedef typename geometry::coordinate_type
<

View File

@@ -215,7 +215,7 @@ struct relate_cartesian_segments
return Policy::disjoint();
}
robustness_handle_meeting(a, b, sides, dx_a, dy_a, wx, wy, d, r);
//robustness_handle_meeting(a, b, sides, dx_a, dy_a, wx, wy, d, r);
if (robustness_verify_disjoint_at_one_collinear(a, b, sides))
{
@@ -295,7 +295,7 @@ private :
}
static inline void robustness_verify_collinear(
segment_type1 const& a, segment_type2 const& b,
segment_type1 const& , segment_type2 const& ,
bool a_is_point, bool b_is_point,
side_info& sides,
bool& collinear)
@@ -413,7 +413,7 @@ private :
return false;
}
/*
// If r is one, or zero, segments should meet and their endpoints.
// Robustness issue: check if this is really the case.
// It turns out to be no problem, see buffer test #rt_s1 (and there are many cases generated)
@@ -447,7 +447,7 @@ private :
}
}
}
*/
template <std::size_t Dimension>
static inline bool verify_disjoint(segment_type1 const& a,
segment_type2 const& b)

View File

@@ -162,6 +162,7 @@ public :
<
Strategy, Point, fp_point_type
>::apply(strategy);
boost::ignore_unused_variable_warning(fp_strategy);
fp_point_type projected;
geometry::convert(p1, projected);