Kaydet (Commit) 1b60c3d6 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Stephan Bergmann

Avoid conversion warnings in rtl::get[High|Low]Surrogate

Change-Id: I5eec1f7505e27eedd39081669011f7af42b8a26f
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst cbe3b2fe
...@@ -261,7 +261,7 @@ inline bool isLowSurrogate(sal_uInt32 code) { ...@@ -261,7 +261,7 @@ inline bool isLowSurrogate(sal_uInt32 code) {
inline sal_Unicode getHighSurrogate(sal_uInt32 code) { inline sal_Unicode getHighSurrogate(sal_uInt32 code) {
assert(code <= 0x10FFFF); assert(code <= 0x10FFFF);
assert(code >= 0x10000); assert(code >= 0x10000);
return ((code - 0x10000) >> 10) | detail::surrogatesHighFirst; return static_cast<sal_Unicode>(((code - 0x10000) >> 10) | detail::surrogatesHighFirst);
} }
/** Get low surrogate half of a non-BMP Unicode code point. /** Get low surrogate half of a non-BMP Unicode code point.
...@@ -275,7 +275,7 @@ inline sal_Unicode getHighSurrogate(sal_uInt32 code) { ...@@ -275,7 +275,7 @@ inline sal_Unicode getHighSurrogate(sal_uInt32 code) {
inline sal_Unicode getLowSurrogate(sal_uInt32 code) { inline sal_Unicode getLowSurrogate(sal_uInt32 code) {
assert(code <= 0x10FFFF); assert(code <= 0x10FFFF);
assert(code >= 0x10000); assert(code >= 0x10000);
return ((code - 0x10000) & 0x3FF) | detail::surrogatesLowFirst; return static_cast<sal_Unicode>(((code - 0x10000) & 0x3FF) | detail::surrogatesLowFirst);
} }
/** Combine surrogates to form a code point. /** Combine surrogates to form a code point.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment