commit 1273f25c76f313b4b4d89402b6c1cbc9b1644509
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Oct 10 10:07:23 2023 -0400

    Fix three sign-compare compiler warning
    
    Fixes three similar warnings. One of them is the following:
    
    src/insets/InsetInfo.cpp:1583:20: error: comparison of integers of 
different signs: 'int' and 'std::basic_string<wchar_t>::size_type' (aka 
'unsigned long') [-Werror,-Wsign-compare]
            for (int i = 0; i < sequence.length(); ++i) {
                            ~ ^ ~~~~~~~~~~~~~~~~~
---
 src/insets/InsetInfo.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp
index 4b92774..1cb6853 100644
--- a/src/insets/InsetInfo.cpp
+++ b/src/insets/InsetInfo.cpp
@@ -1580,7 +1580,7 @@ void xhtmlShortcutInfo(XMLStream & xs, const 
InsetInfoParams & params) {
        odocstringstream ods;
        string const lcode = params.lang->code();
        docstring trans;
-       for (int i = 0; i < sequence.length(); ++i) {
+       for (size_t i = 0; i < sequence.length(); ++i) {
            char_type const c = sequence[i];
                const auto keyMapping = keyToString.find(c);
                if (keyMapping != keyToString.end()) {
@@ -1675,7 +1675,7 @@ void docbookMenuInfo(XMLStream & xs, Buffer const & 
buffer, const InsetInfoParam
        xml::openTag(xs, "menuchoice", attr, "inline"); // More of an inline 
tag in this case, as there is no db:shortcut to
        // accompany the succession of menus.
 
-       for (int i = 0; i < names.size(); ++i) {
+       for (size_t i = 0; i < names.size(); ++i) {
            docstring const & name = names[i];
 
                std::string tag;
@@ -1746,7 +1746,7 @@ void xhtmlMenuInfo(XMLStream & xs, Buffer const & buffer, 
const InsetInfoParams
        // Use bdo instead of span to specify the text direction (dir is only 
allowed globally or on bdo).
        xml::openTag(xs, "bdo", attr, "inline");
 
-       for (int i = 0; i < names.size(); ++i) {
+       for (size_t i = 0; i < names.size(); ++i) {
            docstring const & name = names[i];
 
                //FIXME: add proper underlines here. This
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to