From 0b582e974f0815fe9195457c5aad87b374466614 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 21 Dec 2000 17:17:45 +0000 Subject: [PATCH] Kill some warnings about converting negative numbers to unsigned types [SVN r8486] --- src/c_regex_traits.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index c781778d..dbeea2f5 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -701,7 +701,7 @@ int BOOST_RE_CALL c_regex_traits::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::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;