forked from boostorg/regex
Merge fixes from Trunk - mainly warning suppression.
[SVN r65720]
This commit is contained in:
@ -412,7 +412,7 @@ struct BaseRegexConcept
|
||||
|
||||
// access:
|
||||
const Regex ce;
|
||||
unsigned i = ce.mark_count();
|
||||
typename Regex::size_type i = ce.mark_count();
|
||||
ignore_unused_variable_warning(i);
|
||||
m_flags = ce.flags();
|
||||
e.imbue(ce.getloc());
|
||||
|
@ -255,6 +255,10 @@
|
||||
# define BOOST_REGEX_USE_CPP_LOCALE
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
# define BOOST_REGEX_USE_C_LOCALE
|
||||
#endif
|
||||
|
||||
/* Win32 defaults to native Win32 locale: */
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
|
||||
# define BOOST_REGEX_USE_WIN32_LOCALE
|
||||
|
@ -41,10 +41,10 @@ public:
|
||||
typedef std::map<Key, list_iterator> map_type;
|
||||
typedef typename map_type::iterator map_iterator;
|
||||
typedef typename list_type::size_type size_type;
|
||||
static boost::shared_ptr<Object const> get(const Key& k, size_type max_cache_size);
|
||||
static boost::shared_ptr<Object const> get(const Key& k, size_type l_max_cache_size);
|
||||
|
||||
private:
|
||||
static boost::shared_ptr<Object const> do_get(const Key& k, size_type max_cache_size);
|
||||
static boost::shared_ptr<Object const> do_get(const Key& k, size_type l_max_cache_size);
|
||||
|
||||
struct data
|
||||
{
|
||||
@ -58,7 +58,7 @@ private:
|
||||
};
|
||||
|
||||
template <class Key, class Object>
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type max_cache_size)
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type l_max_cache_size)
|
||||
{
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT;
|
||||
@ -66,7 +66,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
|
||||
boost::static_mutex::scoped_lock l(mut);
|
||||
if(l)
|
||||
{
|
||||
return do_get(k, max_cache_size);
|
||||
return do_get(k, l_max_cache_size);
|
||||
}
|
||||
//
|
||||
// what do we do if the lock fails?
|
||||
@ -77,12 +77,12 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
|
||||
return boost::shared_ptr<Object>();
|
||||
#endif
|
||||
#else
|
||||
return do_get(k, max_cache_size);
|
||||
return do_get(k, l_max_cache_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class Key, class Object>
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type max_cache_size)
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type l_max_cache_size)
|
||||
{
|
||||
typedef typename object_cache<Key, Object>::data object_data;
|
||||
typedef typename map_type::size_type map_size_type;
|
||||
@ -128,7 +128,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k,
|
||||
BOOST_ASSERT(s_data.index[k]->first.get() == result.get());
|
||||
BOOST_ASSERT(&(s_data.index.find(k)->first) == s_data.cont.back().second);
|
||||
BOOST_ASSERT(s_data.index.find(k)->first == k);
|
||||
if(s > max_cache_size)
|
||||
if(s > l_max_cache_size)
|
||||
{
|
||||
//
|
||||
// We have too many items in the list, so we need to start
|
||||
@ -137,7 +137,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k,
|
||||
//
|
||||
list_iterator pos = s_data.cont.begin();
|
||||
list_iterator last = s_data.cont.end();
|
||||
while((pos != last) && (s > max_cache_size))
|
||||
while((pos != last) && (s > l_max_cache_size))
|
||||
{
|
||||
if(pos->first.unique())
|
||||
{
|
||||
|
@ -96,8 +96,14 @@ class BOOST_REGEX_DECL scoped_static_mutex_lock
|
||||
public:
|
||||
scoped_static_mutex_lock(static_mutex& mut, bool lk = true);
|
||||
~scoped_static_mutex_lock();
|
||||
operator void const*()const;
|
||||
bool locked()const;
|
||||
operator void const*()const
|
||||
{
|
||||
return locked() ? this : 0;
|
||||
}
|
||||
bool locked()const
|
||||
{
|
||||
return m_have_lock;
|
||||
}
|
||||
void lock();
|
||||
void unlock();
|
||||
private:
|
||||
@ -107,16 +113,6 @@ private:
|
||||
scoped_static_mutex_lock& operator=(const scoped_static_mutex_lock&);
|
||||
};
|
||||
|
||||
inline scoped_static_mutex_lock::operator void const*()const
|
||||
{
|
||||
return locked() ? this : 0;
|
||||
}
|
||||
|
||||
inline bool scoped_static_mutex_lock::locked()const
|
||||
{
|
||||
return m_have_lock;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#else
|
||||
|
@ -70,7 +70,7 @@ class named_subexpressions_base
|
||||
{
|
||||
public:
|
||||
virtual int get_id(const charT* i, const charT* j)const = 0;
|
||||
virtual int get_id(std::size_t hash)const = 0;
|
||||
virtual int get_id(std::size_t h)const = 0;
|
||||
#ifdef __GNUC__
|
||||
// warning supression:
|
||||
virtual ~named_subexpressions_base(){}
|
||||
|
@ -1003,6 +1003,21 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
//
|
||||
if(pocessive)
|
||||
{
|
||||
if(m_position != m_end)
|
||||
{
|
||||
//
|
||||
// Check for illegal following quantifier, we have to do this here, because
|
||||
// the extra states we insert below circumvents are usual error checking :-(
|
||||
//
|
||||
switch(this->m_traits.syntax_type(*m_position))
|
||||
{
|
||||
case regex_constants::syntax_star:
|
||||
case regex_constants::syntax_plus:
|
||||
case regex_constants::syntax_question:
|
||||
fail(regex_constants::error_badrepeat, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
re_brace* pb = static_cast<re_brace*>(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace)));
|
||||
pb->index = -3;
|
||||
pb->icase = this->flags() & regbase::icase;
|
||||
|
@ -827,20 +827,20 @@ template <class charT>
|
||||
bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_type mask) const
|
||||
{
|
||||
return
|
||||
((mask & ::boost::re_detail::char_class_space) && (m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_print) && (m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_cntrl) && (m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_upper) && (m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_lower) && (m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_alpha) && (m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_digit) && (m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_punct) && (m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|
||||
((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
|
||||
|| ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
|
||||
|| ((mask & ::boost::re_detail::char_class_horizontal_space) && m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
|| ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -200,11 +200,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
BidiIterator saved_position = position;
|
||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||
pstate = pstate->next.p->next.p;
|
||||
bool r = match_all_states();
|
||||
bool res = match_all_states();
|
||||
position = saved_position;
|
||||
if(negated)
|
||||
r = !r;
|
||||
if(r)
|
||||
res = !res;
|
||||
if(res)
|
||||
pstate = next_pstate;
|
||||
else
|
||||
pstate = alt->alt.p;
|
||||
@ -901,7 +901,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
|
||||
{
|
||||
recursion_info<results_type> saved = recursion_stack.back();
|
||||
recursion_stack.pop_back();
|
||||
const re_syntax_base* saved_state = pstate = saved.preturn_address;
|
||||
pstate = saved.preturn_address;
|
||||
repeater_count<BidiIterator>* saved_count = next_count;
|
||||
next_count = saved.repeater_stack;
|
||||
*m_presult = saved.results;
|
||||
|
@ -153,6 +153,11 @@ private:
|
||||
typedef typename boost::is_convertible<ForwardIter, const char_type*>::type tag_type;
|
||||
return get_named_sub_index(i, j, tag_type());
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
// msvc-8.0 issues a spurious warning on the call to std::advance here:
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::false_&)
|
||||
{
|
||||
if(i != j)
|
||||
@ -166,6 +171,9 @@ private:
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::true_&)
|
||||
{
|
||||
return m_traits.toi(i, j, base);
|
||||
|
@ -361,7 +361,7 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
|
||||
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
|
Reference in New Issue
Block a user