summaryrefslogtreecommitdiff
path: root/boost/locale/utf.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/locale/utf.hpp')
-rw-r--r--boost/locale/utf.hpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/boost/locale/utf.hpp b/boost/locale/utf.hpp
index 3bb308a165..f156692ffc 100644
--- a/boost/locale/utf.hpp
+++ b/boost/locale/utf.hpp
@@ -280,23 +280,23 @@ namespace utf {
template<typename Iterator>
static Iterator encode(code_point value,Iterator out)
{
- if(value <=0x7F) {
- *out++ = value;
+ if(value <= 0x7F) {
+ *out++ = static_cast<char_type>(value);
}
- else if(value <=0x7FF) {
- *out++=(value >> 6) | 0xC0;
- *out++=(value & 0x3F) | 0x80;
+ else if(value <= 0x7FF) {
+ *out++ = static_cast<char_type>((value >> 6) | 0xC0);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
- else if(BOOST_LOCALE_LIKELY(value <=0xFFFF)) {
- *out++=(value >> 12) | 0xE0;
- *out++=((value >> 6) & 0x3F) | 0x80;
- *out++=(value & 0x3F) | 0x80;
+ else if(BOOST_LOCALE_LIKELY(value <= 0xFFFF)) {
+ *out++ = static_cast<char_type>((value >> 12) | 0xE0);
+ *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
else {
- *out++=(value >> 18) | 0xF0;
- *out++=((value >> 12) & 0x3F) | 0x80;
- *out++=((value >> 6) & 0x3F) | 0x80;
- *out++=(value & 0x3F) | 0x80;
+ *out++ = static_cast<char_type>((value >> 18) | 0xF0);
+ *out++ = static_cast<char_type>(((value >> 12) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
return out;
}
@@ -380,12 +380,12 @@ namespace utf {
static It encode(code_point u,It out)
{
if(BOOST_LOCALE_LIKELY(u<=0xFFFF)) {
- *out++ = u;
+ *out++ = static_cast<char_type>(u);
}
else {
- u-=0x10000;
- *out++=0xD800 | (u>>10);
- *out++=0xDC00 | (u & 0x3FF);
+ u -= 0x10000;
+ *out++ = static_cast<char_type>(0xD800 | (u>>10));
+ *out++ = static_cast<char_type>(0xDC00 | (u & 0x3FF));
}
return out;
}
@@ -434,7 +434,7 @@ namespace utf {
template<typename It>
static It encode(code_point u,It out)
{
- *out++ = u;
+ *out++ = static_cast<char_type>(u);
return out;
}