Avoid warnings about conversion to wxUint16 in wxUniChar code

This conversion is intentional, so suppress the -Wconversion warning
given by g++ 7 (if this warning is enabled) with an explicit cast.
This commit is contained in:
Vadim Zeitlin
2018-03-06 16:00:47 +01:00
parent 2881d9875a
commit 1540361e75

View File

@@ -93,14 +93,14 @@ public:
static wxUint16 HighSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character");
return 0xD800 | ((value - 0x10000) >> 10);
return static_cast<wxUint16>(0xD800 | ((value - 0x10000) >> 10));
}
// Returns the low surrogate code unit for the supplementary character
static wxUint16 LowSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character");
return 0xDC00 | ((value - 0x10000) & 0x03FF);
return static_cast<wxUint16>(0xDC00 | ((value - 0x10000) & 0x03FF));
}
// Returns true if the character is a BMP character: