Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83786 - in trunk/boost/geometry: algorithms algorithms/detail algorithms/detail/overlay geometries io/wkt strategies strategies/transform views
From: barend.gehrels_at_[hidden]
Date: 2013-04-06 18:46:56


Author: barendgehrels
Date: 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
New Revision: 83786
URL: http://svn.boost.org/trac/boost/changeset/83786

Log:
[geometry] Tickets #8403 and #8405 -> silenced various warnings using MSVC /W4.
We have to use the #pragma's to not destroy the sources.
Text files modified:
   trunk/boost/geometry/algorithms/convert.hpp | 12 +++++++++++-
   trunk/boost/geometry/algorithms/correct.hpp | 11 ++++++++++-
   trunk/boost/geometry/algorithms/detail/assign_box_corners.hpp | 10 ++++++++++
   trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 11 +++++++++++
   trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp | 9 +++++++++
   trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp | 11 +++++++++++
   trunk/boost/geometry/algorithms/num_points.hpp | 15 ++++++++++++---
   trunk/boost/geometry/geometries/point.hpp | 10 ++++++++++
   trunk/boost/geometry/io/wkt/read.hpp | 11 +++++++++++
   trunk/boost/geometry/io/wkt/write.hpp | 10 ++++++++++
   trunk/boost/geometry/strategies/side_info.hpp | 8 ++++++++
   trunk/boost/geometry/strategies/transform/map_transformer.hpp | 10 +++++++++-
   trunk/boost/geometry/views/closeable_view.hpp | 9 +++++++++
   trunk/boost/geometry/views/identity_view.hpp | 8 ++++++++
   14 files changed, 139 insertions(+), 6 deletions(-)

Modified: trunk/boost/geometry/algorithms/convert.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/convert.hpp (original)
+++ trunk/boost/geometry/algorithms/convert.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -48,6 +48,14 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+// Silence warning C4512: assignment operator could not be generated
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127 4512)
+#endif
+
+
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace conversion
 {
@@ -444,8 +452,10 @@
     dispatch::devarianted_convert<Geometry1, Geometry2>::apply(geometry1, geometry2);
 }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP

Modified: trunk/boost/geometry/algorithms/correct.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/correct.hpp (original)
+++ trunk/boost/geometry/algorithms/correct.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -40,6 +40,12 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace correct
 {
@@ -131,7 +137,7 @@
         {
             // 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))
             {
@@ -256,6 +262,9 @@
     dispatch::correct<Geometry>::apply(geometry);
 }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 

Modified: trunk/boost/geometry/algorithms/detail/assign_box_corners.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/assign_box_corners.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/assign_box_corners.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -67,6 +67,13 @@
             <max_corner, max_corner>(box, upper_right);
 }
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
+
 template <bool Reverse, typename Box, typename Range>
 inline void assign_box_corners_oriented(Box const& box, Range& corners)
 {
@@ -81,6 +88,9 @@
         assign_box_corners(box, corners[0], corners[3], corners[1], corners[2]);
     }
 }
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 
 } // namespace detail

Modified: trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -20,6 +20,13 @@
 #include <boost/geometry/geometries/segment.hpp>
 
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
+
 namespace boost { namespace geometry
 {
 
@@ -1108,4 +1115,8 @@
 }} // namespace boost::geometry
 
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_HPP

Modified: trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -64,6 +64,12 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
 
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace get_turns
@@ -875,6 +881,9 @@
             turns, interrupt_policy);
 }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 

Modified: trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -110,6 +110,12 @@
 
     typedef ring_properties<typename geometry::point_type<Geometry1>::type> properties;
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
     // Union: return either of them
     // Intersection: return nothing
     // Difference: return first of them
@@ -120,6 +126,11 @@
         return out;
     }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
+
     std::map<ring_identifier, int> empty;
     std::map<ring_identifier, properties> all_of_one_of_them;
 

Modified: trunk/boost/geometry/algorithms/num_points.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/num_points.hpp (original)
+++ trunk/boost/geometry/algorithms/num_points.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -35,6 +35,13 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
+
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace num_points
 {
@@ -48,9 +55,7 @@
         std::size_t n = boost::size(range);
         if (add_for_open && n > 0)
         {
- closure_selector /*const*/ s = geometry::closure<Range>::value;
-
- if (s == open)
+ if (geometry::closure<Range>::value == open)
             {
                 if (geometry::disjoint(*boost::begin(range), *(boost::begin(range) + n - 1)))
                 {
@@ -197,6 +202,10 @@
     return dispatch::devarianted_num_points<Geometry>::apply(geometry, add_for_open);
 }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
 }} // namespace boost::geometry
 
 

Modified: trunk/boost/geometry/geometries/point.hpp
==============================================================================
--- trunk/boost/geometry/geometries/point.hpp (original)
+++ trunk/boost/geometry/geometries/point.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -28,6 +28,12 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
 
 namespace model
 {
@@ -173,6 +179,10 @@
 } // namespace traits
 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
 }} // namespace boost::geometry
 
 #endif // BOOST_GEOMETRY_GEOMETRIES_POINT_HPP

Modified: trunk/boost/geometry/io/wkt/read.hpp
==============================================================================
--- trunk/boost/geometry/io/wkt/read.hpp (original)
+++ trunk/boost/geometry/io/wkt/read.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -423,10 +423,21 @@
 
         handle_empty_z_m(it, tokens.end(), has_empty, has_z, has_m);
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
         if (has_z && dimension<Geometry>::type::value < 3)
         {
             throw read_wkt_exception("Z only allowed for 3 or more dimensions", wkt);
         }
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
         if (has_empty)
         {
             check_end(it, tokens.end(), wkt);

Modified: trunk/boost/geometry/io/wkt/write.hpp
==============================================================================
--- trunk/boost/geometry/io/wkt/write.hpp (original)
+++ trunk/boost/geometry/io/wkt/write.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -40,6 +40,12 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4512: 'boost::geometry::wkt_manipulator<Geometry>' : assignment operator could not be generated
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4512)
+#endif
+
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace wkt
 {
@@ -406,6 +412,10 @@
     return wkt_manipulator<Geometry>(geometry);
 }
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
 }} // namespace boost::geometry
 
 #endif // BOOST_GEOMETRY_IO_WKT_WRITE_HPP

Modified: trunk/boost/geometry/strategies/side_info.hpp
==============================================================================
--- trunk/boost/geometry/strategies/side_info.hpp (original)
+++ trunk/boost/geometry/strategies/side_info.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -21,6 +21,11 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
 
 /*!
 \brief Class side_info: small class wrapping for sides (-1,0,1)
@@ -159,6 +164,9 @@
 
 };
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 

Modified: trunk/boost/geometry/strategies/transform/map_transformer.hpp
==============================================================================
--- trunk/boost/geometry/strategies/transform/map_transformer.hpp (original)
+++ trunk/boost/geometry/strategies/transform/map_transformer.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -19,10 +19,15 @@
 
 #include <boost/geometry/strategies/transform/matrix_transformers.hpp>
 
-
 namespace boost { namespace geometry
 {
 
+// Silence warning C4127: conditional expression is constant
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4127)
+#endif
+
 namespace strategy { namespace transform
 {
 
@@ -158,6 +163,9 @@
 
 }} // namespace strategy::transform
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 

Modified: trunk/boost/geometry/views/closeable_view.hpp
==============================================================================
--- trunk/boost/geometry/views/closeable_view.hpp (original)
+++ trunk/boost/geometry/views/closeable_view.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -28,6 +28,12 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4512: assignment operator could not be generated
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4512)
+#endif
+
 #ifndef DOXYGEN_NO_DETAIL
 
 namespace detail
@@ -93,6 +99,9 @@
 #endif // DOXYGEN_NO_SPECIALIZATIONS
 
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 

Modified: trunk/boost/geometry/views/identity_view.hpp
==============================================================================
--- trunk/boost/geometry/views/identity_view.hpp (original)
+++ trunk/boost/geometry/views/identity_view.hpp 2013-04-06 18:46:54 EDT (Sat, 06 Apr 2013)
@@ -21,6 +21,11 @@
 namespace boost { namespace geometry
 {
 
+// Silence warning C4512: assignment operator could not be generated
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4512)
+#endif
 
 /*!
 \brief View on a range, not modifying anything
@@ -46,6 +51,9 @@
     Range& m_range;
 };
 
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 }} // namespace boost::geometry
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk