Add some casts to suppress GCC warnings.

[SVN r82662]
This commit is contained in:
John Maddock
2013-01-28 19:19:56 +00:00
parent 4162776575
commit 1f24ceed4c

View File

@ -3,12 +3,12 @@
* Copyright (c) 2004 * Copyright (c) 2004
* John Maddock * John Maddock
* *
* Use, modification and distribution are subject to the * Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file * Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
* *
*/ */
/* /*
* LOCATION: see http://www.boost.org for most recent version. * LOCATION: see http://www.boost.org for most recent version.
* FILE regex_traits_defaults.hpp * FILE regex_traits_defaults.hpp
@ -85,7 +85,7 @@ inline bool is_combining<unsigned char>(unsigned char)
return false; return false;
} }
#if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives #if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives
#ifdef _MSC_VER #ifdef _MSC_VER
template<> template<>
inline bool is_combining<wchar_t>(wchar_t c) inline bool is_combining<wchar_t>(wchar_t c)
{ {
@ -115,11 +115,11 @@ template <class charT>
inline bool is_separator(charT c) inline bool is_separator(charT c)
{ {
return BOOST_REGEX_MAKE_BOOL( return BOOST_REGEX_MAKE_BOOL(
(c == static_cast<charT>('\n')) (c == static_cast<charT>('\n'))
|| (c == static_cast<charT>('\r')) || (c == static_cast<charT>('\r'))
|| (c == static_cast<charT>('\f')) || (c == static_cast<charT>('\f'))
|| (static_cast<boost::uint16_t>(c) == 0x2028u) || (static_cast<boost::uint16_t>(c) == 0x2028u)
|| (static_cast<boost::uint16_t>(c) == 0x2029u) || (static_cast<boost::uint16_t>(c) == 0x2029u)
|| (static_cast<boost::uint16_t>(c) == 0x85u)); || (static_cast<boost::uint16_t>(c) == 0x85u));
} }
template <> template <>
@ -177,7 +177,7 @@ int get_default_class_id(const charT* p1, const charT* p2)
'x', 'd', 'i', 'g', 'i', 't', 'x', 'd', 'i', 'g', 'i', 't',
}; };
static const character_pointer_range<charT> ranges[21] = static const character_pointer_range<charT> ranges[21] =
{ {
{data+0, data+5,}, // alnum {data+0, data+5,}, // alnum
{data+5, data+10,}, // alpha {data+5, data+10,}, // alpha
@ -203,7 +203,7 @@ int get_default_class_id(const charT* p1, const charT* p2)
}; };
static const character_pointer_range<charT>* ranges_begin = ranges; static const character_pointer_range<charT>* ranges_begin = ranges;
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0])); static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
character_pointer_range<charT> t = { p1, p2, }; character_pointer_range<charT> t = { p1, p2, };
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t); const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
if((p != ranges_end) && (t == *p)) if((p != ranges_end) && (t == *p))
@ -324,15 +324,15 @@ inline const charT* get_escape_R_string()
# pragma warning(push) # pragma warning(push)
# pragma warning(disable:4309 4245) # pragma warning(disable:4309 4245)
#endif #endif
static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?', static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}', '|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), '\\', 'x', '{', '2', '0', '2', '8', '}',
'\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' }; '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' };
static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' }; '|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), ']', ')', '\0' };
charT c = static_cast<charT>(0x2029u); charT c = static_cast<charT>(0x2029u);
bool b = (static_cast<unsigned>(c) == 0x2029u); bool b = (static_cast<unsigned>(c) == 0x2029u);
return (b ? e1 : e2); return (b ? e1 : e2);
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(pop) # pragma warning(pop)
@ -346,7 +346,7 @@ inline const char* get_escape_R_string<char>()
# pragma warning(push) # pragma warning(push)
# pragma warning(disable:4309) # pragma warning(disable:4309)
#endif #endif
static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' }; '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
return e2; return e2;
#ifdef BOOST_MSVC #ifdef BOOST_MSVC