Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57853 - in trunk/boost/test: . impl utils/basic_cstring utils/runtime utils/runtime/cla utils/runtime/cla/iface utils/runtime/env
From: gennadiy.rozental_at_[hidden]
Date: 2009-11-22 21:24:01


Author: rogeeff
Date: 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
New Revision: 57853
URL: http://svn.boost.org/trac/boost/changeset/57853

Log:
Warnings cleanup.Fixes #2646. Fixes #3598.
Text files modified:
   trunk/boost/test/floating_point_comparison.hpp | 4 ++--
   trunk/boost/test/impl/debug.ipp | 2 +-
   trunk/boost/test/impl/execution_monitor.ipp | 11 +++++++++--
   trunk/boost/test/unit_test_log_formatter.hpp | 2 +-
   trunk/boost/test/utils/basic_cstring/basic_cstring.hpp | 2 +-
   trunk/boost/test/utils/runtime/argument.hpp | 14 +++++++-------
   trunk/boost/test/utils/runtime/cla/argument_factory.hpp | 26 +++++++++++++-------------
   trunk/boost/test/utils/runtime/cla/id_policy.hpp | 2 +-
   trunk/boost/test/utils/runtime/cla/iface/id_policy.hpp | 2 +-
   trunk/boost/test/utils/runtime/cla/parser.hpp | 6 +++---
   trunk/boost/test/utils/runtime/config.hpp | 9 +++++++++
   trunk/boost/test/utils/runtime/env/environment.ipp | 8 ++++++++
   12 files changed, 56 insertions(+), 32 deletions(-)

Modified: trunk/boost/test/floating_point_comparison.hpp
==============================================================================
--- trunk/boost/test/floating_point_comparison.hpp (original)
+++ trunk/boost/test/floating_point_comparison.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -54,9 +54,9 @@
 // FPT is Floating-Point Type: float, double, long double or User-Defined.
 template<typename FPT>
 inline FPT
-fpt_abs( FPT arg )
+fpt_abs( FPT fpv )
 {
- return arg < static_cast<FPT>(0) ? -arg : arg;
+ return fpv < static_cast<FPT>(0) ? -fpv : fpv;
 }
 
 //____________________________________________________________________________//

Modified: trunk/boost/test/impl/debug.ipp
==============================================================================
--- trunk/boost/test/impl/debug.ipp (original)
+++ trunk/boost/test/impl/debug.ipp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -23,7 +23,7 @@
 #include <boost/test/debug.hpp>
 #include <boost/test/debug_config.hpp>
 
-// Implementation in windows
+// Implementation on Windows
 #if defined(_WIN32) && !defined(UNDER_CE) && !defined(BOOST_DISABLE_WIN32) // ******* WIN32
 
 # define BOOST_WIN32_BASED_DEBUG

Modified: trunk/boost/test/impl/execution_monitor.ipp
==============================================================================
--- trunk/boost/test/impl/execution_monitor.ipp (original)
+++ trunk/boost/test/impl/execution_monitor.ipp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -788,7 +788,14 @@
         ::alarm( 0 );
 
 #ifdef BOOST_TEST_USE_ALT_STACK
- stack_t sigstk = {};
+#ifdef __GNUC__
+ // We shouldn't need to explicitly initialize all the members here,
+ // but gcc warns if we don't, so add initializers for each of the
+ // members specified in the POSIX std:
+ stack_t sigstk = { 0, 0, 0 };
+#else
+ stack_t sigstk = { };
+#endif
 
     sigstk.ss_size = MINSIGSTKSZ;
     sigstk.ss_flags = SS_DISABLE;
@@ -1127,7 +1134,7 @@
 execution_monitor::catch_signals( unit_test::callback0<int> const& F )
 {
     _invalid_parameter_handler old_iph = _invalid_parameter_handler();
- BOOST_TEST_CRT_HOOK_TYPE old_crt_hook;
+ BOOST_TEST_CRT_HOOK_TYPE old_crt_hook = 0;
 
     if( !p_catch_system_errors )
         _set_se_translator( &detail::seh_catch_preventer );

Modified: trunk/boost/test/unit_test_log_formatter.hpp
==============================================================================
--- trunk/boost/test/unit_test_log_formatter.hpp (original)
+++ trunk/boost/test/unit_test_log_formatter.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -103,7 +103,7 @@
         // for backward compatibility
         log_exception( os, cd, ex.what() );
     }
- virtual void log_exception( std::ostream&, log_checkpoint_data const&, const_string explanation ) {}
+ virtual void log_exception( std::ostream&, log_checkpoint_data const&, const_string /* explanation */ ) {}
 
     virtual void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ) = 0;
     virtual void log_entry_value( std::ostream&, const_string value ) = 0;

Modified: trunk/boost/test/utils/basic_cstring/basic_cstring.hpp
==============================================================================
--- trunk/boost/test/utils/basic_cstring/basic_cstring.hpp (original)
+++ trunk/boost/test/utils/basic_cstring/basic_cstring.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -548,7 +548,7 @@
         --it;
     }
 
- return it == last ? npos : it - begin();
+ return it == last ? static_cast<size_type>(npos) : static_cast<size_type>(it - begin());
 }
 
 //____________________________________________________________________________//

Modified: trunk/boost/test/utils/runtime/argument.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/argument.hpp (original)
+++ trunk/boost/test/utils/runtime/argument.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -43,7 +43,7 @@
 class argument {
 public:
     // Constructor
- argument( parameter const& p, call_traits<rtti::id_t>::param_type value_type )
+ argument( parameter const& p, rtti::id_t value_type )
     : p_formal_parameter( p )
     , p_value_type( value_type )
     {}
@@ -81,22 +81,22 @@
 
 template<typename T>
 inline T const&
-arg_value( argument const& arg )
+arg_value( argument const& arg_ )
 {
- assert( arg.p_value_type == rtti::type_id<T>() ); // detect logic error
+ assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
 
- return static_cast<typed_argument<T> const&>( arg ).p_value.value;
+ return static_cast<typed_argument<T> const&>( arg_ ).p_value.value;
 }
 
 //____________________________________________________________________________//
 
 template<typename T>
 inline T&
-arg_value( argument& arg )
+arg_value( argument& arg_ )
 {
- assert( arg.p_value_type == rtti::type_id<T>() ); // detect logic error
+ assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
 
- return static_cast<typed_argument<T>&>( arg ).p_value.value;
+ return static_cast<typed_argument<T>&>( arg_ ).p_value.value;
 }
 
 #ifdef BOOST_MSVC

Modified: trunk/boost/test/utils/runtime/cla/argument_factory.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/cla/argument_factory.hpp (original)
+++ trunk/boost/test/utils/runtime/cla/argument_factory.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -135,42 +135,42 @@
             throw;
     }
 
- argument_ptr arg = p.actual_argument();
+ argument_ptr actual_arg = p.actual_argument();
 
     BOOST_RT_CLA_VALIDATE_INPUT( !!value || p.p_optional_value, tr,
         BOOST_RT_PARAM_LITERAL( "Argument value missing for parameter " ) << p.id_2_report() );
 
- BOOST_RT_CLA_VALIDATE_INPUT( !arg || p.p_multiplicable, tr,
+ BOOST_RT_CLA_VALIDATE_INPUT( !actual_arg || p.p_multiplicable, tr,
         BOOST_RT_PARAM_LITERAL( "Unexpected repetition of the parameter " ) << p.id_2_report() );
 
     if( !!value && !!m_value_handler )
         m_value_handler( p, *value );
 
     if( !p.p_multiplicable )
- arg.reset( p.p_optional_value && (rtti::type_id<T>() != rtti::type_id<bool>())
+ actual_arg.reset( p.p_optional_value && (rtti::type_id<T>() != rtti::type_id<bool>())
             ? static_cast<argument*>(new typed_argument<boost::optional<T> >( p, value ))
             : static_cast<argument*>(new typed_argument<T>( p, *value )) );
     else {
         typedef std::list<boost::optional<T> > optional_list;
 
- if( !arg )
- arg.reset( p.p_optional_value
+ if( !actual_arg )
+ actual_arg.reset( p.p_optional_value
                 ? static_cast<argument*>(new typed_argument<optional_list>( p ))
                 : static_cast<argument*>(new typed_argument<std::list<T> >( p )) );
 
         if( p.p_optional_value ) {
- optional_list& values = arg_value<optional_list>( *arg );
+ optional_list& values = arg_value<optional_list>( *actual_arg );
 
             values.push_back( value );
         }
         else {
- std::list<T>& values = arg_value<std::list<T> >( *arg );
+ std::list<T>& values = arg_value<std::list<T> >( *actual_arg );
             
             values.push_back( *value );
         }
     }
 
- return arg;
+ return actual_arg;
 }
 
 //____________________________________________________________________________//
@@ -179,23 +179,23 @@
 inline argument_ptr
 typed_argument_factory<T>::produce_using( parameter& p, parser const& pa )
 {
- argument_ptr arg;
+ argument_ptr actual_arg;
 
     if( !m_value_generator )
- return arg;
+ return actual_arg;
 
     boost::optional<T> value;
     m_value_generator( pa, value );
 
     if( !value )
- return arg;
+ return actual_arg;
 
     if( !!m_value_handler )
         m_value_handler( p, *value );
 
- arg.reset( new typed_argument<T>( p, *value ) );
+ actual_arg.reset( new typed_argument<T>( p, *value ) );
 
- return arg;
+ return actual_arg;
 }
 
 //____________________________________________________________________________//

Modified: trunk/boost/test/utils/runtime/cla/id_policy.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/cla/id_policy.hpp (original)
+++ trunk/boost/test/utils/runtime/cla/id_policy.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -62,7 +62,7 @@
     }
 
 protected:
- explicit basic_naming_policy( call_traits<rtti::id_t>::param_type dyn_type )
+ explicit basic_naming_policy( rtti::id_t dyn_type )
     : identification_policy( dyn_type )
     {}
     BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {}

Modified: trunk/boost/test/utils/runtime/cla/iface/id_policy.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/cla/iface/id_policy.hpp (original)
+++ trunk/boost/test/utils/runtime/cla/iface/id_policy.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -54,7 +54,7 @@
 
 protected:
     // Constructor
- explicit identification_policy( call_traits<rtti::id_t>::param_type dyn_type )
+ explicit identification_policy( rtti::id_t dyn_type )
     : p_type_id( dyn_type )
     {}
     BOOST_TEST_PROTECTED_VIRTUAL ~identification_policy() {}

Modified: trunk/boost/test/utils/runtime/cla/parser.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/cla/parser.hpp (original)
+++ trunk/boost/test/utils/runtime/cla/parser.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -114,10 +114,10 @@
     template<typename T>
     void get( cstring string_id, boost::optional<T>& res ) const
     {
- const_argument_ptr arg = (*this)[string_id];
+ const_argument_ptr actual_arg = (*this)[string_id];
 
- if( arg )
- res = arg_value<T>( *arg );
+ if( actual_arg )
+ res = arg_value<T>( *actual_arg );
         else
             res.reset();
     }

Modified: trunk/boost/test/utils/runtime/config.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/config.hpp (original)
+++ trunk/boost/test/utils/runtime/config.hpp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -67,6 +67,11 @@
 typedef std::basic_ostream<char_type> out_stream;
 #endif
 
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // putenv
+#endif
+
 #ifndef UNDER_CE
 #if defined(__COMO__) && 0
 inline void
@@ -92,6 +97,10 @@
 #endif
 #endif
 
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
 #define BOOST_RT_PARAM_LITERAL( l ) l
 #define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
 #define BOOST_RT_PARAM_GETENV getenv

Modified: trunk/boost/test/utils/runtime/env/environment.ipp
==============================================================================
--- trunk/boost/test/utils/runtime/env/environment.ipp (original)
+++ trunk/boost/test/utils/runtime/env/environment.ipp 2009-11-22 21:23:54 EST (Sun, 22 Nov 2009)
@@ -75,6 +75,11 @@
 
 //____________________________________________________________________________//
 
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // getenv
+#endif
+
 BOOST_RT_PARAM_INLINE cstring
 sys_read_var( cstring var_name )
 {
@@ -82,6 +87,9 @@
     return BOOST_RT_PARAM_GETENV( var_name.begin() );
 }
 
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
 //____________________________________________________________________________//
 
 BOOST_RT_PARAM_INLINE void


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