Up the warning level, and fix the resulting warnings with msvc, gcc and Intel.

Fix bug in docs and regenerate.

[SVN r65208]
This commit is contained in:
John Maddock
2010-09-03 08:33:13 +00:00
parent ae013c447c
commit f4d925ad3b
53 changed files with 314 additions and 230 deletions

View File

@ -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());

View File

@ -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())
{

View File

@ -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(){}

View File

@ -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;

View File

@ -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);