summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont_win.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-09-02 13:58:51 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-09-02 13:58:51 +0200
commit106a896b2e9326b25a704ed683bca5ee739e7c78 (patch)
treed27167f2b89274276a9d9aab147da898a8f174d9 /src/gui/text/qrawfont_win.cpp
parentab31160c72ea7e7b03604c87ecac11d756da9dce (diff)
fix "comparison between signed and unsigned" warnings
Merge-request: 1343 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/text/qrawfont_win.cpp')
-rw-r--r--src/gui/text/qrawfont_win.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/text/qrawfont_win.cpp b/src/gui/text/qrawfont_win.cpp
index f612ef1579..4d2305fe78 100644
--- a/src/gui/text/qrawfont_win.cpp
+++ b/src/gui/text/qrawfont_win.cpp
@@ -61,18 +61,16 @@ namespace {
operator T() const
{
T littleEndian = 0;
- for (int i=0; i<sizeof(T); ++i) {
+ for (int i = 0; i < int(sizeof(T)); ++i)
littleEndian |= data[i] << ((sizeof(T) - i - 1) * 8);
- }
return littleEndian;
}
BigEndian<T> &operator=(const T &t)
{
- for (int i=0; i<sizeof(T); ++i) {
+ for (int i = 0; i < int(sizeof(T)); ++i)
data[i] = ((t >> (sizeof(T) - i - 1) * 8) & 0xff);
- }
return *this;
}
@@ -214,9 +212,9 @@ namespace {
+ nameRecord->offset;
const BigEndian<quint16> *s = reinterpret_cast<const BigEndian<quint16> *>(ptr);
- for (int j=0; j<nameRecord->length / sizeof(quint16); ++j)
- name += QChar(s[j]);
-
+ const BigEndian<quint16> *e = s + nameRecord->length / sizeof(quint16);
+ while (s != e)
+ name += QChar(*s++);
break;
}
}