regex: some fixes for level 4 warnings under VC6

[SVN r8942]
This commit is contained in:
John Maddock
2001-02-05 12:48:09 +00:00
parent dd2dbfacbb
commit 9f9f46f34b
4 changed files with 9 additions and 7 deletions

View File

@ -311,7 +311,7 @@ void expand_escapes(string_type& s)
s[pos] = 0; s[pos] = 0;
} }
else else
s.insert(s.begin() + pos, val); s.insert(s.begin() + pos, (char)val);
i = pos; i = pos;
} }
else else

View File

@ -237,7 +237,7 @@ void jm_debug_alloc::free_()
} }
} }
jm_debug_alloc::pointer jm_debug_alloc::allocate(size_type n, void* hint) jm_debug_alloc::pointer jm_debug_alloc::allocate(size_type n, void*)
{ {
pointer p = new char[n + maxi(sizeof(size_type), boost::re_detail::padding_size)]; pointer p = new char[n + maxi(sizeof(size_type), boost::re_detail::padding_size)];
*(size_type*)p = n; *(size_type*)p = n;

View File

@ -490,13 +490,13 @@ bool hl_grep_test_proc(const RegEx& e)
end = start + e.Length(-2); end = start + e.Length(-2);
if(start == -1) if(start == -1)
{ {
if(matches[hl_match_id + 1] != search_text.size()) if(matches[hl_match_id + 1] != (int)search_text.size())
{ {
begin_error(); begin_error();
cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl; cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl;
} }
} }
else if((start != matches[hl_match_id + 1]) || (end != search_text.size())) else if((start != matches[hl_match_id + 1]) || (end != (int)search_text.size()))
{ {
begin_error(); begin_error();
cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl; cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl;
@ -535,7 +535,7 @@ void cpp_hl_tests(RegEx& e, bool recurse = true)
unsigned int j = 0; unsigned int j = 0;
while(matches[j] != -2) while(matches[j] != -2)
{ {
if( (matches[j] != e.Position(i)) || (matches[j+1] - matches[j] != e.Length(i)) ) if( (matches[j] != (int)e.Position(i)) || (matches[j+1] - matches[j] != (int)e.Length(i)) )
{ {
begin_error(); begin_error();
cout << "RegEx::Search error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl; cout << "RegEx::Search error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl;
@ -559,7 +559,7 @@ void cpp_hl_tests(RegEx& e, bool recurse = true)
unsigned int j = 0; unsigned int j = 0;
while(matches[j] != -2) while(matches[j] != -2)
{ {
if( (matches[j] != e.Position(i)) || (matches[j+1] - matches[j] != e.Length(i)) ) if( (matches[j] != (int)e.Position(i)) || (matches[j+1] - matches[j] != (int)e.Length(i)) )
{ {
begin_error(); begin_error();
cout << "RegEx::Match error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl; cout << "RegEx::Match error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl;
@ -642,7 +642,7 @@ void run_tests()
cpp_hl_tests(e, true); cpp_hl_tests(e, true);
} }
} }
catch(const std::exception& e) catch(const std::exception& )
{ {
if(search_text != BOOST_RE_STR("!")) if(search_text != BOOST_RE_STR("!"))
{ {

View File

@ -107,6 +107,8 @@ public:
private: private:
lock_type& mut; lock_type& mut;
bool owned; bool owned;
// VC6 warning suppression:
lock_guard& operator=(const lock_guard&);
}; };