Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78431 - trunk/boost/regex/v4
From: john_at_[hidden]
Date: 2012-05-12 04:11:05


Author: johnmaddock
Date: 2012-05-12 04:11:01 EDT (Sat, 12 May 2012)
New Revision: 78431
URL: http://svn.boost.org/trac/boost/changeset/78431

Log:
Fix clang warnings.
Fixes #6863.
Text files modified:
   trunk/boost/regex/v4/basic_regex_creator.hpp | 23 +++++++++--------------
   1 files changed, 9 insertions(+), 14 deletions(-)

Modified: trunk/boost/regex/v4/basic_regex_creator.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_creator.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_creator.hpp 2012-05-12 04:11:01 EDT (Sat, 12 May 2012)
@@ -517,24 +517,19 @@
    return result;
 }
 
-namespace{
-
 template<class T>
 inline bool char_less(T t1, T t2)
 {
    return t1 < t2;
 }
-template<>
-inline bool char_less<char>(char t1, char t2)
+inline bool char_less(char t1, char t2)
 {
    return static_cast<unsigned char>(t1) < static_cast<unsigned char>(t2);
 }
-template<>
-inline bool char_less<signed char>(signed char t1, signed char t2)
+inline bool char_less(signed char t1, signed char t2)
 {
    return static_cast<unsigned char>(t1) < static_cast<unsigned char>(t2);
 }
-}
 
 template <class charT, class traits>
 re_syntax_base* basic_regex_creator<charT, traits>::append_set(
@@ -1035,7 +1030,7 @@
                state = rep->alt.p;
                continue;
             }
- else if((state->type == syntax_element_long_set_rep))
+ else if(state->type == syntax_element_long_set_rep)
             {
                BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
                if(static_cast<re_set_long<mask_type>*>(rep->next.p)->singleton == 0)
@@ -1113,9 +1108,9 @@
          if(l_map)
          {
             l_map[0] |= mask_init;
- l_map['\n'] |= mask;
- l_map['\r'] |= mask;
- l_map['\f'] |= mask;
+ l_map[static_cast<unsigned>('\n')] |= mask;
+ l_map[static_cast<unsigned>('\r')] |= mask;
+ l_map[static_cast<unsigned>('\f')] |= mask;
             l_map[0x85] |= mask;
          }
          // now figure out if we can match a NULL string at this point:
@@ -1302,8 +1297,8 @@
          if(l_map)
          {
             l_map[0] |= mask_init;
- l_map['\n'] |= mask;
- l_map['\r'] |= mask;
+ l_map[static_cast<unsigned>('\n')] |= mask;
+ l_map[static_cast<unsigned>('\r')] |= mask;
          }
          if(pnull)
             *pnull |= mask;
@@ -1338,7 +1333,7 @@
             re_syntax_base* p = m_pdata->m_first_state;
             while(p)
             {
- if((p->type == syntax_element_recurse))
+ if(p->type == syntax_element_recurse)
                {
                   re_brace* p2 = static_cast<re_brace*>(static_cast<re_jump*>(p)->alt.p);
                   if((p2->type == syntax_element_startmark) && (p2->index == static_cast<re_brace*>(state)->index))


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