Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56053 - in sandbox/itl: boost/itl boost/itl_xt libs/itl/example/man_power_ libs/itl/test libs/validate/example/labat_polygon_
From: afojgo_at_[hidden]
Date: 2009-09-05 11:18:13


Author: jofaber
Date: 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
New Revision: 56053
URL: http://svn.boost.org/trac/boost/changeset/56053

Log:
Portability: Adjustments for msvc-8. Stable {msvc-9.0r+d, 8.0r; gcc-3.4.4r}
Text files modified:
   sandbox/itl/boost/itl/interval.hpp | 18 ++++++++++++++----
   sandbox/itl/boost/itl/rational.hpp | 4 ++++
   sandbox/itl/boost/itl_xt/numbergentor.hpp | 33 ++++++---------------------------
   sandbox/itl/libs/itl/example/man_power_/man_power.cpp | 3 ++-
   sandbox/itl/libs/itl/test/test_type_lists.hpp | 17 +++++++++++------
   sandbox/itl/libs/validate/example/labat_polygon_/labat_polygon.cpp | 2 +-
   6 files changed, 38 insertions(+), 39 deletions(-)

Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -30,9 +30,6 @@
 #include <boost/itl/type_traits/value_size.hpp>
 #include <boost/itl/type_traits/to_string.hpp>
 
-//#undef min
-//#undef max
-
 #define BOUND_VALUE first
 #define BOUND_TYPES second
 
@@ -897,8 +894,21 @@
     return is_right(closed_bounded) ? _upb : pred(_upb);
 }
 
+//------------------------------------------------------------------------------
+// There is an error C2244 under msvc-8 with memeber function
+// size_type interval::cardinality()const.
+// It seems that the compiler is unable to substitute
+//
+// typename interval<DomainT,Compare>::size_type
+// by
+// typename itl::size<DomainT>::type
+//
+// If msvc-8 is not supported any more result type
+// typename itl::size<DomainT>::type can be rplaced with the more systematic
+// typename interval<DomainT,Compare>::size_type
+
 template <class DomainT, ITL_COMPARE Compare>
-inline typename interval<DomainT,Compare>::size_type interval<DomainT,Compare>::cardinality()const
+inline typename itl::size<DomainT>::type interval<DomainT,Compare>::cardinality()const
 {
     using namespace boost::mpl;
     return if_<

Modified: sandbox/itl/boost/itl/rational.hpp
==============================================================================
--- sandbox/itl/boost/itl/rational.hpp (original)
+++ sandbox/itl/boost/itl/rational.hpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -13,6 +13,10 @@
 #ifndef __itl_rational_JOFA_080913_H__
 #define __itl_rational_JOFA_080913_H__
 
+#if defined(_MSC_VER)
+#pragma warning( disable : 4800 ) //warning C4800: 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning)
+#endif
+
 #include <boost/rational.hpp>
 
 #define ITL_NEEDS_RATIONAL_IS_CONTINUOUS

Modified: sandbox/itl/boost/itl_xt/numbergentor.hpp
==============================================================================
--- sandbox/itl/boost/itl_xt/numbergentor.hpp (original)
+++ sandbox/itl/boost/itl_xt/numbergentor.hpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -1,37 +1,16 @@
 /*-----------------------------------------------------------------------------+
 Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
 +------------------------------------------------------------------------------+
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
 +-----------------------------------------------------------------------------*/
-/* ------------------------------------------------------------------
-class NumberGentorT
- A random generator for numbers
---------------------------------------------------------------------*/
 #ifndef __NUMBERGENTORT_H_JOFA_000725__
 #define __NUMBERGENTORT_H_JOFA_000725__
 
+#if defined(_MSC_VER)
+#pragma warning( disable : 4244 ) //warning C4244: 'argument' : conversion from 'T1' to 'T2', possible loss of data
+#endif
 
 #include <stdlib.h>
 #include <vector>

Modified: sandbox/itl/libs/itl/example/man_power_/man_power.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/man_power_/man_power.cpp (original)
+++ sandbox/itl/libs/itl/example/man_power_/man_power.cpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -184,4 +184,5 @@
 2008-Oct-20 - 2008-Oct-24 -> 12
 2008-Oct-27 - 2008-Oct-31 -> 12
 */
-//]
\ No newline at end of file
+//]
+

Modified: sandbox/itl/libs/itl/test/test_type_lists.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_type_lists.hpp (original)
+++ sandbox/itl/libs/itl/test/test_type_lists.hpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -17,13 +17,18 @@
 
 #include <boost/itl/interval.hpp>
 
+#if(_MSC_VER < 1500 && defined(_DEBUG) ) // 1500 = MSVC-9.0
+typedef int boost_posix_time_ptime;
+#else
+typedef boost::posix_time::ptime boost_posix_time_ptime;
+#endif
 
 typedef ::boost::mpl::list<
     unsigned short, unsigned int, unsigned long
     ,short, int, long
     ,float, double
     ,boost::rational<int>
- ,boost::posix_time::ptime
+ ,boost_posix_time_ptime
 // ,boost::gregorian::date
> bicremental_types;
 
@@ -31,7 +36,7 @@
 typedef int bicremental_type_2;
 typedef double bicremental_type_3;
 typedef boost::rational<int> bicremental_type_4;
-typedef boost::posix_time::ptime bicremental_type_5;
+typedef boost_posix_time_ptime bicremental_type_5;
 typedef unsigned short bicremental_type_6;
 typedef short bicremental_type_7;
 typedef float bicremental_type_8;
@@ -64,12 +69,12 @@
 typedef ::boost::mpl::list<
     unsigned short, unsigned int, unsigned long
     ,short, int, long
- ,boost::posix_time::ptime
+ ,boost_posix_time_ptime
 // ,boost::gregorian::date
> discrete_types;
 
 typedef int discrete_type_1;
-typedef boost::posix_time::ptime discrete_type_2;
+typedef boost_posix_time_ptime discrete_type_2;
 typedef unsigned int discrete_type_3;
 typedef short discrete_type_4;
 typedef unsigned int discrete_type_5;
@@ -91,13 +96,13 @@
     ,float, double
     ,boost::rational<int>
     ,std::string
- ,boost::posix_time::ptime
+ ,boost_posix_time_ptime
 // ,boost::gregorian::date
> ordered_types;
 
 typedef int ordered_type_1;
 typedef std::string ordered_type_2;
-typedef boost::posix_time::ptime ordered_type_3;
+typedef boost_posix_time_ptime ordered_type_3;
 typedef boost::rational<int> ordered_type_4;
 typedef double ordered_type_5;
 

Modified: sandbox/itl/libs/validate/example/labat_polygon_/labat_polygon.cpp
==============================================================================
--- sandbox/itl/libs/validate/example/labat_polygon_/labat_polygon.cpp (original)
+++ sandbox/itl/libs/validate/example/labat_polygon_/labat_polygon.cpp 2009-09-05 11:18:12 EDT (Sat, 05 Sep 2009)
@@ -6,7 +6,7 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +-----------------------------------------------------------------------------*/
-#pragma warning( disable : 4800 )
+#pragma warning( disable : 4800 ) //'int' : forcing value to bool 'true' or 'false' (performance warning)
 #pragma warning( disable : 4244 ) //'argument' : conversion from 'T1' to 'T2', possible loss of data
 
 #include <boost/polygon/polygon.hpp>


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