mirror of
https://github.com/boostorg/regex.git
synced 2025-07-05 16:46:31 +02:00
changed all pointer casts to explicit static_cast or reinterpret_cast.
Added more tests for forward lookahead asserts. [SVN r12575]
This commit is contained in:
@ -165,7 +165,7 @@ unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsig
|
||||
template <class charT>
|
||||
unsigned int BOOST_REGEX_CALL get_message(charT* buf, unsigned int len, unsigned int id)
|
||||
{
|
||||
unsigned int size = _re_get_message((char*)0, 0, id);
|
||||
unsigned int size = _re_get_message(static_cast<char*>(0), 0, id);
|
||||
if(len < size)
|
||||
return size;
|
||||
boost::scoped_array<char> cb(new char[size]);
|
||||
@ -577,7 +577,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((char*)0, 0, s.c_str());
|
||||
unsigned int 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;
|
||||
@ -587,7 +587,7 @@ bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::lookup_collatename(std::basic_s
|
||||
{
|
||||
if(t_out[0])
|
||||
{
|
||||
len = strwiden((wchar_t*)0, 0, t_out.c_str());
|
||||
len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
|
||||
scoped_array<wchar_t> wb(new wchar_t[len]);
|
||||
strwiden(wb.get(), len, t_out.c_str());
|
||||
out = wb.get();
|
||||
@ -606,7 +606,7 @@ unsigned int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::syntax_type(size_type c
|
||||
last = syntax->end();
|
||||
while(first != last)
|
||||
{
|
||||
if((uchar_type)(*first).c == c)
|
||||
if((size_type)(uchar_type)((*first).c) == c)
|
||||
return (*first).type;
|
||||
++first;
|
||||
}
|
||||
@ -617,14 +617,14 @@ 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((char*)0, 0, s.c_str());
|
||||
unsigned int 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;
|
||||
bool result = base_type::do_lookup_collate(t_out, buf.get());
|
||||
if(result)
|
||||
{
|
||||
len = strwiden((wchar_t*)0, 0, t_out.c_str());
|
||||
len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
|
||||
scoped_array<wchar_t> wb(new wchar_t[len]);
|
||||
strwiden(wb.get(), len, t_out.c_str());
|
||||
out = wb.get();
|
||||
@ -690,7 +690,7 @@ void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::transform(std::basic_string<wch
|
||||
n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, 0, 0);
|
||||
else
|
||||
{
|
||||
n = strnarrow((char*)0, 0, in.c_str());
|
||||
n = strnarrow(static_cast<char*>(0), 0, in.c_str());
|
||||
alt.reset(new char[n+1]);
|
||||
strnarrow(alt.get(), n+1, in.c_str());
|
||||
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, alt.get(), -1, 0, 0);
|
||||
@ -707,7 +707,7 @@ 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, (wchar_t*)t.get(), n);
|
||||
n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, reinterpret_cast<wchar_t*>(t.get()), n);
|
||||
else
|
||||
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, alt.get(), -1, t.get(), n);
|
||||
int i = -1;
|
||||
@ -780,7 +780,7 @@ 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((char*)0, 0, s.c_str());
|
||||
unsigned int 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());
|
||||
@ -791,7 +791,7 @@ wchar_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::wtolower(wchar_t c)
|
||||
{
|
||||
BOOST_RE_GUARD_STACK
|
||||
if(isPlatformNT)
|
||||
return LOWORD(CharLowerW((wchar_t*)(MAKELONG(c, 0))));
|
||||
return LOWORD(CharLowerW(reinterpret_cast<wchar_t*>(static_cast<unsigned short>(c))));
|
||||
return c;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user