forked from boostorg/regex
Fix some more GCC warnings.
Fix previous warning suppression which broke tests with GCC. Refs #6863. [SVN r78480]
This commit is contained in:
@ -63,6 +63,8 @@ struct char_architype
|
|||||||
// conversion to integral type:
|
// conversion to integral type:
|
||||||
operator long()const;
|
operator long()const;
|
||||||
};
|
};
|
||||||
|
inline long hash_value(char_architype val)
|
||||||
|
{ return val; }
|
||||||
//
|
//
|
||||||
// char_architype can not be used with basic_string:
|
// char_architype can not be used with basic_string:
|
||||||
//
|
//
|
||||||
|
@ -66,7 +66,7 @@ class basic_char_set
|
|||||||
public:
|
public:
|
||||||
typedef digraph<charT> digraph_type;
|
typedef digraph<charT> digraph_type;
|
||||||
typedef typename traits::string_type string_type;
|
typedef typename traits::string_type string_type;
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
|
|
||||||
basic_char_set()
|
basic_char_set()
|
||||||
{
|
{
|
||||||
@ -100,12 +100,12 @@ public:
|
|||||||
}
|
}
|
||||||
m_empty = false;
|
m_empty = false;
|
||||||
}
|
}
|
||||||
void add_class(mask_type m)
|
void add_class(m_type m)
|
||||||
{
|
{
|
||||||
m_classes |= m;
|
m_classes |= m;
|
||||||
m_empty = false;
|
m_empty = false;
|
||||||
}
|
}
|
||||||
void add_negated_class(mask_type m)
|
void add_negated_class(m_type m)
|
||||||
{
|
{
|
||||||
m_negated_classes |= m;
|
m_negated_classes |= m;
|
||||||
m_empty = false;
|
m_empty = false;
|
||||||
@ -162,11 +162,11 @@ public:
|
|||||||
{
|
{
|
||||||
return m_equivalents.end();
|
return m_equivalents.end();
|
||||||
}
|
}
|
||||||
mask_type classes()const
|
m_type classes()const
|
||||||
{
|
{
|
||||||
return m_classes;
|
return m_classes;
|
||||||
}
|
}
|
||||||
mask_type negated_classes()const
|
m_type negated_classes()const
|
||||||
{
|
{
|
||||||
return m_negated_classes;
|
return m_negated_classes;
|
||||||
}
|
}
|
||||||
@ -179,8 +179,8 @@ private:
|
|||||||
std::vector<digraph_type> m_ranges; // a list of end points of our ranges
|
std::vector<digraph_type> m_ranges; // a list of end points of our ranges
|
||||||
bool m_negate; // true if the set is to be negated
|
bool m_negate; // true if the set is to be negated
|
||||||
bool m_has_digraphs; // true if we have digraphs present
|
bool m_has_digraphs; // true if we have digraphs present
|
||||||
mask_type m_classes; // character classes to match
|
m_type m_classes; // character classes to match
|
||||||
mask_type m_negated_classes; // negated character classes to match
|
m_type m_negated_classes; // negated character classes to match
|
||||||
bool m_empty; // whether we've added anything yet
|
bool m_empty; // whether we've added anything yet
|
||||||
std::vector<digraph_type> m_equivalents; // a list of equivalence classes
|
std::vector<digraph_type> m_equivalents; // a list of equivalence classes
|
||||||
};
|
};
|
||||||
@ -367,9 +367,9 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
|||||||
{
|
{
|
||||||
typedef typename traits::string_type string_type;
|
typedef typename traits::string_type string_type;
|
||||||
typedef typename basic_char_set<charT, traits>::list_iterator item_iterator;
|
typedef typename basic_char_set<charT, traits>::list_iterator item_iterator;
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
|
|
||||||
re_set_long<mask_type>* result = static_cast<re_set_long<mask_type>*>(append_state(syntax_element_long_set, sizeof(re_set_long<mask_type>)));
|
re_set_long<m_type>* result = static_cast<re_set_long<m_type>*>(append_state(syntax_element_long_set, sizeof(re_set_long<m_type>)));
|
||||||
//
|
//
|
||||||
// fill in the basics:
|
// fill in the basics:
|
||||||
//
|
//
|
||||||
@ -513,7 +513,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
|||||||
//
|
//
|
||||||
// finally reset the address of our last state:
|
// finally reset the address of our last state:
|
||||||
//
|
//
|
||||||
m_last_state = result = static_cast<re_set_long<mask_type>*>(getaddress(offset));
|
m_last_state = result = static_cast<re_set_long<m_type>*>(getaddress(offset));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(char_less<charT>(c2, c1))
|
if(char_less(c2, c1))
|
||||||
{
|
{
|
||||||
// Oops error:
|
// Oops error:
|
||||||
return 0;
|
return 0;
|
||||||
@ -605,8 +605,8 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
|||||||
//
|
//
|
||||||
// and now the classes:
|
// and now the classes:
|
||||||
//
|
//
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
mask_type m = char_set.classes();
|
m_type m = char_set.classes();
|
||||||
if(flags() & regbase::icase)
|
if(flags() & regbase::icase)
|
||||||
{
|
{
|
||||||
// adjust m as needed:
|
// adjust m as needed:
|
||||||
@ -977,7 +977,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
|
|||||||
template <class charT, class traits>
|
template <class charT, class traits>
|
||||||
int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state)
|
int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state)
|
||||||
{
|
{
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
while(state)
|
while(state)
|
||||||
{
|
{
|
||||||
@ -1033,7 +1033,7 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
|
|||||||
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);
|
BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
|
||||||
if(static_cast<re_set_long<mask_type>*>(rep->next.p)->singleton == 0)
|
if(static_cast<re_set_long<m_type>*>(rep->next.p)->singleton == 0)
|
||||||
return -1;
|
return -1;
|
||||||
if(rep->max != rep->min)
|
if(rep->max != rep->min)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1044,7 +1044,7 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
case syntax_element_long_set:
|
case syntax_element_long_set:
|
||||||
if(static_cast<re_set_long<mask_type>*>(state)->singleton == 0)
|
if(static_cast<re_set_long<m_type>*>(state)->singleton == 0)
|
||||||
return -1;
|
return -1;
|
||||||
result += 1;
|
result += 1;
|
||||||
break;
|
break;
|
||||||
@ -1214,14 +1214,14 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
|
|||||||
case syntax_element_long_set:
|
case syntax_element_long_set:
|
||||||
if(l_map)
|
if(l_map)
|
||||||
{
|
{
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
if(static_cast<re_set_long<mask_type>*>(state)->singleton)
|
if(static_cast<re_set_long<m_type>*>(state)->singleton)
|
||||||
{
|
{
|
||||||
l_map[0] |= mask_init;
|
l_map[0] |= mask_init;
|
||||||
for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i)
|
for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i)
|
||||||
{
|
{
|
||||||
charT c = static_cast<charT>(i);
|
charT c = static_cast<charT>(i);
|
||||||
if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, l_icase))
|
if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<m_type>*>(state), *m_pdata, l_icase))
|
||||||
l_map[i] |= mask;
|
l_map[i] |= mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1464,7 +1464,7 @@ void basic_regex_creator<charT, traits>::set_bad_repeat(re_syntax_base* pt)
|
|||||||
template <class charT, class traits>
|
template <class charT, class traits>
|
||||||
syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_syntax_base* state)
|
syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_syntax_base* state)
|
||||||
{
|
{
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
if(state->type == syntax_element_rep)
|
if(state->type == syntax_element_rep)
|
||||||
{
|
{
|
||||||
// check to see if we are repeating a single state:
|
// check to see if we are repeating a single state:
|
||||||
@ -1479,7 +1479,7 @@ syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_synta
|
|||||||
case re_detail::syntax_element_set:
|
case re_detail::syntax_element_set:
|
||||||
return re_detail::syntax_element_short_set_rep;
|
return re_detail::syntax_element_short_set_rep;
|
||||||
case re_detail::syntax_element_long_set:
|
case re_detail::syntax_element_long_set:
|
||||||
if(static_cast<re_detail::re_set_long<mask_type>*>(state->next.p)->singleton)
|
if(static_cast<re_detail::re_set_long<m_type>*>(state->next.p)->singleton)
|
||||||
return re_detail::syntax_element_long_set_rep;
|
return re_detail::syntax_element_long_set_rep;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -669,8 +669,8 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
|
|||||||
case regex_constants::escape_type_class:
|
case regex_constants::escape_type_class:
|
||||||
{
|
{
|
||||||
escape_type_class_jump:
|
escape_type_class_jump:
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
mask_type m = this->m_traits.lookup_classname(m_position, m_position+1);
|
m_type m = this->m_traits.lookup_classname(m_position, m_position+1);
|
||||||
if(m != 0)
|
if(m != 0)
|
||||||
{
|
{
|
||||||
basic_char_set<charT, traits> char_set;
|
basic_char_set<charT, traits> char_set;
|
||||||
@ -1383,8 +1383,8 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr
|
|||||||
++name_first;
|
++name_first;
|
||||||
negated = true;
|
negated = true;
|
||||||
}
|
}
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
mask_type m = this->m_traits.lookup_classname(name_first, name_last);
|
m_type m = this->m_traits.lookup_classname(name_first, name_last);
|
||||||
if(m == 0)
|
if(m == 0)
|
||||||
{
|
{
|
||||||
if(char_set.empty() && (name_last - name_first == 1))
|
if(char_set.empty() && (name_last - name_first == 1))
|
||||||
|
@ -828,9 +828,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
|||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma option push -w-8008 -w-8066 -w-8004
|
#pragma option push -w-8008 -w-8066 -w-8004
|
||||||
#endif
|
#endif
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate->next.p);
|
const re_set_long<m_type>* set = static_cast<const re_set_long<m_type>*>(pstate->next.p);
|
||||||
std::size_t count = 0;
|
std::size_t count = 0;
|
||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
@ -1434,7 +1434,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat(bool
|
|||||||
template <class BidiIterator, class Allocator, class traits>
|
template <class BidiIterator, class Allocator, class traits>
|
||||||
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool r)
|
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool r)
|
||||||
{
|
{
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type m_type;
|
||||||
saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
|
saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
|
||||||
|
|
||||||
// if we have a match, just discard this state:
|
// if we have a match, just discard this state:
|
||||||
@ -1447,7 +1447,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool
|
|||||||
const re_repeat* rep = pmp->rep;
|
const re_repeat* rep = pmp->rep;
|
||||||
std::size_t count = pmp->count;
|
std::size_t count = pmp->count;
|
||||||
pstate = rep->next.p;
|
pstate = rep->next.p;
|
||||||
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate);
|
const re_set_long<m_type>* set = static_cast<const re_set_long<m_type>*>(pstate);
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
BOOST_ASSERT(rep->type == syntax_element_long_set_rep);
|
BOOST_ASSERT(rep->type == syntax_element_long_set_rep);
|
||||||
|
Reference in New Issue
Block a user