Minor doc typo fixes.

Fixed IA64 portability warnings from VC7


[SVN r13225]
This commit is contained in:
John Maddock
2002-03-19 11:31:52 +00:00
parent b4cf815f7d
commit 1d560fae85
11 changed files with 100 additions and 91 deletions

View File

@ -206,7 +206,7 @@ the resource dll, <i>before</i> your code compiles any regular
expressions (but not necessarily before you construct any <i>reg_expression</i>
instances): </p>
<p>boost::w32_regex_traits&lt;char&gt;::set_message_calalogue(&quot;mydll.dll&quot;);
<p>boost::w32_regex_traits&lt;char&gt;::set_message_catalogue(&quot;mydll.dll&quot;);
</p>
<p>Note that this API sets the dll name for <i>both</i> the
@ -239,7 +239,7 @@ the message catalogue, <i>before</i> your code compiles any
regular expressions (but not necessarily before you construct any
<i>reg_expression</i> instances): </p>
<p>boost::c_regex_traits&lt;char&gt;::set_message_calalogue(&quot;mycatalogue&quot;);
<p>boost::c_regex_traits&lt;char&gt;::set_message_catalogue(&quot;mycatalogue&quot;);
</p>
<p>Note that this API sets the dll name for <i>both</i> the
@ -276,7 +276,7 @@ the message catalogue, <i>before</i> your code compiles any
regular expressions (but not necessarily before you construct any
<i>reg_expression</i> instances): </p>
<p>boost::cpp_regex_traits&lt;char&gt;::set_message_calalogue(&quot;mycatalogue&quot;);
<p>boost::cpp_regex_traits&lt;char&gt;::set_message_catalogue(&quot;mycatalogue&quot;);
</p>
<p>Note that calling reg_expression&lt;&gt;::imbue will

View File

@ -179,12 +179,12 @@ std::list<syntax_map_t>* syntax;
#endif
unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsigned int id);
std::size_t BOOST_REGEX_CALL _re_get_message(char* buf, std::size_t len, std::size_t id);
template <class charT>
unsigned int BOOST_REGEX_CALL re_get_message(charT* buf, unsigned int len, unsigned int id)
std::size_t BOOST_REGEX_CALL re_get_message(charT* buf, std::size_t len, std::size_t id)
{
unsigned int size = _re_get_message(static_cast<char*>(0), 0, id);
std::size_t size = _re_get_message(static_cast<char*>(0), 0, id);
if(len < size)
return size;
boost::scoped_array<char> cb(new char[size]);
@ -193,7 +193,7 @@ unsigned int BOOST_REGEX_CALL re_get_message(charT* buf, unsigned int len, unsig
return size;
}
inline unsigned int BOOST_REGEX_CALL re_get_message(char* buf, unsigned int len, unsigned int id)
inline std::size_t BOOST_REGEX_CALL re_get_message(char* buf, std::size_t len, std::size_t id)
{
return _re_get_message(buf, len, id);
}
@ -307,7 +307,7 @@ void BOOST_REGEX_CALL re_update_collate()
}
}
unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsigned int id)
std::size_t BOOST_REGEX_CALL _re_get_message(char* buf, std::size_t len, std::size_t id)
{
BOOST_RE_GUARD_STACK
// get the customised message if any:
@ -317,7 +317,7 @@ unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsig
const char* m = catgets(message_cat, 0, id, 0);
if(m)
{
unsigned int size = std::strlen(m) + 1;
std::size_t size = std::strlen(m) + 1;
if(size > len)
return size;
std::strcpy(buf, m);
@ -430,7 +430,7 @@ const char* BOOST_REGEX_CALL re_get_error_str(unsigned int id)
namespace boost{
namespace re_detail{
char c_traits_base::regex_message_catalogue[200] = {0};
char c_traits_base::regex_message_catalogue[BOOST_REGEX_MAX_PATH] = {0};
std::string BOOST_REGEX_CALL c_traits_base::error_string(unsigned id)
{
@ -576,7 +576,7 @@ bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(std::basic_str
{
BOOST_RE_GUARD_STACK
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
std::string t_out;
@ -808,7 +808,7 @@ bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::do_lookup_collate(std::basic_stri
{
BOOST_RE_GUARD_STACK
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
std::string t_out;
@ -1018,28 +1018,28 @@ int BOOST_REGEX_CALL c_regex_traits<wchar_t>::toi(const wchar_t*& first, const w
boost::uint_fast32_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_classname(const wchar_t* first, const wchar_t* last)
{
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
len = do_lookup_class(buf.get());
return len;
boost::uint_fast32_t result = do_lookup_class(buf.get());
return result;
}
c_regex_traits<wchar_t> c_regex_traits<wchar_t>::init_;
unsigned int BOOST_REGEX_CALL c_regex_traits<wchar_t>::strnarrow(char *s1, unsigned int len, const wchar_t *s2)
std::size_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::strnarrow(char *s1, std::size_t len, const wchar_t *s2)
{
BOOST_RE_GUARD_STACK
unsigned int size = std::wcslen(s2) + 1;
std::size_t size = std::wcslen(s2) + 1;
if(size > len)
return size;
return std::wcstombs(s1, s2, len);
}
unsigned int BOOST_REGEX_CALL c_regex_traits<wchar_t>::strwiden(wchar_t *s1, unsigned int len, const char *s2)
std::size_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::strwiden(wchar_t *s1, std::size_t len, const char *s2)
{
BOOST_RE_GUARD_STACK
unsigned int size = std::strlen(s2) + 1;
std::size_t size = std::strlen(s2) + 1;
if(size > len)
return size;
size = std::mbstowcs(s1, s2, len);

View File

@ -199,7 +199,7 @@ const mss default_messages[] = {
{ 0, "", },
};
BOOST_REGEX_DECL unsigned int BOOST_REGEX_CALL re_get_default_message(char* buf, unsigned int len, unsigned int id)
BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id)
{
BOOST_RE_GUARD_STACK
const mss* pm = default_messages;
@ -207,7 +207,7 @@ BOOST_REGEX_DECL unsigned int BOOST_REGEX_CALL re_get_default_message(char* buf,
{
if(pm->id == id)
{
unsigned int size = re_strlen(pm->what) + 1;
std::size_t size = re_strlen(pm->what) + 1;
if(size > len)
return size;
re_strcpy(buf, pm->what);

View File

@ -116,10 +116,11 @@ template<class charT, class traits>
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)
{
typedef typename parser_buf<charT, traits>::pos_type pos_type;
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
int size = this->egptr() - this->eback();
int pos = this->gptr() - this->eback();
std::ptrdiff_t size = this->egptr() - this->eback();
std::ptrdiff_t pos = this->gptr() - this->eback();
charT* g = this->eback();
switch(way)
{
@ -135,14 +136,14 @@ parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, :
this->setg(g, g + size - off, g + size);
case ::std::ios_base::cur:
{
int newpos = pos + off;
std::ptrdiff_t newpos = pos + off;
if((newpos < 0) || (newpos > size))
return pos_type(off_type(-1));
else
this->setg(g, g + newpos, g + size);
}
}
return this->gptr() - this->eback();
return static_cast<pos_type>(this->gptr() - this->eback());
}
template<class charT, class traits>
@ -151,7 +152,7 @@ parser_buf<charT, traits>::seekpos(pos_type sp, ::std::ios_base::openmode which)
{
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
int size = this->egptr() - this->eback();
std::ptrdiff_t size = this->egptr() - this->eback();
charT* g = this->eback();
if(sp <= size)
{
@ -171,7 +172,7 @@ struct message_data<char>
{
unsigned char syntax_map[CHAR_MAX-CHAR_MIN];
std::map<std::string, std::string, std::less<std::string> > collating_elements;
std::map<std::string, unsigned long, std::less<std::string> > classes;
std::map<std::string, std::size_t, std::less<std::string> > classes;
//std::string _zero;
//std::string _ten;
parser_buf<char> sbuf;
@ -209,10 +210,10 @@ message_data<char>::message_data(const std::locale& l, const std::string& regex_
}
#endif
std::memset(syntax_map, cpp_regex_traits<char>::syntax_char, 256);
unsigned int i;
unsigned i;
scoped_array<char> a;
unsigned array_size = 0;
unsigned new_size;
std::size_t array_size = 0;
std::size_t new_size;
for(i = 1; i < cpp_regex_traits<char>::syntax_max; ++i)
{
new_size = re_get_default_message(0, 0, i+100);
@ -227,7 +228,7 @@ message_data<char>::message_data(const std::locale& l, const std::string& regex_
if((int)cat >= 0)
s = pm->get(cat, 0, i+100, s);
#endif
for(unsigned int j = 0; j < s.size(); ++j)
for(std::size_t j = 0; j < s.size(); ++j)
{
syntax_map[s[j]] = (unsigned char)(i);
}
@ -290,7 +291,7 @@ std::string BOOST_REGEX_CALL cpp_regex_traits_base::set_message_catalogue(const
return old;
}
char cpp_regex_traits_base::regex_message_cat[200] = {0};
char cpp_regex_traits_base::regex_message_cat[BOOST_REGEX_MAX_PATH] = {0};
} // namespace re_detail
@ -343,7 +344,7 @@ int BOOST_REGEX_CALL cpp_regex_traits<char>::toi(char c)const
int BOOST_REGEX_CALL cpp_regex_traits<char>::toi(const char*& first, const char* last, int radix)const
{
pmd->sbuf.pubsetbuf(const_cast<char*>(first), last-first);
pmd->sbuf.pubsetbuf(const_cast<char*>(first), static_cast<std::streamsize>(last-first));
pmd->is.clear();
if(std::abs(radix) == 16) pmd->is >> std::hex;
else if(std::abs(radix) == 8) pmd->is >> std::oct;
@ -364,7 +365,7 @@ boost::uint_fast32_t BOOST_REGEX_CALL cpp_regex_traits<char>::lookup_classname(c
unsigned int i;
std::string s(first, last);
std::map<std::string, unsigned long, std::less<std::string> >::const_iterator pos = pmd->classes.find(s);
std::map<std::string, std::size_t, std::less<std::string> >::const_iterator pos = pmd->classes.find(s);
if(pos != pmd->classes.end())
return re_char_class_id[(*pos).second];
@ -445,7 +446,7 @@ namespace re_detail{
std::string BOOST_REGEX_CALL to_narrow(const std::basic_string<wchar_t>& is, const std::codecvt<wchar_t, char, std::mbstate_t>& cvt)
{
BOOST_RE_GUARD_STACK
unsigned int bufsize = is.size() * 2;
std::basic_string<wchar_t>::size_type bufsize = is.size() * 2;
//
// declare buffer first as VC6 workaround for internal compiler error!
char* pc = new char[bufsize];
@ -484,8 +485,8 @@ std::string BOOST_REGEX_CALL to_narrow(const std::basic_string<wchar_t>& is, con
std::wstring BOOST_REGEX_CALL to_wide(const std::string& is, const std::codecvt<wchar_t, char, std::mbstate_t>& cvt)
{
BOOST_RE_GUARD_STACK
unsigned int bufsize = is.size() + 2;
unsigned int maxsize = is.size() * 100;
std::string::size_type bufsize = is.size() + 2;
std::string::size_type maxsize = is.size() * 100;
//
// declare buffer first as VC6 workaround for internal compiler error!
wchar_t* pc = new wchar_t[bufsize];
@ -547,7 +548,7 @@ struct message_data<wchar_t>
};
std::list<syntax_map> syntax;
std::map<string_type, unsigned long> classes;
std::map<string_type, std::size_t> classes;
std::map<string_type, string_type> collating_elements;
unsigned char syntax_[CHAR_MAX-CHAR_MIN+1];
@ -586,9 +587,9 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
}
#endif
scoped_array<char> a;
unsigned array_size = 0;
unsigned new_size;
unsigned int i;
std::size_t array_size = 0;
std::size_t new_size;
std::size_t i;
std::memset(syntax_, cpp_regex_traits<wchar_t>::syntax_char, sizeof(syntax_));
for(i = 1; i < cpp_regex_traits<wchar_t>::syntax_max; ++i)
{
@ -603,7 +604,7 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
string_type s = to_wide(ns, cvt);
#ifndef BOOST_NO_STD_MESSAGES
if((int)cat >= 0)
s = BOOST_USE_FACET(std::messages<wchar_t>, l).get(cat, 0, i+100, s);
s = BOOST_USE_FACET(std::messages<wchar_t>, l).get(cat, 0, (int)i+100, s);
#endif
for(unsigned int j = 0; j < s.size(); ++j)
{
@ -612,7 +613,7 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
else
{
m.c = s[j];
m.type = i;
m.type = static_cast<unsigned int>(i);
syntax.push_back(m);
}
}
@ -624,7 +625,7 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
i = 400;
if((int)cat >= 0)
{
c2 = msgs.get(cat, 0, i, c1);
c2 = msgs.get(cat, 0, (int)i, c1);
while(c2.size())
{
const wchar_t* p1, *p2, *p3, *p4;;
@ -639,7 +640,7 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
collating_elements[std::basic_string<wchar_t>(p1, p2)] = std::basic_string<wchar_t>(p3, p4);
++i;
c2 = msgs.get(cat, 0, i, c1);
c2 = msgs.get(cat, 0, (int)i, c1);
}
}
@ -648,13 +649,13 @@ message_data<wchar_t>::message_data(const std::locale& l, const std::string& reg
c2.erase();
for(i = 0; i < re_classes_max; ++i)
{
c1 = msgs.get(cat, 0, i+300, c2);
c1 = msgs.get(cat, 0, static_cast<int>(i+300), c2);
if(c1.size())
classes[c1] = i;
}
for(i = 0; i <= boost::REG_E_UNKNOWN ; ++i)
{
c1 = msgs.get(cat, 0, i+200, c2);
c1 = msgs.get(cat, 0, static_cast<int>(i+200), c2);
error_strings[i] = to_narrow(c1, cvt);
}
}
@ -720,7 +721,7 @@ int BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::toi(wchar_t c)const
int BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::toi(const wchar_t*& first, const wchar_t* last, int radix)const
{
pmd->sbuf.pubsetbuf(const_cast<wchar_t*>(first), last-first);
pmd->sbuf.pubsetbuf(const_cast<wchar_t*>(first), static_cast<std::streamsize>(last-first));
pmd->is.clear();
if(std::abs(radix) == 16) pmd->is >> std::hex;
else if(std::abs(radix) == 8) pmd->is >> std::oct;
@ -741,7 +742,7 @@ boost::uint_fast32_t BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::lookup_classnam
unsigned int i;
std::wstring s(first, last);
std::map<std::wstring, unsigned long>::const_iterator pos = pmd->classes.find(s);
std::map<std::wstring, std::size_t>::const_iterator pos = pmd->classes.find(s);
if(pos != pmd->classes.end())
return re_char_class_id[(*pos).second];
@ -831,7 +832,7 @@ cpp_regex_traits<wchar_t>::locale_type BOOST_REGEX_CALL cpp_regex_traits<wchar_t
return old_l;
}
unsigned int BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::strwiden(wchar_t *s1, unsigned int len, const char *s2)const
std::size_t BOOST_REGEX_CALL cpp_regex_traits<wchar_t>::strwiden(wchar_t *s1, std::size_t len, const char *s2)const
{
std::string s(s2);
std::wstring ws = re_detail::to_wide(s2, *pcdv);

View File

@ -39,7 +39,7 @@ namespace boost{
// we need to instantiate the vector classes we use
// since declaring a reference to type doesn't seem to
// do the job...
std::vector<unsigned int> inst1;
std::vector<std::size_t> inst1;
std::vector<std::string> inst2;
#endif
#endif
@ -84,7 +84,7 @@ public:
unsigned line;
mapfile::iterator fbase;
std::map<int, std::string, std::less<int> > strings;
std::map<int, int, std::less<int> > positions;
std::map<int, std::ptrdiff_t, std::less<int> > positions;
void update();
void clean();
RegExData() : e(), m(), fm(), t(type_copy), pbase(0), line(0), fbase(), strings(), positions() {}
@ -283,21 +283,21 @@ unsigned int RegEx::Grep(std::vector<std::string>& v, const char* p, unsigned in
namespace re_detail{
struct pred3
{
std::vector<unsigned int>& v;
std::vector<std::size_t>& v;
const char* base;
RegEx* pe;
pred3(std::vector<unsigned int>& o, const char* pb, RegEx* p) : v(o), base(pb), pe(p) {}
pred3(std::vector<std::size_t>& o, const char* pb, RegEx* p) : v(o), base(pb), pe(p) {}
bool operator()(const cmatch& m)
{
pe->pdata->m = m;
v.push_back(m[0].first - base);
v.push_back(static_cast<std::size_t>(m[0].first - base));
return true;
}
private:
pred3& operator=(const pred3&);
};
}
unsigned int RegEx::Grep(std::vector<unsigned int>& v, const char* p, unsigned int flags)
unsigned int RegEx::Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
@ -452,7 +452,7 @@ std::string RegEx::Merge(const char* in, const char* fmt,
return result;
}
unsigned int RegEx::Split(std::vector<std::string>& v,
std::size_t RegEx::Split(std::vector<std::string>& v,
std::string& s,
unsigned flags,
unsigned max_count)
@ -465,7 +465,7 @@ unsigned int RegEx::Split(std::vector<std::string>& v,
//
// now operators for returning what matched in more detail:
//
unsigned int RegEx::Position(int i)const
std::size_t RegEx::Position(int i)const
{
BOOST_RE_GUARD_STACK
switch(pdata->t)
@ -509,7 +509,7 @@ unsigned int RegEx::Marks()const
}
unsigned int RegEx::Length(int i)const
std::size_t RegEx::Length(int i)const
{
BOOST_RE_GUARD_STACK
switch(pdata->t)

View File

@ -103,10 +103,10 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char
}
BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, unsigned int buf_size)
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, regsize_t buf_size)
{
BOOST_RE_GUARD_STACK
unsigned int result = 0;
std::size_t result = 0;
if(code & REG_ITOA)
{
code &= ~REG_ITOA;
@ -149,7 +149,7 @@ BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorA(int code, const regex_
boost::regex_traits<char> t;
p = t.error_string(code);
}
unsigned int len = p.size();
std::size_t len = p.size();
if(len < buf_size)
{
std::strcpy(buf, p.c_str());
@ -161,7 +161,7 @@ BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorA(int code, const regex_
return 0;
}
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, const char* buf, unsigned int n, regmatch_t* array, int eflags)
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, const char* buf, regsize_t n, regmatch_t* array, int eflags)
{
BOOST_RE_GUARD_STACK
bool result = false;

View File

@ -161,12 +161,12 @@ std::list<syntax_map_t>* syntax;
#endif
unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsigned int id);
std::size_t BOOST_REGEX_CALL _re_get_message(char* buf, std::size_t len, unsigned id);
template <class charT>
unsigned int BOOST_REGEX_CALL get_message(charT* buf, unsigned int len, unsigned int id)
std::size_t BOOST_REGEX_CALL get_message(charT* buf, std::size_t len, unsigned id)
{
unsigned int size = _re_get_message(static_cast<char*>(0), 0, id);
std::size_t size = _re_get_message(static_cast<char*>(0), 0, id);
if(len < size)
return size;
boost::scoped_array<char> cb(new char[size]);
@ -175,18 +175,18 @@ unsigned int BOOST_REGEX_CALL get_message(charT* buf, unsigned int len, unsigned
return size;
}
inline unsigned int BOOST_REGEX_CALL get_message(char* buf, unsigned int len, unsigned int id)
inline std::size_t BOOST_REGEX_CALL get_message(char* buf, std::size_t len, unsigned id)
{
return _re_get_message(buf, len, id);
}
unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsigned int id)
std::size_t BOOST_REGEX_CALL _re_get_message(char* buf, std::size_t len, unsigned id)
{
BOOST_RE_GUARD_STACK
// get the customised message if any:
if(len < 255)
return 255;
unsigned int size = 0;
std::size_t size = 0;
if(hresmod)
size = LoadStringA(hresmod, BOOST_RE_MESSAGE_BASE + id, buf, 255);
if(size)
@ -223,7 +223,7 @@ namespace boost{
namespace re_detail{
char w32_traits_base::regex_message_catalogue[200] = {0};
char w32_traits_base::regex_message_catalogue[BOOST_REGEX_MAX_PATH] = {0};
void BOOST_REGEX_CALL w32_traits_base::do_init()
{
@ -514,7 +514,7 @@ void BOOST_REGEX_CALL w32_regex_traits<char>::transform(std::string& out, const
return;
}
scoped_array<char> buf(new char[n+1]);
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, buf.get(), n);
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, buf.get(), (int)n);
if(n == (size_t)(-1))
{
out = in;
@ -582,7 +582,7 @@ bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::lookup_collatename(std::basic_s
{
BOOST_RE_GUARD_STACK
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
std::string t_out;
@ -622,7 +622,7 @@ bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::do_lookup_collate(std::basic_st
{
BOOST_RE_GUARD_STACK
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
std::string t_out;
@ -712,9 +712,9 @@ void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::transform(std::basic_string<wch
// the sort order remains unchanged when we compare.
scoped_array<char> t(new char[n+1]);
if(isPlatformNT)
n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, reinterpret_cast<wchar_t*>(t.get()), n);
n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, reinterpret_cast<wchar_t*>(t.get()), (int)n);
else
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, alt.get(), -1, t.get(), n);
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, alt.get(), -1, t.get(), (int)n);
int i = -1;
do
{
@ -785,11 +785,11 @@ int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::toi(const wchar_t*& first, const
boost::uint_fast32_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::lookup_classname(const wchar_t* first, const wchar_t* last)
{
std::basic_string<wchar_t> s(first, last);
unsigned int len = strnarrow(static_cast<char*>(0), 0, s.c_str());
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
len = do_lookup_class(buf.get());
return len;
boost::uint_fast32_t result = do_lookup_class(buf.get());
return result;
}
wchar_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::wtolower(wchar_t c)
@ -803,22 +803,22 @@ wchar_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::wtolower(wchar_t c)
w32_regex_traits<wchar_t> w32_regex_traits<wchar_t>::init_;
unsigned int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strnarrow(char *s1, unsigned int len, const wchar_t *s2)
std::size_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strnarrow(char *s1, std::size_t len, const wchar_t *s2)
{
BOOST_RE_GUARD_STACK
unsigned int size = WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, 0, 0, 0);
std::size_t size = WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, 0, 0, 0);
if(size > len)
return size;
return WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, len, 0, 0);
return WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, (int)len, 0, 0);
}
unsigned int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strwiden(wchar_t *s1, unsigned int len, const char *s2)
std::size_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strwiden(wchar_t *s1, std::size_t len, const char *s2)
{
BOOST_RE_GUARD_STACK
unsigned int size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, 0);
std::size_t size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, 0);
if(size > len)
return size;
return MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, len);
return MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, (int)len);
}
unsigned short w32_regex_traits<wchar_t>::wide_unicode_classes[] = {

View File

@ -111,10 +111,10 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
}
BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, unsigned int buf_size)
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, regsize_t buf_size)
{
BOOST_RE_GUARD_STACK
unsigned int result = 0;
std::size_t result = 0;
if(code & REG_ITOA)
{
code &= ~REG_ITOA;
@ -157,7 +157,7 @@ BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorW(int code, const regex_
pt = &static_cast<wregex*>(e->guts)->get_traits();
(void)pt; // warning suppression
std::string p = pt->error_string(code);
unsigned int len = pt->strwiden(static_cast<wchar_t*>(0), 0, p.c_str());
std::size_t len = pt->strwiden(static_cast<wchar_t*>(0), 0, p.c_str());
if(len < buf_size)
{
pt->strwiden(buf, buf_size, p.c_str());
@ -169,7 +169,7 @@ BOOST_REGEX_DECL unsigned int BOOST_REGEX_CCALL regerrorW(int code, const regex_
return 0;
}
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, const wchar_t* buf, unsigned int n, regmatch_t* array, int eflags)
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, const wchar_t* buf, regsize_t n, regmatch_t* array, int eflags)
{
BOOST_RE_GUARD_STACK
bool result = false;

View File

@ -462,7 +462,7 @@ for a container of <i>charT</i>. </p>
</i></font>&nbsp;&nbsp; Allocator get_allocator()<b>const</b>;
<font color="#000080">&nbsp;&nbsp; <i>//
</i>&nbsp;&nbsp; <i>// locale:
</i></font>&nbsp;&nbsp; locale_type imbue(<b>const</b> locale_type&amp; l);
</i></font>&nbsp;&nbsp; locale_type imbue(locale_type l);
&nbsp;&nbsp; locale_type getloc()<b>const</b>;
<font color="#000080"><i>&nbsp;&nbsp; //
</i>&nbsp;&nbsp; <i>// flags:

View File

@ -45,6 +45,10 @@ using std::endl;
#if defined(TEST_UNICODE)
#ifdef BOOST_NO_WREGEX
#error "Wide character support is not enabled in regex lib - can't build wide character test program"
#endif
#ifdef __GNUC__
#define char_t wchar_t
#else
@ -410,6 +414,10 @@ __iterator_category(const debug_iterator<T>&) {
}
#endif
#if defined(_WIN32) && !defined(BOOST_RE_TEST_LOCALE_CPP) && !defined(BOOST_RE_TEST_LOCALE_C) && !defined(BOOST_RE_TEST_LOCALE_W32)
#define BOOST_RE_TEST_LOCALE_W32
#endif
#ifdef BOOST_RE_TEST_LOCALE_W32
typedef boost::reg_expression<char_t, boost::w32_regex_traits<char_t>, jm_debug_alloc> re_type;

View File

@ -147,7 +147,7 @@ public:
template <class iterator, class Alloc>
bool grep_test_predicate<iterator, Alloc>::operator()(const boost::match_results< iterator, Alloc >& m)
{
int start, end;
std::ptrdiff_t start, end;
start = m[0].first - base;
end = m[0].second - base;
if((matches[match_id] != start) || (matches[match_id + 1] != end))
@ -452,7 +452,7 @@ __cdecl
#endif
hl_grep_test_proc(const RegEx& e)
{
int start, end;
std::ptrdiff_t start, end;
start = e.Position(0);
end = start + e.Length();