Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-10-07 21:15:02


Author: eric_niebler
Date: 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
New Revision: 39776
URL: http://svn.boost.org/trac/boost/changeset/39776

Log:
fix warnings under msvc
Text files modified:
   trunk/boost/xpressive/detail/core/matcher/attr_matcher.hpp | 12 ++++++++++--
   trunk/boost/xpressive/detail/static/transforms/as_set.hpp | 11 +++++++++--
   trunk/boost/xpressive/detail/utility/algorithm.hpp | 2 ++
   trunk/boost/xpressive/proto/expr.hpp | 11 +++++++++++
   trunk/boost/xpressive/proto/ref.hpp | 11 +++++++++++
   trunk/boost/xpressive/regex_algorithms.hpp | 16 +++++++++++-----
   trunk/boost/xpressive/traits/c_regex_traits.hpp | 4 ++--
   trunk/boost/xpressive/traits/detail/c_ctype.hpp | 2 +-
   8 files changed, 57 insertions(+), 12 deletions(-)

Modified: trunk/boost/xpressive/detail/core/matcher/attr_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/matcher/attr_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/core/matcher/attr_matcher.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -33,6 +33,10 @@
         typedef typename Traits::char_type char_type;
         Traits const &traits_;
 
+ explicit char_translate(Traits const &traits)
+ : traits_(traits)
+ {}
+
         char_type operator ()(char_type ch1) const
         {
             return this->traits_.translate(ch1);
@@ -48,6 +52,10 @@
         typedef typename Traits::char_type char_type;
         Traits const &traits_;
 
+ explicit char_translate(Traits const &traits)
+ : traits_(traits)
+ {}
+
         char_type operator ()(char_type ch1) const
         {
             return this->traits_.translate_nocase(ch1);
@@ -66,7 +74,7 @@
         attr_matcher(int slot, Matcher &matcher, Traits const& traits)
           : slot_(slot-1)
         {
- char_translate<Traits, ICase> trans = {traits};
+ char_translate<Traits, ICase> trans(traits);
             this->sym_.load(matcher, trans);
         }
 
@@ -74,7 +82,7 @@
         bool match(match_state<BidiIter> &state, Next const &next) const
         {
             BidiIter tmp = state.cur_;
- char_translate<Traits, ICase> trans = {traits_cast<Traits>(state)};
+ char_translate<Traits, ICase> trans(traits_cast<Traits>(state));
             result_type const &result = this->sym_(state.cur_, state.end_, trans);
             if(result)
             {

Modified: trunk/boost/xpressive/detail/static/transforms/as_set.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_set.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_set.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -106,6 +106,13 @@
     template<typename Traits>
     struct set_fill_visitor
     {
+ typedef typename Traits::char_type char_type;
+
+ set_fill_visitor(char_type *buffer, Traits const &traits)
+ : buffer_(buffer)
+ , traits_(traits)
+ {}
+
         template<typename Char>
         void accept(Char ch)
         {
@@ -114,7 +121,7 @@
             );
         }
 
- typename Traits::char_type *buffer_;
+ char_type *buffer_;
         Traits const &traits_;
     };
 
@@ -141,7 +148,7 @@
         call(Expr const &expr, State const &state, Visitor &visitor)
         {
             typename apply<Expr, State, Visitor>::type set;
- set_fill_visitor<typename Visitor::traits_type> filler = {set.set_, visitor.traits()};
+ set_fill_visitor<typename Visitor::traits_type> filler(set.set_, visitor.traits());
             Grammar::call(expr, state, filler);
             return set;
         }

Modified: trunk/boost/xpressive/detail/utility/algorithm.hpp
==============================================================================
--- trunk/boost/xpressive/detail/utility/algorithm.hpp (original)
+++ trunk/boost/xpressive/detail/utility/algorithm.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -22,6 +22,7 @@
 #include <boost/range/value_type.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/iterator/iterator_traits.hpp>
+#include <boost/xpressive/detail/utility/ignore_unused.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -58,6 +59,7 @@
 template<typename InIter, typename Traits>
 int toi(InIter &begin, InIter end, Traits const &traits, int radix = 10, int max = INT_MAX)
 {
+ detail::ignore_unused(traits);
     int i = 0, c = 0;
     for(; begin != end && -1 != (c = traits.value(*begin, radix)); ++begin)
     {

Modified: trunk/boost/xpressive/proto/expr.hpp
==============================================================================
--- trunk/boost/xpressive/proto/expr.hpp (original)
+++ trunk/boost/xpressive/proto/expr.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -32,6 +32,13 @@
     #include <boost/xpressive/proto/traits.hpp>
     #include <boost/xpressive/proto/detail/suffix.hpp>
 
+ #if defined(_MSC_VER) && (_MSC_VER >= 1020)
+ # pragma warning(push)
+ # pragma warning(disable : 4510) // default constructor could not be generated
+ # pragma warning(disable : 4512) // assignment operator could not be generated
+ # pragma warning(disable : 4610) // user defined constructor required
+ #endif
+
     namespace boost { namespace proto
     {
     /// INTERNAL ONLY
@@ -121,6 +128,10 @@
     #undef BOOST_PROTO_UNREF_ARG
     }}
 
+ #if defined(_MSC_VER) && (_MSC_VER >= 1020)
+ # pragma warning(pop)
+ #endif
+
     #endif // BOOST_PROTO_EXPR_HPP_EAN_04_01_2005
 
 #elif BOOST_PP_ITERATION_DEPTH() == 1

Modified: trunk/boost/xpressive/proto/ref.hpp
==============================================================================
--- trunk/boost/xpressive/proto/ref.hpp (original)
+++ trunk/boost/xpressive/proto/ref.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -17,6 +17,13 @@
 #include <boost/xpressive/proto/proto_fwd.hpp>
 #include <boost/xpressive/proto/detail/suffix.hpp>
 
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4510) // default constructor could not be generated
+# pragma warning(disable : 4512) // assignment operator could not be generated
+# pragma warning(disable : 4610) // user defined constructor required
+#endif
+
 namespace boost { namespace proto
 {
 
@@ -166,4 +173,8 @@
     functional::unref const unref = {};
 }}
 
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
 #endif

Modified: trunk/boost/xpressive/regex_algorithms.hpp
==============================================================================
--- trunk/boost/xpressive/regex_algorithms.hpp (original)
+++ trunk/boost/xpressive/regex_algorithms.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -25,6 +25,12 @@
 #include <boost/xpressive/detail/core/state.hpp>
 #include <boost/xpressive/detail/utility/save_restore.hpp>
 
+#ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED
+# define BOOST_XPR_NONDEDUCED_TYPE_(x) x
+#else
+# define BOOST_XPR_NONDEDUCED_TYPE_(x) typename mpl::identity<x>::type
+#endif
+
 namespace boost { namespace xpressive
 {
 
@@ -106,7 +112,7 @@
 template<typename Char>
 inline bool regex_match
 (
- typename mpl::identity<Char *>::type begin
+ BOOST_XPR_NONDEDUCED_TYPE_(Char) *begin
   , match_results<Char *> &what
   , basic_regex<Char *> const &re
   , regex_constants::match_flag_type flags = regex_constants::match_default
@@ -159,7 +165,7 @@
 template<typename Char>
 inline bool regex_match
 (
- typename mpl::identity<Char *>::type begin
+ BOOST_XPR_NONDEDUCED_TYPE_(Char) *begin
   , basic_regex<Char *> const &re
   , regex_constants::match_flag_type flags = regex_constants::match_default
 )
@@ -381,7 +387,7 @@
 template<typename Char>
 inline bool regex_search
 (
- typename mpl::identity<Char *>::type begin
+ BOOST_XPR_NONDEDUCED_TYPE_(Char) *begin
   , match_results<Char *> &what
   , basic_regex<Char *> const &re
   , regex_constants::match_flag_type flags = regex_constants::match_default
@@ -434,7 +440,7 @@
 template<typename Char>
 inline bool regex_search
 (
- typename mpl::identity<Char *>::type begin
+ BOOST_XPR_NONDEDUCED_TYPE_(Char) *begin
   , basic_regex<Char *> const &re
   , regex_constants::match_flag_type flags = regex_constants::match_default
 )
@@ -570,7 +576,7 @@
 (
     std::basic_string<Char> const &str
   , basic_regex<typename std::basic_string<Char>::const_iterator> const &re
- , std::basic_string<typename mpl::identity<Char>::type> const &fmt
+ , std::basic_string<BOOST_XPR_NONDEDUCED_TYPE_(Char)> const &fmt
   , regex_constants::match_flag_type flags = regex_constants::match_default
 )
 {

Modified: trunk/boost/xpressive/traits/c_regex_traits.hpp
==============================================================================
--- trunk/boost/xpressive/traits/c_regex_traits.hpp (original)
+++ trunk/boost/xpressive/traits/c_regex_traits.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -75,14 +75,14 @@
     inline char c_tolower(char ch)
     {
         using namespace std;
- return tolower(static_cast<unsigned char>(ch));
+ return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
     }
 
     template<>
     inline char c_toupper(char ch)
     {
         using namespace std;
- return toupper(static_cast<unsigned char>(ch));
+ return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
     }
 
     #ifndef BOOST_XPRESSIVE_NO_WREGEX

Modified: trunk/boost/xpressive/traits/detail/c_ctype.hpp
==============================================================================
--- trunk/boost/xpressive/traits/detail/c_ctype.hpp (original)
+++ trunk/boost/xpressive/traits/detail/c_ctype.hpp 2007-10-07 21:15:01 EDT (Sun, 07 Oct 2007)
@@ -64,7 +64,7 @@
     for(std::size_t i = 0; i < name.size(); ++i)
     {
         using namespace std;
- name[i] = tolower(static_cast<unsigned char>(name[i]));
+ name[i] = static_cast<char>(tolower(static_cast<unsigned char>(name[i])));
     }
     return name;
 }


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