Fix gcc -Wshadow warnings

[SVN r20857]
This commit is contained in:
John Maddock
2003-11-19 12:57:50 +00:00
parent 42337410fc
commit 27875c1e55
7 changed files with 161 additions and 162 deletions

View File

@ -96,11 +96,11 @@ public:
return *this; return *this;
} }
reg_expression& assign(const charT* first, reg_expression& assign(const charT* arg_first,
const charT* last, const charT* arg_last,
flag_type f = regex_constants::normal) flag_type f = regex_constants::normal)
{ {
set_expression(first, last, f | regex_constants::use_except); set_expression(arg_first, arg_last, f | regex_constants::use_except);
return *this; return *this;
} }
#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) #if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__)
@ -114,10 +114,10 @@ public:
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regex_constants::use_except); } : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regex_constants::use_except); }
template <class InputIterator> template <class InputIterator>
reg_expression(InputIterator first, InputIterator last, flag_type f = regex_constants::normal, const Allocator& al = Allocator()) reg_expression(InputIterator arg_first, InputIterator arg_last, flag_type f = regex_constants::normal, const Allocator& al = Allocator())
: data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0) : data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{ {
std::basic_string<charT> a(first, last); std::basic_string<charT> a(arg_first, arg_last);
set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except); set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except);
} }
@ -138,11 +138,11 @@ public:
} }
template <class InputIterator> template <class InputIterator>
reg_expression& BOOST_REGEX_CALL assign(InputIterator first, reg_expression& BOOST_REGEX_CALL assign(InputIterator arg_first,
InputIterator last, InputIterator arg_last,
flag_type f = regex_constants::normal) flag_type f = regex_constants::normal)
{ {
std::basic_string<charT> a(first, last); std::basic_string<charT> a(arg_first, arg_last);
set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except); set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except);
return *this; return *this;
} }
@ -361,8 +361,8 @@ public:
: reg_expression<charT, traits, Allocator>(p,f,a){} : reg_expression<charT, traits, Allocator>(p,f,a){}
template <class I> template <class I>
basic_regex(I first, I last, flag_type f = regex_constants::normal, const Allocator& al = Allocator()) basic_regex(I arg_first, I arg_last, flag_type f = regex_constants::normal, const Allocator& al = Allocator())
: reg_expression<charT, traits, Allocator>(first, last, f, al){} : reg_expression<charT, traits, Allocator>(arg_first, arg_last, f, al){}
template <class ST, class SA> template <class ST, class SA>
basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string<charT, ST, SA>& p) basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string<charT, ST, SA>& p)

View File

@ -215,11 +215,11 @@ public:
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
mapfile_iterator() { node = 0; file = 0; offset = 0; } mapfile_iterator() { node = 0; file = 0; offset = 0; }
mapfile_iterator(const mapfile* f, long position) mapfile_iterator(const mapfile* f, long arg_position)
{ {
file = f; file = f;
node = f->_first + position / mapfile::buf_size; node = f->_first + arg_position / mapfile::buf_size;
offset = position % mapfile::buf_size; offset = arg_position % mapfile::buf_size;
if(file) if(file)
file->lock(node); file->lock(node);
} }

View File

@ -106,8 +106,8 @@ struct saved_single_repeat : public saved_state
unsigned count; unsigned count;
const re_repeat* rep; const re_repeat* rep;
BidiIterator last_position; BidiIterator last_position;
saved_single_repeat(unsigned c, const re_repeat* r, BidiIterator lp, int id) saved_single_repeat(unsigned c, const re_repeat* r, BidiIterator lp, int arg_id)
: saved_state(id), count(c), rep(r), last_position(lp){} : saved_state(arg_id), count(c), rep(r), last_position(lp){}
}; };
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>

View File

@ -205,25 +205,25 @@ Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::get_allocat
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& first, const charT* last) unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& arg_first, const charT* arg_last)
{ {
// //
// we have an inner [...] construct // we have an inner [...] construct
// //
jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set); jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_open_set);
const charT* base = first; const charT* base = arg_first;
while( (first != last) while( (arg_first != arg_last)
&& (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) != traits_type::syntax_close_set) ) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) != traits_type::syntax_close_set) )
++first; ++arg_first;
if(first == last) if(arg_first == arg_last)
return 0; return 0;
++first; ++arg_first;
if((first-base) < 5) if((arg_first-base) < 5)
return 0; return 0;
if(*(base+1) != *(first-2)) if(*(base+1) != *(arg_first-2))
return 0; return 0;
unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1)); unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
if((result == traits_type::syntax_colon) && ((first-base) == 5)) if((result == traits_type::syntax_colon) && ((arg_first-base) == 5))
{ {
unsigned type = 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)) if((type == traits_type::syntax_left_word) || (type == traits_type::syntax_right_word))
@ -234,20 +234,20 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_in
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& first, const charT* last) bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& arg_first, const charT* arg_last)
{ {
// //
// returns true if we get to last: // returns true if we get to arg_last:
// //
while((first != last) && (traits_inst.is_class(*first, traits_type::char_class_space) == true)) while((arg_first != arg_last) && (traits_inst.is_class(*arg_first, traits_type::char_class_space) == true))
{ {
++first; ++arg_first;
} }
return first == last; return arg_first == arg_last;
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* end, unsigned& min, unsigned& max) void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* arg_end, unsigned& min, unsigned& max)
{ {
// //
// we have {x} or {x,} or {x,y} NB no spaces inside braces // we have {x} or {x,} or {x,y} NB no spaces inside braces
@ -255,7 +255,7 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
// On input ptr points to "{" // On input ptr points to "{"
// //
++ptr; ++ptr;
if(skip_space(ptr, end)) if(skip_space(ptr, arg_end))
{ {
fail(REG_EBRACE); fail(REG_EBRACE);
return; return;
@ -265,8 +265,8 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
fail(REG_BADBR); fail(REG_BADBR);
return; return;
} }
min = traits_inst.toi(ptr, end, 10); min = traits_inst.toi(ptr, arg_end, 10);
if(skip_space(ptr, end)) if(skip_space(ptr, arg_end))
{ {
fail(REG_EBRACE); fail(REG_EBRACE);
return; return;
@ -275,13 +275,13 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
{ {
//we have a second interval: //we have a second interval:
++ptr; ++ptr;
if(skip_space(ptr, end)) if(skip_space(ptr, arg_end))
{ {
fail(REG_EBRACE); fail(REG_EBRACE);
return; return;
} }
if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_digit) if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_digit)
max = traits_inst.toi(ptr, end, 10); max = traits_inst.toi(ptr, arg_end, 10);
else else
max = (unsigned)-1; max = (unsigned)-1;
} }
@ -289,7 +289,7 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
max = min; max = min;
// validate input: // validate input:
if(skip_space(ptr, end)) if(skip_space(ptr, arg_end))
{ {
fail(REG_EBRACE); fail(REG_EBRACE);
return; return;
@ -310,7 +310,7 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
{ {
// back\ is OK now check the } // back\ is OK now check the }
++ptr; ++ptr;
if((ptr == end) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace)) if((ptr == arg_end) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace))
{ {
fail(REG_BADBR); fail(REG_BADBR);
return; return;
@ -325,10 +325,10 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(cons
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& first, const charT* last) charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& arg_first, const charT* arg_last)
{ {
charT c(*first); charT c(*arg_first);
traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*first; traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*arg_first;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
traits_size_type syntax = traits_inst.syntax_type(c_unsigned); traits_size_type syntax = traits_inst.syntax_type(c_unsigned);
@ -336,93 +336,93 @@ charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(co
{ {
case traits_type::syntax_a: case traits_type::syntax_a:
c = '\a'; c = '\a';
++first; ++arg_first;
break; break;
case traits_type::syntax_f: case traits_type::syntax_f:
c = '\f'; c = '\f';
++first; ++arg_first;
break; break;
case traits_type::syntax_n: case traits_type::syntax_n:
c = '\n'; c = '\n';
++first; ++arg_first;
break; break;
case traits_type::syntax_r: case traits_type::syntax_r:
c = '\r'; c = '\r';
++first; ++arg_first;
break; break;
case traits_type::syntax_t: case traits_type::syntax_t:
c = '\t'; c = '\t';
++first; ++arg_first;
break; break;
case traits_type::syntax_v: case traits_type::syntax_v:
c = '\v'; c = '\v';
++first; ++arg_first;
break; break;
case traits_type::syntax_x: case traits_type::syntax_x:
++first; ++arg_first;
if(first == last) if(arg_first == arg_last)
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
break; break;
} }
// maybe have \x{ddd} // maybe have \x{ddd}
if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) == traits_type::syntax_open_brace) if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*arg_first)) == traits_type::syntax_open_brace)
{ {
++first; ++arg_first;
if(first == last) if(arg_first == arg_last)
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
break; break;
} }
if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false) if(traits_inst.is_class(*arg_first, traits_type::char_class_xdigit) == false)
{ {
fail(REG_BADBR); fail(REG_BADBR);
break; break;
} }
c = (charT)traits_inst.toi(first, last, -16); c = (charT)traits_inst.toi(arg_first, arg_last, -16);
if((first == last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) != traits_type::syntax_close_brace)) if((arg_first == arg_last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*arg_first)) != traits_type::syntax_close_brace))
{ {
fail(REG_BADBR); fail(REG_BADBR);
} }
++first; ++arg_first;
break; break;
} }
else else
{ {
if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false) if(traits_inst.is_class(*arg_first, traits_type::char_class_xdigit) == false)
{ {
fail(REG_BADBR); fail(REG_BADBR);
break; break;
} }
c = (charT)traits_inst.toi(first, last, -16); c = (charT)traits_inst.toi(arg_first, arg_last, -16);
} }
break; break;
case traits_type::syntax_c: case traits_type::syntax_c:
++first; ++arg_first;
if(first == last) if(arg_first == arg_last)
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
break; break;
} }
if(((traits_uchar_type)(*first) < (traits_uchar_type)'@') if(((traits_uchar_type)(*arg_first) < (traits_uchar_type)'@')
|| ((traits_uchar_type)(*first) > (traits_uchar_type)127) ) || ((traits_uchar_type)(*arg_first) > (traits_uchar_type)127) )
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
return (charT)0; return (charT)0;
} }
c = (charT)((traits_uchar_type)(*first) - (traits_uchar_type)'@'); c = (charT)((traits_uchar_type)(*arg_first) - (traits_uchar_type)'@');
++first; ++arg_first;
break; break;
case traits_type::syntax_e: case traits_type::syntax_e:
c = (charT)27; c = (charT)27;
++first; ++arg_first;
break; break;
case traits_type::syntax_digit: case traits_type::syntax_digit:
c = (charT)traits_inst.toi(first, last, -8); c = (charT)traits_inst.toi(arg_first, arg_last, -8);
break; break;
default: default:
//c = *first; //c = *arg_first;
++first; ++arg_first;
} }
return c; return c;
} }
@ -678,13 +678,13 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_map(
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned size) void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned arg_size)
{ {
# ifdef BOOST_MSVC # ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable: 4127) # pragma warning(disable: 4127)
#endif #endif
// move all offsets starting with j->link forward by size // move all offsets starting with j->link forward by arg_size
// called after an insert: // called after an insert:
j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i); j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
while(true) while(true)
@ -692,19 +692,19 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_
switch(j->type) switch(j->type)
{ {
case re_detail::syntax_element_rep: case re_detail::syntax_element_rep:
static_cast<re_detail::re_jump*>(j)->alt.i += size; static_cast<re_detail::re_jump*>(j)->alt.i += arg_size;
j->next.i += size; j->next.i += arg_size;
break; break;
case re_detail::syntax_element_jump: case re_detail::syntax_element_jump:
case re_detail::syntax_element_alt: case re_detail::syntax_element_alt:
static_cast<re_detail::re_jump*>(j)->alt.i += size; static_cast<re_detail::re_jump*>(j)->alt.i += arg_size;
j->next.i += size; j->next.i += arg_size;
break; break;
default: default:
j->next.i += size; j->next.i += arg_size;
break; break;
} }
if(j->next.i == size) if(j->next.i == arg_size)
break; break;
j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i); j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
} }
@ -731,15 +731,15 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& first, const charT* last) re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& arg_first, const charT* arg_last)
{ {
re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator()); re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator()); re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator()); re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator());
re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator()); re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator());
bool has_digraphs = false; bool has_digraphs = false;
jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set); jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_open_set);
++first; ++arg_first;
bool started = false; bool started = false;
bool done = false; bool done = false;
bool isnot = false; bool isnot = false;
@ -754,9 +754,9 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
unsigned l = last_none; unsigned l = last_none;
traits_string_type s; traits_string_type s;
while((first != last) && !done) while((arg_first != arg_last) && !done)
{ {
traits_size_type c = (traits_size_type)(traits_uchar_type)*first; traits_size_type c = (traits_size_type)(traits_uchar_type)*arg_first;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
traits_size_type syntax = traits_inst.syntax_type(c); traits_size_type syntax = traits_inst.syntax_type(c);
@ -781,10 +781,10 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
goto char_set_literal; goto char_set_literal;
} }
// check to see if we really have a class: // check to see if we really have a class:
const charT* base = first; const charT* base = arg_first;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
unsigned int inner_set = parse_inner_set(first, last); unsigned int inner_set = parse_inner_set(arg_first, arg_last);
switch(inner_set) switch(inner_set)
{ {
case traits_type::syntax_colon: case traits_type::syntax_colon:
@ -794,7 +794,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
fail(REG_ERANGE); fail(REG_ERANGE);
return 0; return 0;
} }
boost::uint_fast32_t id = traits_inst.lookup_classname(base+2, first-2); boost::uint_fast32_t id = traits_inst.lookup_classname(base+2, arg_first-2);
if(_flags & regex_constants::icase) if(_flags & regex_constants::icase)
{ {
if((id == traits_type::char_class_upper) || (id == traits_type::char_class_lower)) if((id == traits_type::char_class_upper) || (id == traits_type::char_class_lower))
@ -816,9 +816,9 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
// //
// we have a collating element [.collating-name.] // we have a collating element [.collating-name.]
// //
if(traits_inst.lookup_collatename(s, base+2, first-2)) if(traits_inst.lookup_collatename(s, base+2, arg_first-2))
{ {
--first; --arg_first;
if(s.size() > 1) if(s.size() > 1)
has_digraphs = true; has_digraphs = true;
if(s.size())goto char_set_literal; if(s.size())goto char_set_literal;
@ -829,7 +829,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
// //
// we have an equivalence class [=collating-name=] // we have an equivalence class [=collating-name=]
// //
if(traits_inst.lookup_collatename(s, base+2, first-2)) if(traits_inst.lookup_collatename(s, base+2, arg_first-2))
{ {
std::size_t len = s.size(); std::size_t len = s.size();
if(len) if(len)
@ -851,17 +851,17 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
fail(REG_ECOLLATE); fail(REG_ECOLLATE);
return 0; return 0;
case traits_type::syntax_left_word: case traits_type::syntax_left_word:
if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)) if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set))
{ {
++first; ++arg_first;
return add_simple(0, re_detail::syntax_element_word_start); return add_simple(0, re_detail::syntax_element_word_start);
} }
fail(REG_EBRACK); fail(REG_EBRACK);
return 0; return 0;
case traits_type::syntax_right_word: case traits_type::syntax_right_word:
if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)) if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set))
{ {
++first; ++arg_first;
return add_simple(0, re_detail::syntax_element_word_end); return add_simple(0, re_detail::syntax_element_word_end);
} }
fail(REG_EBRACK); fail(REG_EBRACK);
@ -872,7 +872,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
unsigned int t = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1)); unsigned int t = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
if((t != traits_type::syntax_colon) && (t != traits_type::syntax_dot) && (t != traits_type::syntax_equal)) if((t != traits_type::syntax_colon) && (t != traits_type::syntax_dot) && (t != traits_type::syntax_equal))
{ {
first = base; arg_first = base;
s = (charT)c; s = (charT)c;
goto char_set_literal; goto char_set_literal;
} }
@ -880,7 +880,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
fail(REG_EBRACK); fail(REG_EBRACK);
return 0; return 0;
} }
if(first == last) if(arg_first == arg_last)
{ {
fail(REG_EBRACK); fail(REG_EBRACK);
return 0; return 0;
@ -901,10 +901,10 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
s = (charT)c; s = (charT)c;
goto char_set_literal; goto char_set_literal;
} }
++first; ++arg_first;
if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set) if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set)
{ {
--first; --arg_first;
s = (charT)c; s = (charT)c;
goto char_set_literal; goto char_set_literal;
} }
@ -921,14 +921,14 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
case traits_type::syntax_slash: case traits_type::syntax_slash:
if(_flags & regex_constants::escape_in_lists) if(_flags & regex_constants::escape_in_lists)
{ {
++first; ++arg_first;
if(first == last) if(arg_first == arg_last)
continue; continue;
traits_size_type c = (traits_size_type)(traits_uchar_type)*first; /*traits_size_type*/ c = (traits_size_type)(traits_uchar_type)*arg_first;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
traits_size_type syntax = traits_inst.syntax_type(c); traits_size_type syntax4 = traits_inst.syntax_type(c);
switch(syntax) switch(syntax4)
{ {
case traits_type::syntax_w: case traits_type::syntax_w:
if(l == last_dash) if(l == last_dash)
@ -939,7 +939,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
classes.push(traits_type::char_class_word); classes.push(traits_type::char_class_word);
started = true; started = true;
l = last_none; l = last_none;
++first; ++arg_first;
continue; continue;
case traits_type::syntax_d: case traits_type::syntax_d:
if(l == last_dash) if(l == last_dash)
@ -950,7 +950,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
classes.push(traits_type::char_class_digit); classes.push(traits_type::char_class_digit);
started = true; started = true;
l = last_none; l = last_none;
++first; ++arg_first;
continue; continue;
case traits_type::syntax_s: case traits_type::syntax_s:
if(l == last_dash) if(l == last_dash)
@ -961,7 +961,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
classes.push(traits_type::char_class_space); classes.push(traits_type::char_class_space);
started = true; started = true;
l = last_none; l = last_none;
++first; ++arg_first;
continue; continue;
case traits_type::syntax_l: case traits_type::syntax_l:
if(l == last_dash) if(l == last_dash)
@ -972,7 +972,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
classes.push(traits_type::char_class_lower); classes.push(traits_type::char_class_lower);
started = true; started = true;
l = last_none; l = last_none;
++first; ++arg_first;
continue; continue;
case traits_type::syntax_u: case traits_type::syntax_u:
if(l == last_dash) if(l == last_dash)
@ -983,7 +983,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
classes.push(traits_type::char_class_upper); classes.push(traits_type::char_class_upper);
started = true; started = true;
l = last_none; l = last_none;
++first; ++arg_first;
continue; continue;
case traits_type::syntax_W: case traits_type::syntax_W:
case traits_type::syntax_D: case traits_type::syntax_D:
@ -993,8 +993,8 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
fail(REG_EESCAPE); fail(REG_EESCAPE);
return 0; return 0;
default: default:
c = parse_escape(first, last); c = parse_escape(arg_first, arg_last);
--first; --arg_first;
s = (charT)c; s = (charT)c;
goto char_set_literal; goto char_set_literal;
} }
@ -1029,7 +1029,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
l = last_single; l = last_single;
} }
} }
++first; ++arg_first;
} }
if(!done) if(!done)
return 0; return 0;
@ -1198,17 +1198,17 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
equivalents.pop(); equivalents.pop();
} }
boost::uint_fast32_t flags = 0; boost::uint_fast32_t l_flags = 0;
while(classes.empty() == false) while(classes.empty() == false)
{ {
flags |= classes.peek(); l_flags |= classes.peek();
classes.pop(); classes.pop();
} }
if(flags) if(l_flags)
{ {
for(unsigned int i = 0; i < 256; ++i) for(unsigned int i = 0; i < 256; ++i)
{ {
if(traits_inst.is_class(charT(i), flags)) if(traits_inst.is_class(charT(i), l_flags))
dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regex_constants::icase))] = re_detail::mask_all; dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regex_constants::icase))] = re_detail::mask_all;
} }
} }
@ -1326,7 +1326,7 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_d
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* p, const charT* end, flag_type f) unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* arg_first, const charT* arg_last, flag_type f)
{ {
# ifdef BOOST_MSVC # ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
@ -1337,27 +1337,27 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
f &= ~regex_constants::collate; f &= ~regex_constants::collate;
#endif #endif
if(p == expression()) if(arg_first == expression())
{ {
traits_string_type s(p, end); traits_string_type s(arg_first, arg_last);
return set_expression(s.c_str(), s.c_str() + s.size(), f); return set_expression(s.c_str(), s.c_str() + s.size(), f);
} }
typedef typename traits_type::sentry sentry_t; typedef typename traits_type::sentry sentry_t;
sentry_t sent(traits_inst); sentry_t sent(traits_inst);
if(sent){ if(sent){
const charT* base = p; const charT* base = arg_first;
data.clear(); data.clear();
_flags = f; _flags = f;
fail(REG_NOERROR); // clear any error fail(REG_NOERROR); // clear any error
if(p >= end) if(arg_first >= arg_last)
{ {
fail(REG_EMPTY); fail(REG_EMPTY);
return error_code(); return error_code();
} }
const charT* ptr = p; const charT* ptr = arg_first;
marks = 0; marks = 0;
re_detail::jstack<std::size_t, Allocator> mark(64, data.allocator()); re_detail::jstack<std::size_t, Allocator> mark(64, data.allocator());
re_detail::jstack<int, Allocator> markid(64, data.allocator()); re_detail::jstack<int, Allocator> markid(64, data.allocator());
@ -1376,14 +1376,14 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
if(_flags & regex_constants::literal) if(_flags & regex_constants::literal)
{ {
while(ptr != end) while(ptr != arg_last)
{ {
dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regex_constants::icase))); dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regex_constants::icase)));
++ptr; ++ptr;
} }
} }
while (ptr < end) while (ptr < arg_last)
{ {
c = (traits_size_type)(traits_uchar_type)*ptr; c = (traits_size_type)(traits_uchar_type)*ptr;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
@ -1422,8 +1422,8 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
c = (traits_size_type)(traits_uchar_type)*ptr; c = (traits_size_type)(traits_uchar_type)*ptr;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
traits_size_type syntax = traits_inst.syntax_type(c); traits_size_type syntax2 = traits_inst.syntax_type(c);
switch(syntax) switch(syntax2)
{ {
case traits_type::syntax_colon: case traits_type::syntax_colon:
static_cast<re_detail::re_brace*>(dat)->index = 0; static_cast<re_detail::re_brace*>(dat)->index = 0;
@ -1510,7 +1510,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
} }
} }
// pop any pushed alternatives and set the target end destination: // pop any pushed alternatives and set the target arg_last destination:
dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek()); dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
while(dat->type == re_detail::syntax_element_jump) while(dat->type == re_detail::syntax_element_jump)
{ {
@ -1537,7 +1537,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
break; break;
case traits_type::syntax_slash: case traits_type::syntax_slash:
{ {
if(++ptr == end) if(++ptr == arg_last)
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
return error_code(); return error_code();
@ -1545,8 +1545,8 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
c = (traits_size_type)(traits_uchar_type)*ptr; c = (traits_size_type)(traits_uchar_type)*ptr;
// this is only used for the switch(), but cannot be folded in // this is only used for the switch(), but cannot be folded in
// due to a bug in Comeau 4.2.44beta3 // due to a bug in Comeau 4.2.44beta3
traits_size_type syntax = traits_inst.syntax_type(c); traits_size_type syntax3 = traits_inst.syntax_type(c);
switch(syntax) switch(syntax3)
{ {
case traits_type::syntax_open_bracket: case traits_type::syntax_open_bracket:
if(_flags & bk_parens) if(_flags & bk_parens)
@ -1581,7 +1581,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
break; break;
// we have {x} or {x,} or {x,y}: // we have {x} or {x,} or {x,y}:
parse_range(ptr, end, rep_min, rep_max); parse_range(ptr, arg_last, rep_min, rep_max);
goto repeat_jump; goto repeat_jump;
case traits_type::syntax_digit: case traits_type::syntax_digit:
@ -1593,7 +1593,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
{ {
// we can have \025 which means take char whose // we can have \025 which means take char whose
// code is 25 (octal), so parse string: // code is 25 (octal), so parse string:
c = traits_inst.toi(ptr, end, -8); c = traits_inst.toi(ptr, arg_last, -8);
--ptr; --ptr;
break; break;
} }
@ -1663,7 +1663,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
++ptr; ++ptr;
while(true) while(true)
{ {
if(ptr == end) if(ptr == arg_last)
{ {
fail(REG_EESCAPE); fail(REG_EESCAPE);
return error_code(); return error_code();
@ -1671,7 +1671,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_slash) if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_slash)
{ {
++ptr; ++ptr;
if((ptr != end) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_E)) if((ptr != arg_last) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_E))
break; break;
else else
{ {
@ -1709,7 +1709,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
++ptr; ++ptr;
continue; continue;
default: default:
c = (traits_size_type)(traits_uchar_type)parse_escape(ptr, end); c = (traits_size_type)(traits_uchar_type)parse_escape(ptr, arg_last);
dat = add_literal(dat, (charT)c); dat = add_literal(dat, (charT)c);
continue; continue;
} }
@ -1791,7 +1791,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
++ptr; ++ptr;
// //
// now check to see if we have a non-greedy repeat: // now check to see if we have a non-greedy repeat:
if((ptr != end) && (_flags & (perlex | limited_ops | bk_plus_qm | bk_braces)) == perlex) if((ptr != arg_last) && (_flags & (perlex | limited_ops | bk_plus_qm | bk_braces)) == perlex)
{ {
c = (traits_size_type)(traits_uchar_type)*ptr; c = (traits_size_type)(traits_uchar_type)*ptr;
if(traits_type::syntax_question == traits_inst.syntax_type(c)) if(traits_type::syntax_question == traits_inst.syntax_type(c))
@ -1833,7 +1833,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
dat->next.i = data.size(); dat->next.i = data.size();
} }
// extend: // extend:
dat = compile_set(ptr, end); dat = compile_set(ptr, arg_last);
if(dat == 0) if(dat == 0)
{ {
if((_flags & regex_constants::failbit) == 0) if((_flags & regex_constants::failbit) == 0)
@ -1881,8 +1881,8 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
{ {
// we have a '(' or '|' to go back to: // we have a '(' or '|' to go back to:
offset = mark.peek(); offset = mark.peek();
re_detail::re_syntax_base* base = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + offset); re_detail::re_syntax_base* base2 = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + offset);
offset = base->next.i; offset = base2->next.i;
} }
re_detail::re_jump* j = static_cast<re_detail::re_jump*>(data.insert(offset, re_detail::re_jump_size)); re_detail::re_jump* j = static_cast<re_detail::re_jump*>(data.insert(offset, re_detail::re_jump_size));
j->type = re_detail::syntax_element_alt; j->type = re_detail::syntax_element_alt;
@ -1902,7 +1902,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
continue; continue;
} }
// we have {x} or {x,} or {x,y}: // we have {x} or {x,} or {x,y}:
parse_range(ptr, end, rep_min, rep_max); parse_range(ptr, arg_last, rep_min, rep_max);
goto repeat_jump; goto repeat_jump;
case traits_type::syntax_newline: case traits_type::syntax_newline:
if(_flags & newline_alt) if(_flags & newline_alt)
@ -1950,7 +1950,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
// //
if(mark.empty() == false) if(mark.empty() == false)
{ {
// pop any pushed alternatives and set the target end destination: // pop any pushed alternatives and set the target arg_last destination:
dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek()); dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
while(dat->type == re_detail::syntax_element_jump) while(dat->type == re_detail::syntax_element_jump)
{ {
@ -1974,11 +1974,11 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
// //
// allocate space for start _map: // allocate space for start _map:
startmap = reinterpret_cast<unsigned char*>(data.extend(256 + ((end - base + 1) * sizeof(charT)))); startmap = reinterpret_cast<unsigned char*>(data.extend(256 + ((arg_last - base + 1) * sizeof(charT))));
// //
// and copy the expression we just compiled: // and copy the expression we just compiled:
_expression = reinterpret_cast<charT*>(reinterpret_cast<char*>(startmap) + 256); _expression = reinterpret_cast<charT*>(reinterpret_cast<char*>(startmap) + 256);
_expression_len = end - base; _expression_len = arg_last - base;
std::memcpy(_expression, base, _expression_len * sizeof(charT)); std::memcpy(_expression, base, _expression_len * sizeof(charT));
*(_expression + _expression_len) = charT(0); *(_expression + _expression_len) = charT(0);
@ -2025,16 +2025,16 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size) re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int arg_size)
{ {
if(dat) if(dat)
{ {
data.align(); data.align();
dat->next.i = data.size(); dat->next.i = data.size();
} }
if(size < sizeof(re_detail::re_syntax_base)) if(arg_size < sizeof(re_detail::re_syntax_base))
size = sizeof(re_detail::re_syntax_base); arg_size = sizeof(re_detail::re_syntax_base);
dat = static_cast<re_detail::re_syntax_base*>(data.extend(size)); dat = static_cast<re_detail::re_syntax_base*>(data.extend(arg_size));
dat->type = type; dat->type = type;
dat->next.i = 0; dat->next.i = 0;
return dat; return dat;
@ -2085,11 +2085,11 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_re
} }
template <class charT, class traits, class Allocator> template <class charT, class traits, class Allocator>
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end) unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* arg_end)
{ {
unsigned int len = 0; unsigned int len = 0;
bool leading_lit = end ? false : true; bool leading_lit = arg_end ? false : true;
while(dat != end) while(dat != arg_end)
{ {
switch(dat->type) switch(dat->type)
{ {

View File

@ -717,11 +717,11 @@ void BOOST_REGEX_CALL c_regex_traits<char>::transform_primary(std::string& out,
out.erase((int)sort_delim); out.erase((int)sort_delim);
break; break;
case re_detail::sort_delim: case re_detail::sort_delim:
for(unsigned int i = 0; i < out.size(); ++i) for(unsigned int j = 0; j < out.size(); ++j)
{ {
if((out[i] == sort_delim) && (i+1 < out.size())) if((out[j] == sort_delim) && (j+1 < out.size()))
{ {
out.erase(i+1); out.erase(j+1);
break; break;
} }
} }

View File

@ -115,7 +115,6 @@ template<class charT, class traits>
typename parser_buf<charT, traits>::pos_type typename parser_buf<charT, traits>::pos_type
parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which)
{ {
typedef typename parser_buf<charT, traits>::pos_type pos_type;
if(which & ::std::ios_base::out) if(which & ::std::ios_base::out)
return pos_type(off_type(-1)); return pos_type(off_type(-1));
std::ptrdiff_t size = this->egptr() - this->eback(); std::ptrdiff_t size = this->egptr() - this->eback();
@ -612,8 +611,8 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
cat = msgs.open(regex_message_catalogue, l); cat = msgs.open(regex_message_catalogue, l);
if(cat < 0) if(cat < 0)
{ {
std::string m("Unable to open message catalog: "); std::string mess("Unable to open message catalog: ");
std::runtime_error err(m + regex_message_catalogue); std::runtime_error err(mess + regex_message_catalogue);
boost::throw_exception(err); boost::throw_exception(err);
} }
} }

View File

@ -419,9 +419,9 @@ void cpp_tests(const basic_regex<C, T, A>& e, bool recurse = true)
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) #if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
if(!recurse) if(!recurse)
{ {
std::basic_string<char_t> s(search_text.begin(), search_text.end()); std::basic_string<char_t> s2(search_text.begin(), search_text.end());
match_results<std::basic_string<char_t>::const_iterator> sm; match_results<std::basic_string<char_t>::const_iterator> sm;
if(regex_search(s, sm, e, static_cast<boost::match_flag_type>(flags[3]))) if(regex_search(s2, sm, e, static_cast<boost::match_flag_type>(flags[3])))
{ {
if(compare_result(sm, m) == false) if(compare_result(sm, m) == false)
{ {
@ -434,8 +434,8 @@ void cpp_tests(const basic_regex<C, T, A>& e, bool recurse = true)
begin_error(); begin_error();
cout << "regex++ API result mismatch in regex_search(const std::string&, match_results&, const basic_regex&, int)" << endl; cout << "regex++ API result mismatch in regex_search(const std::string&, match_results&, const basic_regex&, int)" << endl;
} }
if(!regex_search(s, e, static_cast<boost::match_flag_type>(flags[3])) if(!regex_search(s2, e, static_cast<boost::match_flag_type>(flags[3]))
|| !regex_search(s.begin(), s.end(), e, static_cast<boost::match_flag_type>(flags[3]))) || !regex_search(s2.begin(), s2.end(), e, static_cast<boost::match_flag_type>(flags[3])))
{ {
begin_error(); begin_error();
cout << "regex++ API result mismatch in regex_search(const std::string&, const basic_regex&, int)" << endl; cout << "regex++ API result mismatch in regex_search(const std::string&, const basic_regex&, int)" << endl;
@ -460,7 +460,7 @@ void cpp_tests(const basic_regex<C, T, A>& e, bool recurse = true)
cout << "regex++ API result: match not found when match_partial specified" << endl; cout << "regex++ API result: match not found when match_partial specified" << endl;
} }
} }
if(s.find(char_t(0)) == std::basic_string<char_t>::npos) if(s2.find(char_t(0)) == std::basic_string<char_t>::npos)
{ {
match_results<const char_t*> ssm; match_results<const char_t*> ssm;
if(regex_search(search_text.c_str(), ssm, e, static_cast<boost::match_flag_type>(flags[3]))) if(regex_search(search_text.c_str(), ssm, e, static_cast<boost::match_flag_type>(flags[3])))
@ -505,9 +505,9 @@ void cpp_tests(const basic_regex<C, T, A>& e, bool recurse = true)
begin_error(); begin_error();
cout << "regex++ API result mismatch in regex_match(iterator, iterator, match_results&, const basic_regex&, int)" << endl; cout << "regex++ API result mismatch in regex_match(iterator, iterator, match_results&, const basic_regex&, int)" << endl;
} }
std::basic_string<char_t> s(search_text.begin(), search_text.end()); std::basic_string<char_t> s3(search_text.begin(), search_text.end());
match_results<std::basic_string<char_t>::const_iterator> sm; match_results<std::basic_string<char_t>::const_iterator> sm;
if(regex_match(s, sm, e, static_cast<boost::match_flag_type>(flags[3]))) if(regex_match(s3, sm, e, static_cast<boost::match_flag_type>(flags[3])))
{ {
if(compare_result(sm, m) == false) if(compare_result(sm, m) == false)
{ {
@ -520,7 +520,7 @@ void cpp_tests(const basic_regex<C, T, A>& e, bool recurse = true)
begin_error(); begin_error();
cout << "regex++ API result mismatch in regex_match(const std::string&, match_results&, const basic_regex&, int)" << endl; cout << "regex++ API result mismatch in regex_match(const std::string&, match_results&, const basic_regex&, int)" << endl;
} }
if(s.find(char_t(0)) == std::basic_string<char_t>::npos) if(s3.find(char_t(0)) == std::basic_string<char_t>::npos)
{ {
match_results<const char_t*> ssm; match_results<const char_t*> ssm;
if(regex_match(search_text.c_str(), ssm, e, static_cast<boost::match_flag_type>(flags[3]))) if(regex_match(search_text.c_str(), ssm, e, static_cast<boost::match_flag_type>(flags[3])))