From f4c32de361e3b001566a466dc057e7f75f429901 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Wed, 29 Nov 2006 22:57:34 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/qt_helpers.C | 6 +++--- src/frontends/qt4/qt_helpers.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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]); } -- 2.39.5