Kill some warnings about converting negative numbers to unsigned types

[SVN r8486]
This commit is contained in:
Dave Abrahams
2000-12-21 17:17:45 +00:00
parent 72caa3f9ca
commit 0b582e974f

View File

@ -701,7 +701,7 @@ int BOOST_RE_CALL c_regex_traits<char>::toi(const char*& first, const char* last
// if radix is less than zero, then restrict
// return value to charT. NB assumes sizeof(charT) <= sizeof(int)
radix *= -1;
maxval = 1 << (sizeof(*first) * CHAR_BIT - 1);
maxval = 1u << (sizeof(*first) * CHAR_BIT - 1);
maxval /= radix;
maxval *= 2;
maxval -= 1;
@ -954,7 +954,7 @@ int BOOST_RE_CALL c_regex_traits<wchar_t>::toi(const wchar_t*& first, const wcha
// if radix is less than zero, then restrict
// return value to charT. NB assumes sizeof(charT) <= sizeof(int)
radix *= -1;
maxval = 1 << (sizeof(*first) * CHAR_BIT - 1);
maxval = 1u << (sizeof(*first) * CHAR_BIT - 1);
maxval /= radix;
maxval *= 2;
maxval -= 1;