summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qchar.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qchar.h')
-rw-r--r--src/corelib/tools/qchar.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index bcfb361..5ece472 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -292,10 +292,10 @@ public:
return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
}
static inline ushort highSurrogate(uint ucs4) {
- return (ucs4>>10) + 0xd7c0;
+ return ushort((ucs4>>10) + 0xd7c0);
}
static inline ushort lowSurrogate(uint ucs4) {
- return ucs4%0x400 + 0xdc00;
+ return ushort(ucs4%0x400 + 0xdc00);
}
static Category QT_FASTCALL category(uint ucs4);
@@ -366,7 +366,7 @@ inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
#endif
inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
-inline QChar::QChar(uchar c, uchar r) : ucs((r << 8) | c){}
+inline QChar::QChar(uchar c, uchar r) : ucs(ushort((r << 8) | c)){}
inline QChar::QChar(short rc) : ucs(ushort(rc)){}
inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
@@ -374,9 +374,9 @@ inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
inline void QChar::setCell(uchar acell)
-{ ucs = (ucs & 0xff00) + acell; }
+{ ucs = ushort((ucs & 0xff00) + acell); }
inline void QChar::setRow(uchar arow)
-{ ucs = (ushort(arow)<<8) + (ucs&0xff); }
+{ ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }