From: Peter Kümmel Date: Wed, 29 Nov 2006 22:57:34 +0000 (+0000) Subject: remove size_t/int warning: QString doesn't use size_t so we must cast it to avoid... X-Git-Tag: 1.6.10~11699 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f4c32de361e3b001566a466dc057e7f75f429901;p=lyx.git remove size_t/int warning: QString doesn't use size_t so we must cast it to avoid the warning git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16117 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/qt_helpers.C b/src/frontends/qt4/qt_helpers.C index b1dfd2c62d..ce329e1c63 100644 --- a/src/frontends/qt4/qt_helpers.C +++ b/src/frontends/qt4/qt_helpers.C @@ -113,9 +113,9 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo, void ucs4_to_qstring(lyx::docstring const & str, QString & s) { - size_t const ls = str.size(); - s.resize(ls); - for (int i = ls; --i >= 0; ) + int i = static_cast(str.size()); + s.resize(i); + for (i; --i >= 0; ) s[i] = ucs4_to_qchar(str[i]); } diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index 29a3fbfaee..1bfed02b7f 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -87,8 +87,9 @@ void ucs4_to_qstring(docstring const & str, QString & s); 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(ls); + s.resize(i); + for (i ; --i >= 0; ) s[i] = ucs4_to_qchar(str[i]); }