Fixed IA64 compatibility warnings from VC7, mainly changed unsigned int's to size_t and int's to ptrdiff_t.

[SVN r13223]
This commit is contained in:
John Maddock
2002-03-19 11:29:50 +00:00
parent 1d3653812a
commit b4cf815f7d
7 changed files with 71 additions and 52 deletions

View File

@ -711,7 +711,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
const charT* base = first;
// this is only used for the switch(), but cannot be folded in
// 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(first, last);
switch(inner_set)
{
case traits_type::syntax_colon:
@ -758,7 +758,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
//
if(traits_inst.lookup_collatename(s, base+2, first-2))
{
unsigned len = s.size();
std::size_t len = s.size();
if(len)
{
unsigned i = 0;
@ -936,7 +936,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
char_set_literal:
unsigned i = 0;
// get string length to stop us going past the end of string (DWA)
unsigned len = s.size();
std::size_t len = s.size();
while(i < len)
{
s[i] = traits_inst.translate(s[i], (_flags & regbase::icase));
@ -989,7 +989,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
{
++csingles;
const traits_string_type& s = singles.peek();
unsigned len = (s.size() + 1) * sizeof(charT);
std::size_t len = (s.size() + 1) * sizeof(charT);
std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
singles.pop();
}
@ -1023,7 +1023,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
return 0;
}
++cranges;
unsigned len = (re_detail::re_strlen(c1.c_str()) + 1) * sizeof(charT);
std::size_t len = (re_detail::re_strlen(c1.c_str()) + 1) * sizeof(charT);
std::memcpy(data.extend(len), c1.c_str(), len);
len = (re_detail::re_strlen(c2.c_str()) + 1) * sizeof(charT);
std::memcpy(data.extend(len), c2.c_str(), len);
@ -1037,7 +1037,7 @@ re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Alloca
{
++cequivalents;
const traits_string_type& s = equivalents.peek();
unsigned len = (re_detail::re_strlen(s.c_str()) + 1) * sizeof(charT);
std::size_t len = (re_detail::re_strlen(s.c_str()) + 1) * sizeof(charT);
std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
equivalents.pop();
}
@ -1272,9 +1272,9 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
const charT* ptr = p;
marks = 0;
re_detail::jstack<unsigned int, 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());
unsigned int last_mark_popped = 0;
std::size_t last_mark_popped = 0;
register traits_size_type c;
register re_detail::re_syntax_base* dat;
@ -1635,7 +1635,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
repeat_jump:
{
unsigned offset;
std::ptrdiff_t offset;
if(dat == 0)
{
fail(REG_BADRPT);
@ -1776,7 +1776,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
static_cast<re_detail::re_jump*>(dat)->alt.i = INT_MAX/2;
// now work out where to insert:
unsigned int offset = 0;
std::size_t offset = 0;
if(mark.empty() == false)
{
// we have a '(' or '|' to go back to:

View File

@ -40,10 +40,10 @@ namespace boost{
template <class charT>
struct kmp_info
{
unsigned int size;
unsigned int len;
std::size_t size;
std::size_t len;
const charT* pstr;
int kmp_next[1];
std::ptrdiff_t kmp_next[1];
};
template <class charT, class Allocator>
@ -57,11 +57,11 @@ template <class iterator, class charT, class Trans, class Allocator>
kmp_info<charT>* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a)
{
typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
int i, j, m;
std::ptrdiff_t i, j, m;
i = 0;
m = boost::re_detail::distance(first, last);
++m;
unsigned int size = sizeof(kmp_info<charT>) + sizeof(int)*m + sizeof(charT)*m;
std::size_t size = sizeof(kmp_info<charT>) + sizeof(int)*m + sizeof(charT)*m;
--m;
//
// allocate struct and fill it in:

View File

@ -254,7 +254,7 @@ struct access_t : public reg_expression<charT, traits, Allocator>
{ return base_type::first(b); }
static const unsigned char* get_map(const base_type& b)
{ return base_type::get_map(b); }
static unsigned int leading_length(const base_type& b)
static std::size_t leading_length(const base_type& b)
{ return base_type::leading_length(b); }
static const kmp_info<charT>* get_kmp(const base_type& b)
{ return base_type::get_kmp(b); }
@ -1052,10 +1052,10 @@ void _skip_and_inc(unsigned int& clines, iterator& last_line, iterator& first, c
}
template <class iterator>
void _skip_and_dec(unsigned int& clines, iterator& last_line, iterator& first, iterator base, unsigned int len)
void _skip_and_dec(unsigned int& clines, iterator& last_line, iterator& first, iterator base, std::size_t len)
{
bool need_line = false;
for(unsigned int i = 0; i < len; ++i)
for(std::size_t i = 0; i < len; ++i)
{
--first;
if(*first == '\n')
@ -1257,9 +1257,9 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
case regbase::restart_fixed_lit:
{
const kmp_info<charT>* info = access::get_kmp(e);
int len = info->len;
std::ptrdiff_t len = info->len;
const charT* x = info->pstr;
int j = 0;
std::ptrdiff_t j = 0;
bool icase = e.flags() & regbase::icase;
while (first != last)
{