}
inline QChar const ucs4_to_qchar(char_type const ucs4) {
+ // FIXME: The following cast is not a real conversion but it work
+ // for the ucs2 subrange of unicode. Instead of an assertion we should
+ // return some special characters that indicates that its display is
+ // not supported.
+ BOOST_ASSERT(ucs4 < 65536);
return QChar(static_cast<unsigned short>(ucs4));
}
inline void ucs4_to_qstring(char_type const * str, size_t ls, QString & s)
{
- s.resize(ls);
- for (int i = ls; --i >= 0; )
+ int i = static_cast<int>(ls);
+ s.resize(i);
+ for (i ; --i >= 0; )
s[i] = ucs4_to_qchar(str[i]);
}