mirror of
https://github.com/boostorg/regex.git
synced 2025-07-22 16:47:17 +02:00
Mostly cgg warning suppression, plus some gcc 2.95 workarounds.
[SVN r20462]
This commit is contained in:
@ -195,7 +195,9 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_in
|
||||
unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
|
||||
if((result == traits_type::syntax_colon) && ((first-base) == 5))
|
||||
{
|
||||
return traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
|
||||
unsigned type = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
|
||||
if((type == traits_type::syntax_left_word) || (type == traits_type::syntax_right_word))
|
||||
return type;
|
||||
}
|
||||
return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ struct save_state_init
|
||||
*base = static_cast<saved_state*>(get_mem_block());
|
||||
*end = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(*base)+BOOST_REGEX_BLOCKSIZE);
|
||||
--(*end);
|
||||
new (*end)saved_state(0);
|
||||
(void) new (*end)saved_state(0);
|
||||
assert(*end > *base);
|
||||
}
|
||||
~save_state_init()
|
||||
@ -175,7 +175,7 @@ void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::extend_stack()
|
||||
backup_state = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(stack_base)+BOOST_REGEX_BLOCKSIZE);
|
||||
saved_extra_block* block = static_cast<saved_extra_block*>(backup_state);
|
||||
--block;
|
||||
new (block) saved_extra_block(m_stack_base, m_backup_state);
|
||||
(void) new (block) saved_extra_block(m_stack_base, m_backup_state);
|
||||
m_stack_base = stack_base;
|
||||
m_backup_state = block;
|
||||
}
|
||||
@ -195,7 +195,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_matc
|
||||
pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_matched_paren<BidiIterator>(index, sub);
|
||||
(void) new (pmp)saved_matched_paren<BidiIterator>(index, sub);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_recu
|
||||
pmp = m_backup_state;
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_state(saved_type_recurse);
|
||||
(void) new (pmp)saved_state(saved_type_recurse);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_asse
|
||||
pmp = static_cast<saved_assertion<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_assertion<BidiIterator>(positive, ps, position);
|
||||
(void) new (pmp)saved_assertion<BidiIterator>(positive, ps, position);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_alt(
|
||||
pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_position<BidiIterator>(ps, position, saved_state_alt);
|
||||
(void) new (pmp)saved_position<BidiIterator>(ps, position, saved_state_alt);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_non_
|
||||
pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_position<BidiIterator>(ps, position, saved_state_non_greedy_long_repeat);
|
||||
(void) new (pmp)saved_position<BidiIterator>(ps, position, saved_state_non_greedy_long_repeat);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_repe
|
||||
pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_repeater<BidiIterator>(i, s, position);
|
||||
(void) new (pmp)saved_repeater<BidiIterator>(i, s, position);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_sing
|
||||
pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
|
||||
--pmp;
|
||||
}
|
||||
new (pmp)saved_single_repeat<BidiIterator>(c, r, last_position, id);
|
||||
(void) new (pmp)saved_single_repeat<BidiIterator>(c, r, last_position, id);
|
||||
m_backup_state = pmp;
|
||||
}
|
||||
|
||||
|
@ -66,11 +66,25 @@ bool BOOST_REGEX_CALL re_maybe_set_member(charT c,
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
template <class traits>
|
||||
struct is_big_char
|
||||
{
|
||||
typedef typename traits::uchar_type traits_uchar_type;
|
||||
typedef typename traits::size_type traits_size_type;
|
||||
static bool test(char)
|
||||
{ return false; }
|
||||
static bool test(unsigned char)
|
||||
{ return false; }
|
||||
static bool test(signed char)
|
||||
{ return false; }
|
||||
template <class charT> static bool test(charT c)
|
||||
{ return (traits_size_type)(traits_uchar_type)c >= 256; }
|
||||
};
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&)
|
||||
{
|
||||
if((traits_size_type)(traits_uchar_type)c >= 256)
|
||||
if(is_big_char<traits>::test(c))
|
||||
return true;
|
||||
return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
|
||||
}
|
||||
@ -209,7 +223,9 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_in
|
||||
unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
|
||||
if((result == traits_type::syntax_colon) && ((first-base) == 5))
|
||||
{
|
||||
return traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
|
||||
unsigned type = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
|
||||
if((type == traits_type::syntax_left_word) || (type == traits_type::syntax_right_word))
|
||||
return type;
|
||||
}
|
||||
return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
|
||||
char_class_digit = std::ctype_base::digit,
|
||||
char_class_graph = std::ctype_base::graph,
|
||||
char_class_lower = std::ctype_base::lower,
|
||||
char_class_print = std::ctype_base::print,
|
||||
char_class_print = 0,//std::ctype_base::print,
|
||||
char_class_punct = std::ctype_base::punct,
|
||||
char_class_space = std::ctype_base::space,
|
||||
char_class_upper = std::ctype_base::upper,
|
||||
|
@ -271,6 +271,7 @@ operator + (const sub_match<RandomAccessIterator>& m,
|
||||
result.reserve(s.size() + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE))
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
@ -289,6 +290,23 @@ operator + (const sub_match<RandomAccessIterator>& m,
|
||||
result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
|
||||
return result.append(m.first, m.second).append(s);
|
||||
}
|
||||
#else
|
||||
// worwaround versions:
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m)
|
||||
{
|
||||
return s + m.str();
|
||||
}
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
|
||||
{
|
||||
return m.str() + s;
|
||||
}
|
||||
#endif
|
||||
template <class RandomAccessIterator>
|
||||
inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
|
Reference in New Issue
Block a user