summaryrefslogtreecommitdiff
path: root/src/sablotr.cpp
diff options
context:
space:
mode:
authorStef <stef@ws.local>2004-03-31 04:04:16 +0000
committerStef <stef@ws.local>2004-03-31 04:04:16 +0000
commita4c0a06821a6f77ee1d7aebeb2eee02bb7aa913d (patch)
tree3de5c30f7fd9239c8db38fb1a5a8518064fa38b4 /src/sablotr.cpp
parent4d38570e69b996d6d119808c66460ceb4fe940b0 (diff)
Unix porting
Unix porting
Diffstat (limited to 'src/sablotr.cpp')
-rw-r--r--src/sablotr.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sablotr.cpp b/src/sablotr.cpp
index 3b62cd6..218f0b8 100644
--- a/src/sablotr.cpp
+++ b/src/sablotr.cpp
@@ -80,10 +80,10 @@ bool DOM::transcode8to16(const std::basic_string<char>& data,
(c[2] & 0xC0) == 0x80 &&
(c[3] & 0xC0) == 0x80)
{
- ret.append(1, ((wchar_t)c[0] & 7) << 18 |
+ ret.append(1, (wchar_t)(((wchar_t)c[0] & 7) << 18 |
((wchar_t)c[1] & 63) << 12 |
((wchar_t)c[2] & 63) << 6 |
- ((wchar_t)c[3] & 63));
+ ((wchar_t)c[3] & 63)));
c += 3;
}
@@ -92,9 +92,9 @@ bool DOM::transcode8to16(const std::basic_string<char>& data,
(c[1] & 0xC0) == 0x80 &&
(c[2] & 0xC0) == 0x80)
{
- ret.append(1, ((wchar_t)c[0] & 15) << 12 |
+ ret.append(1, (wchar_t)(((wchar_t)c[0] & 15) << 12 |
((wchar_t)c[1] & 63) << 6 |
- ((wchar_t)c[2] & 63));
+ ((wchar_t)c[2] & 63)));
c += 2;
}
@@ -102,8 +102,8 @@ bool DOM::transcode8to16(const std::basic_string<char>& data,
else if((c[0] & 0xE0) == 0xC0 &&
(c[1] & 0xC0) == 0x80)
{
- ret.append(1, ((wchar_t)c[0] & 31) << 6 |
- ((wchar_t)c[1] & 63));
+ ret.append(1, (wchar_t)(((wchar_t)c[0] & 31) << 6 |
+ ((wchar_t)c[1] & 63)));
c += 1;
}